﻿// JScript File
var dynZoomURL = "";      
function OnClickEnlargeImage(Sku){
var url = BaseUrl + "/Product/ImageViewer.aspx?sku=" + Sku;
newWindow = window.open(url, 'ImageViewer', 'width=475,height=400,status=yes');
newWindow.creator = self;}
function ChangeImage( imgID, imgsrc, imgwidth, imgheight )
{if( document.getElementById( imgID ) ){ 
(document.getElementById(imgID)).src = imgsrc; 
(document.getElementById(imgID)).width = imgwidth; 
(document.getElementById(imgID)).height = imgheight; }}
function ChangeImageSrc( imgObj, imgsrc ){imgObj.src = imgsrc;}
function ChangeImageOnCLick( imgID, onclickStr ){if( document.getElementById( imgID ) ){ (document.getElementById( imgID )).onclick = onclickStr; }}
function SwapMainandZoomProdImg(  imgID, imgsrc, zoomurl, imgwidth, imgheight  )
{if( document.getElementById( imgID ) ){ 
(document.getElementById(imgID)).src = imgsrc; 
(document.getElementById(imgID)).width = imgwidth; 
(document.getElementById(imgID)).height = imgheight; 
dynZoomURL = zoomurl;}}
function ZoomImage( imgurl ){window.open( imgurl,'_Zoom','menubar=no,height=450,width=450,scrollbars=yes,resizable=yes,top=10,left=10');}
function ProdImageZoom( zoomURL )
{if( dynZoomURL.length == 0 ){window.open( zoomURL, '_Zoom','menubar=no,height=450,width=450,scrollbars=yes,resizable=yes,top=10,left=10');}
else{window.open( dynZoomURL, '_Zoom','menubar=no,height=450,width=450,scrollbars=yes,resizable=yes,top=10,left=10');}}
function HelpPageLoad( zoomURL, width, height ){window.open( zoomURL, '_Zoom','menubar=no,height=' + height + ',width=' + width + ',scrollbars=yes,resizable=yes,top=10,left=10');   }
function clearTxtBox( elemObj ){if (elemObj.defaultValue == elemObj.value) {elemObj.value = ""}}
function HideTip( elemID ){if( document.getElementById( elemID ) ){ (document.getElementById(elemID)).style.visibility = "hidden"; } }
function ShowTip( elemID ){if( document.getElementById( elemID ) ){ (document.getElementById(elemID)).style.visibility = "visible"; } }
function ShowWait( elemID ){$('#' + elemID).show(); window.setTimeout('ShowProgressImg()',100);}
function ShowProgressImg(){$('.imgProcessDisplay').attr('src',$('.imgProcessDisplay').attr('src'));}
$(document).ready(function() {
	$('#Searchtxtbx').focus(function(){
		if ($(this).val()=="Enter Search Terms")
		{
			$(this).val('').css('color', '#000');
		}
	}).blur(function(){
		if ($(this).val()=='')
		{
			$(this).val("Enter Search Terms").css('color', '#666');
		}
	}).keydown(function(e) {
		if(e.keyCode == 13) {
			doSearch();
			return false;
		}
	});
	$('.searchBtnSubmit').click(doSearch);	
});
function doSearch(){if( $('#Searchtxtbx').val() != "Enter Search Terms" ){window.location=BaseUrl+"/gallery/search.aspx?searchstr=" + $('#Searchtxtbx').val();}}
