function MM_swapImgRestore(){for(var x,a=document.MM_sr,i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc}function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=[];for(var j=d.MM_p.length,a=MM_preloadImages.arguments,i=0;i<a.length;i++)if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i]}}}function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p)}if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x}function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=[];for(i=0;i<a.length-2;i+=3)if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2]}}function ShowMore(section,id,i){if(id==1){objSpan=document.getElementById("spanItem-"+section+"-"+i);while(objSpan!=null){if(objSpan.style.display=="none")objSpan.style.display="block";i++;objSpan=document.getElementById("spanItem-"+section+"-"+i)}document.getElementById("lnkMore"+section).style.display="none";document.getElementById("lnkLess"+section).style.display="inline"}i++;if(id==2){objSpan=document.getElementById("spanItem-"+section+"-"+i);while(objSpan!=null){if(objSpan.style.display=="block")objSpan.style.display="none";i++;objSpan=document.getElementById("spanItem-"+section+"-"+i)}document.getElementById("lnkMore"+section).style.display="inline";document.getElementById("lnkLess"+section).style.display="none"}}function replaceChars(entry,out,add_concat){temp=""+entry;while(temp.indexOf(out)>-1){pos=temp.indexOf(out);temp=""+(temp.substring(0,pos)+add_concat+temp.substring(pos+out.length,temp.length));temp=temp.replace("__","_")}if(temp.length>0&&temp.indexOf("_")==temp.length-1)temp=temp.substring(0,temp.length-1);return temp}function keyHandler(evt,buttonName){evt=evt?evt:window.event?event:null;try{if(evt){var charCode=evt.charCode?evt.charCode:evt.keyCode?evt.keyCode:evt.which?evt.which:0;charCode==13&&jQuery("#"+buttonName).click()}}catch(e){}}function echeck(str){var at="@",dot=".",lat=str.indexOf(at),lstr=str.length,ldot=str.indexOf(dot);if(str.indexOf(dot+dot)>0)return false;if(str.indexOf(at)==-1)return false;if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr)return false;if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr)return false;if(str.indexOf(at,lat+1)!=-1)return false;if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot)return false;if(str.indexOf(dot,lat+2)==-1)return false;if(str.indexOf(" ")!=-1)return false;return true}function getCookie(name){var start=document.cookie.indexOf(name+"="),len=start+name.length+1;if(!start&&name!=document.cookie.substring(0,name.length))return null;if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(len,end))}function changePageOption(value){if(value!=undefined)window.location=value}function giftLocation(){window.location="/Gift/GiftCertificates/"}jQuery(document).ready(function(){jQuery("#btnSearch").click(function(){var keyword=jQuery("#searchKeyword").val(),itemCount=getCookie("ItemCount");keyword=keyword.replace(/[^a-zA-Z-_ 0-9]+/g,"");keyword=keyword.replace("'","''");keyword=replaceChars(keyword," ",CONCATENATE_SIGN);if(keyword!=""){(itemCount==undefined||parseInt(itemCount)==0)&&jQuery.getJSON("/Home/getDataItemCount",function(data){itemCount=data.count});if(itemCount==undefined||parseInt(itemCount)==0)itemCount=21;window.location="/Product/Search/"+itemCount+"/1/1/"+keyword+"/"}});jQuery("#btnSignUpEmail").click(function(){var email=jQuery("#email").val();if(email==null||email==""){jQuery("#message").html("");jQuery("#message").append(EMAIL_PLEASE_INPUT);return false}if(!echeck(email)){jQuery("#message").html("");jQuery("#message").append(EMAIL_INVALIDATE);return false}window.location="/account/NewsletterSignup.aspx?email="+email});jQuery("#btnSignupBottom").click(function(){var email=jQuery("#signup").val();if(email==null||email==""){jQuery("#message-error-email").css({display:"block"});jQuery("#message-error-email").text(EMAIL_PLEASE_INPUT);return false}if(!echeck(email)){jQuery("#message-error-email").css({display:"block"});jQuery("#message-error-email").text(EMAIL_INVALIDATE);return false}window.location="/account/NewsletterSignup.aspx?email="+email});jQuery("#linkBreadScrumb").click(function(){var url="";url=jQuery("#linkBreadScrumbSeeAll").attr("href");if(url!=undefined&&url!=null)window.location=url;return false})});