if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());(function($){$.newegg={buildCurrent:function(relativePath){return location.protocol+"//"+location.host+"/"+relativePath},buildWWW:function(relativePath){return wwwSite+"/"+relativePath},buildShopper:function(relativePath){return shopperSite+"/"+relativePath},buildSSL:function(relativePath){return sslSite+"/"+relativePath},format:function(source,params){if(arguments.length==1){return function(){var args=$.makeArray(arguments);args.unshift(source);return $.newegg.format.apply(this,args)}}if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1)}if(params.constructor!=Array){params=[params]}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n)});return source},cookie:{set:function(name,value,options){var cv="";options=options||{};value=value||null;if(value==null){options=$.extend({},options);options.expires=-1}if(value!=null&&typeof(value)=="string"){cv=escape(value)}else{if(value!=null&&typeof(value)=="object"){var jsonv=$.newegg.cookie.ToJson($.newegg.cookie.get(name));if(jsonv==false){jsonv={}}for(var k in value){eval("jsonv."+k+'="'+value[k]+'"')}for(var k in jsonv){cv+=k+"="+escape(jsonv[k])+"&"}cv=cv.substring(0,cv.length-1)}}var expires="";if(options.expires&&(typeof options.expires=="number"||options.expires.toUTCString)){var date;if(typeof options.expires=="number"){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000))}else{date=options.expires}expires="; expires="+date.toUTCString()}var path=options.path?"; path="+(options.path):"; path=/";var domain=options.domain?"; domain="+(options.domain):"";if(options.topdomain){var host=location.hostname;hostindex=host.indexOf(".");if(hostindex>0){host=host.substring(hostindex);domain="; domain="+host}}var secure=options.secure?"; secure":"";document.cookie=[name,"=",cv,expires,path,domain,secure].join("")},get:function(n,k){var reg=new RegExp("(^| )"+n+"=([^;]*)(;|$)");var arr=document.cookie.match(reg);if(arguments.length==2){if(arr!=null){var kArr,kReg=new RegExp("(^| |&)"+k+"=([^&]*)(&|$)");var c=arr[2];var c=c?c:document.cookie;if(kArr=c.match(kReg)){return unescape(kArr[2])}else{return""}}else{return""}}else{if(arguments.length==1){if(arr!=null){return unescape(arr[2])}else{return""}}}},ToJson:function(cv){var cv=cv.replace(new RegExp("=","gi"),":'").replace(new RegExp("&","gi"),"',").replace(new RegExp(";\\s","gi"),"',");return eval("({"+cv+(cv.length>0?"'":"")+"})")},clear:function(name,options){var expires=";expires=Thu, 01-Jan-1900 00:00:01 GMT";var path=options.path?"; path="+(options.path):"; path=/";var domain=options.domain?"; domain="+(options.domain):"";if(options.topdomain){var host=location.hostname;hostindex=host.indexOf(".");if(hostindex>0){host=host.substring(hostindex);domain="; domain="+host}}var secure=options.secure?"; secure":"";document.cookie=[name,"=",expires,path,domain,secure].join("")}},querystring:{get:function(key){var qs=$.newegg.querystring.parse();var value=qs[key];return(value!=null)?value:""},set:function(key,value){var qs=$.newegg.querystring.parse();qs[key]=encodeURIComponent(value);return $.newegg.querystring.toString(qs)},parse:function(qs){var params={};if(qs==null){qs=location.search.substring(1,location.search.length)}if(qs.length==0){return params}qs=qs.replace(/\+/g," ");var args=qs.split("&");for(var i=0,l=args.length;i<l;i++){var pair=args[i].split("=");var name=pair[0];var value=(pair.length==2)?pair[1]:name;params[name]=value}return params},toString:function(qs){if(qs==null){qs=$.newegg.querystring.parse()}var val="";for(var k in qs){if(val==""){val="?"}val=val+k+"="+qs[k]+"&"}val=val.substring(0,val.length-1);return val}},imgLoad:{objArray:[],loadImg:function(obj){if(obj&&obj.length>0){for(var i=0,l=obj.length;i<l;i++){if($.inArray(obj[i],$.newegg.imgLoad.objArray)==-1){$.newegg.imgLoad.objArray.push(obj[i])}}}$.newegg.imgLoad.load()},pageTop:function(){return document.documentElement.clientHeight+Math.max(document.documentElement.scrollTop,document.body.scrollTop)},load:function(){for(var i=0,l=$.newegg.imgLoad.objArray.length;i<l;i++){var jObj=$("#"+$.newegg.imgLoad.objArray[i]);if(jObj){jObj.find("img").each(function(){if($(this).offset().top<=$.newegg.imgLoad.pageTop()){var src2=$(this).attr("src2");if(src2){$(this).attr("src",src2).removeAttr("src2")}}})}}}}}})(jQuery);function startTabA(A,B){var D="."+A;var C=$(D);if(C.length){$(D+" .tabs a").click(function(){var H=$(this).parents(D).get(0).id;var F=$(this).parents(".tabs").children("*");var G=F.length;F.removeClass("currentBtn");if($(this).parents(".tabs").children("a").length>0){$(this).addClass("currentBtn")}else{$(this).parent().addClass("currentBtn")}for(var E=1;E<=G;E++){$("#"+H+"_"+E).hide()}$("#"+H+"_"+this.rel).show();$.newegg.imgLoad.loadImg([H+"_"+this.rel]);return false});if($(D+" .prevView").length){$(D+" .prevView").click(function(){var F=$(this).parents(D).get(0).id;var E=parseInt($("#"+F+" .tabs .currentBtn").attr("rel"))-1;if(E<1){E=$("#"+F+" .tabs a").length}$("#"+F+" .tabs a").eq(E-1).click()})}if($(D+" .nextView").length){$(D+" .nextView").click(function(){var F=$(this).parents(D).get(0).id;var E=parseInt($("#"+F+" .tabs .currentBtn").attr("rel"))+1;if(E>$("#"+F+" .tabs a").length){E=1}$("#"+F+" .tabs a").eq(E-1).click()})}}}function startTabB(A){var C="."+A;var B=$(C);if(B.length){C="."+A;$(C+" .tabs a").mouseover(function(){$(this).click()})}}function onoff(B){var A="."+B;var C=$(A);if(C.length){if($.browser.msie){C.parent().hover(function(){$(this).addClass("over")},function(){C.parent().removeClass("over")})}else{C.parent().mouseover(function(){$(this).addClass("over")}).mouseout(function(){$(this).removeClass("over")})}}}function onoff_2(A){var B=$(A);if(B.length){B.mouseover(function(){B.removeClass("over");$(this).addClass("over")})}}function onoff_3(B){var A="."+B;var C=$(A);if(C.length){if($.browser.msie){C.parent().hover(function(){var F=$(this).offset();var E=document.documentElement.scrollTop;var G=document.documentElement.clientHeight;var D=$(A,this).height();if(F.top-E>D){if((G-F.top+E)<D){$(A,this).addClass("dirUp");$(A,this).css("top",23-D)}}$(this).addClass("over")},function(){C.parent().removeClass("over");$(A,this).removeClass("dirUp");$(A,this).css("top","1px")})}else{C.parent().mouseover(function(){var F=$(this).offset();var E=document.documentElement.scrollTop+document.body.scrollTop;var G=document.documentElement.clientHeight;var D=$(A,this).height();if(F.top-E>D){if((G-F.top+E)<D){$(A,this).addClass("dirUp")}}$(this).addClass("over")}).mouseout(function(){$(this).removeClass("over");$(A,this).removeClass("dirUp")})}}}function onoffDelay(B){var E,C;var A="."+B;var D=$(A);D.parent().mouseover(function(){var F=$(this);if($(this).find(A).css("display")=="block"){F.addClass("over");clearTimeout(C)}else{E=setTimeout(function(){F.addClass("over")},350)}}).mouseout(function(){var F=$(this);if(E){clearTimeout(E);C=setTimeout(function(){F.removeClass("over")},350)}});D.mouseover(function(){$(this).parent().addClass("over")})}function defaultText(){var B=$(".hasDefaultText");var A=new Array();var C=0;for(i=1,l=B.length;i<=l;i++){A[i-1]=B.eq(i-1).val()}B.focus(function(){C=B.index($(this));if($(this).val()==A[C]){$(this).val("");$(this).addClass("hasDefaultTextOn")}});B.blur(function(){C=B.index($(this));if($(this).val()==""){$(this).val(A[C]);$(this).removeClass("hasDefaultTextOn")}})}var isMouseOnOver=false;function onoff_4(C,B){var A="."+C;var D=$(A);if(D.length){if($.browser.msie){D.parent().hover(function(){isMouseOnOver=true;if(typeof B!="undefined"){var E=$(this);B(D,function(){if(isMouseOnOver==true){E.addClass("over")}})}},function(){isMouseOnOver=false;$(this).removeClass("over")})}else{D.parent().mouseover(function(){isMouseOnOver=true;if(typeof B!="undefined"){var E=$(this);B(D,function(){if(isMouseOnOver==true){E.addClass("over")}})}}).mouseout(function(){isMouseOnOver=false;$(this).removeClass("over")})}}}var imgPlayer={init:function(){if(typeof(bannerConfig)=="undefined"||!bannerConfig||bannerConfig.length==0){return}for(var C=0,A=bannerConfig.length;C<A;C++){var D="imgPlayer.imgPlayerTopAndMidIndex('"+bannerConfig[C].location+"','"+JSON.stringify(bannerConfig[C].photos)+"')";var B=bannerConfig[C].delay;setTimeout(D,B)}},showNumImg:function(B,A){var C=$(B).find(".num li.over .numVal").text();if(A=="forward"){if(C<1||C>$(B+" .num li").length-1){C=0}}else{if(A=="backward"){if(C<=1||C>$(B+" .num li").length){C=$(B+" .num li").length-1}else{C=C-2}}else{if(C<1||C>$(B+" .num li").length-1){C=0}}}$(B+" .num li").removeClass("over").eq(C).addClass("over");$(B+" .img li").fadeOut(1000).eq(C).fadeIn(1000)},imgPlayerTopAndMidIndex:function(H,F){var B="#focusViwer"+H;var G=JSON.parse(F);if(G.length<=1){return}var I="";for(var D=1,C=G.length+1;D<C;D++){I+=("<li><span class='numVal'>"+D+"</span></li>")}var E='<div id="TopAD" class="slideBanner" style="display:none;"><ul class="img"></ul><div class="page"><a class="prevView" href="javascript:void(0);"></a><ul class="num">'+I+'</ul><a class="nextView" href="javascript:void(0);"></a></div></div>';$(B).append(E);$(G).each(function(){D++;$(B+" .img").append("<li><a href='"+$(this)[2]+"' title='"+$(this)[1]+"' target='_blank'><img src='"+$(this)[0]+"' /></a></li>")});$(B+" .img li").hide();$(B+" .title").hide();$(B+" .num li .numVal").mouseover(function(){$(B+" .num li").removeClass("over");$(this).parent().addClass("over");$(B+" .img li").fadeOut(1000).eq($(this).text()-1).fadeIn(1000)});$(B+" .prevView").click(function(){imgPlayer.showNumImg(B,"backward")});$(B+" .nextView").click(function(){imgPlayer.showNumImg(B,"forward")});$(B+" .num li").eq(0).addClass("over");$(B+" .img li").eq(0).show("fast");$(B+">a").fadeOut(1000).remove();$(B+">div").fadeIn(1000);var A=setInterval('imgPlayer.showNumImg("'+B+'")',6000);$(B+">div").mouseenter(function(){clearInterval(A)});$(B+">div").mouseleave(function(){A=setInterval('imgPlayer.showNumImg("'+B+'")',6000)})}};var autoFilledKeywords={json:null,xml:null,index:0,key:"",formID:"Search",textboxID:"topSearch",autofilledviewID:"autofilledview",url:"",deferExec:null,keyIndex:0,returnIndex:0,onload:function(){var A=autoFilledKeywords;if($(A.autofilledviewID)){$("#"+A.autofilledviewID).mouseover(function(B){var D=B.srcElement||B.target;if(D){if(D.nodeName=="A"){var C=A.index;A.index=D.id.replace(/[a-z]/ig,"");if(C==0||C!=A.index){A.highlight(A.index,C)}}}});$("#"+A.autofilledviewID).click(function(B){var C=B.srcElement||B.target;var D=A.decodeHtml($(C).text());$("#"+A.textboxID).val(D)})}if($(A.textboxID)){$("#"+A.textboxID).keyup(A.query);$("#"+A.textboxID).blur(function(){A.keyIndex=0;A.returnIndex=0})}$("body").click(function(B){var C=B.srcElement||B.target;if(C.id!=A.autofilledviewID&&C.id!=A.textboxID){A.hide()}})},query:function(C){var B=autoFilledKeywords;var D=C.which||C.keyCode;switch(D){case 13:case 37:case 39:break;case 27:B.clear();break;case 38:if($("#"+B.autofilledviewID).html().length>0){B.show();var E=B.index;if(E<=1){B.index=$("#"+B.autofilledviewID+" a").length}else{--B.index}$("#"+B.textboxID).val(B.decodeHtml($("#line"+B.index).text()));B.highlight(B.index,E)}break;case 40:if($("#"+B.autofilledviewID).html().length>0){B.show();var E=B.index;if(E>=$("#"+B.autofilledviewID+" a").length){B.index=1}else{++B.index}$("#"+B.textboxID).val(B.decodeHtml($("#line"+B.index).text()));B.highlight(B.index,E)}break;default:if(this.id){var A=jQuery("#"+this.id).val();if(A==""){B.clear();B.key="";return}clearTimeout(B.deferExec);B.deferExec=setTimeout(function(){var F=",9,16,17,19,20,33,34,35,36,37,38,39,40,45,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,144,145,";var G=(F.split(","+D+",")).length-1;if(G<=0){B.keyIndex++;A=escape(A).replace(/\*/g,"%2A").replace(/\+/g,"%2B").replace(/-/g,"%2D").replace(/\./g,"%2E").replace(/\//g,"%2F").replace(/@/g,"%40").replace(/_/g,"%5F");$.ajax({type:"GET",dataType:"json",url:B.url,data:"Keyword="+A,success:function(H){B.returnIndex++;if(B.keyIndex==B.returnIndex){B.fill(H.Data)}},error:function(){B.returnIndex++}})}},300)}}},clear:function(){var A=autoFilledKeywords;A.abort();var B=$(A.autofilledviewID);if(B){$(B).empty();A.hide()}A.index=0},abort:function(){var A=autoFilledKeywords;if(A.xml){A.xml.abort()}},show:function(){$("#divAutoFilled").css("display","block")},hide:function(){$("#divAutoFilled").css("display","none")},highlight:function(D,C){if(D){var B=$("#line"+D);if(B){$(B).css("color","#FFF");$(B).css("background","#316AC5");$(B).css("text-decoration","none")}}if(C){var A=jQuery("#line"+C);if(A){$(A).css("color","");$(A).css("background","");$(A).css("text-decoration","")}}},fill:function(E){var D=autoFilledKeywords;json=E;if(json){var C=[];for(var B=0,A=$(json).length;B<A;B++){var F=json[B].Keyword.replace(/\&/g,"&amp;").replace(/\>/g,"&gt;").replace(/\</g,"&lt;").replace(/\'/g,"&#039;").replace(/\"/g,"&quot;");C.push('<a id="line'+(B+1)+'"href="javascript:void(0);">'+F+"</a>")}$("#"+this.autofilledviewID).html(C.join(""));if(C.length>0){D.show()}else{D.hide()}}else{D.hide()}},decodeHtml:function(A){return A.replace(/(&quot;)/g,'"').replace(/(&#039;)/ig,"'").replace(/(&lt;)/ig,"<").replace(/(&gt;)/ig,">").replace(/(&amp;)/ig,"&")}};var openWinMode={setBlank:function(K){K=K=="N"?"_blank":"";var S=window.location.href;var E=document.getElementsByTagName("a");var I=/Product\/\w{2}-\w{2,3}-\w{3,5}\.htm/i;var P=/Shopping\/ShoppingCart.aspx/i;var A=/Customer\/WishList.aspx/i;var O=/Service\/HelpCenter.aspx/i;var C=/News\/\d+\.htm/i;var D=/NewsList\/\w+\.htm/i;var R=/Promotion-\d+\.htm/i;var T=false;if(location.href.toLowerCase()==$.newegg.buildWWW("default.aspx").toLowerCase()||location.href.toLowerCase()==$.newegg.buildWWW("").toLowerCase()){T=true}var J,G;var F=E.length;for(var Q=F;Q--;){J=E[Q];G=J.href.indexOf("#")==-1?false:true;if(I.test(J)&&G==false){J.target=K}else{if(O.test(J)&&!O.test(S)){J.target=K}else{if(C.test(J)&&K=="_blank"){J.target=K}else{if(R.test(J)||(D.test(J)&&!D.test(S))){J.target=K}else{if($(J).attr("ref")=="blank"){if(T==false){var B=/Customer\/Default.aspx/i;var M=/Order\/OrderQuery.aspx/i;var N=/Brands.htm/i;var H=/CountDown.*.htm/i;var L=/Treasurehunt.*.htm/i;if((B.test(J)&&B.test(S))||(M.test(J)&&M.test(S))||(N.test(J)&&N.test(S))||(H.test(J)&&H.test(S))||(M.test(J)&&M.test(S))||(L.test(J)&&L.test(S))){J.target=""}else{J.target=K}}else{J.target=K}}else{if($(J).attr("ref")!="noBlank"){if((P.test(J)&&!P.test(S))||(A.test(J)&&!A.test(S))){J.target=K}}}}}}}}if(T==true&&K!="_blank"){$("#websliceShoppingAdvice .notice a").attr("target","_blank")}if(I.test(S)){$("#help71").attr("target","_blank")}},updateState:function(A){var C=$.newegg.cookie.get("Blank");if(C==A){return}if(A){$.newegg.cookie.set("Blank",A,{topdomain:true,expires:9999});openWinMode.setBlank(A);var B=$.newegg.cookie.get("CustomerLogin","ID");if(B!=""){$.post("Ajax/Customer/AjaxCustomerWebsiteProfile.aspx",{displayMethod:A})}}else{openWinMode.setBlank(C)}},initButtonState:function(A){if(A=="N"){$("#btnNoBlank").removeClass("btnSelectOldWin");$("#btnNewBlank").addClass("btnSelectNewWin")}else{if(A=="C"){$("#btnNewBlank").removeClass("btnSelectNewWin");$("#btnNoBlank").addClass("btnSelectOldWin")}}},init:function(){var A=$.newegg.cookie.get("Blank");if($("#openSet").length){$("#setPanel").bind({mouseover:function(){$(this).stop(true,true).fadeTo(100,1)},mouseleave:function(){$(this).delay(2000).fadeOut(2000,function(){$(this).hide()})}});$("#openSet > #onOffBtn").click(function(){if($("#setPanel").css("display")!="none"&&$.newegg.cookie.get("Blank")!="N"&&$.newegg.cookie.get("Blank")!="C"){return}$("#setPanelOk").hide();$("#setPanel").toggle()});$(".btnNewWin").click(function(){if($.newegg.cookie.get("Blank")=="N"){return}$("#setPanel").hide();$("#setPanelOk").show();$("#setPanelOk").delay(2000).fadeOut("fast");openWinMode.initButtonState("N");openWinMode.updateState("N")});$(".btnOldWin").click(function(){if($.newegg.cookie.get("Blank")=="C"){return}$("#setPanel").hide();$("#setPanelOk").show();$("#setPanelOk").delay(2000).fadeOut("fast");openWinMode.initButtonState("C");openWinMode.updateState("C")});if(A=="N"||A=="C"){openWinMode.initButtonState(A);openWinMode.setBlank(A)}else{$("#setPanel").show();$("#setPanel").delay(8000).fadeOut(2000)}}else{if(A=="N"){openWinMode.setBlank("N")}}}};function miniCart(E,D,F,C){var B={};if(D=="load"){if(F.html()!=""){if(typeof(C)!="undefined"){C()}return}}else{if(D=="delete"){B={action:"del",productno:E}}}var A=$.newegg.buildCurrent("Ajax/Shopping/MiniCart.aspx");$.get(A,B,function(G){if(D=="delete"&&location.href.toLowerCase().indexOf("shoppingcart.aspx")>0){window.location.reload();return}$(".cartCot").html($(G));$("#headerCartCount").text($("#minicartTotalQty").attr("value"));if(typeof(C)!="undefined"){C()}},"html")}function initSearch(){var A=$("#topSearch");if(!A){return}A.keydown(function(B){if(B.keyCode==13){doSearch();return false}})}function doSearch(){var A=$("#topSearch");var B=$.trim(A.val());var C="\u641c\u7d22\u5546\u54c1";if(B.length==0||B==C){alert(resources_Head.mustInputKeyWords);return}B=B.replace(/\#/g,"%23").replace(/\&/g,"%26").replace(/\+/g,"%2B");location.href=$.newegg.buildWWW("Search.aspx")+"?keyword="+B}var countDown={interv:{},array:[],init:function(){if($(".timeleft").length){var A=$.newegg.buildWWW("Ajax/Common/AjaxHomepageCountDown.aspx");$.getJSON(A,function(D){$(".timeleft").each(function(){var E=this;var F=$(this).attr("id");countDown.array.push({cID:F,cObj:E,left:0})});if($(D).length){for(var C=0,B=countDown.array.length;C<B;C++){$(D).each(function(){if(this.id==countDown.array[C].cID){countDown.array[C].left=this.leftTime}})}}countDown.interv=setInterval(countDown.start,1000)})}},start:function(){var B=true;for(var E=0,A=countDown.array.length;E<A;E++){if(countDown.array[E].cObj!=null){B=false;var F=countDown.array[E].cObj;countDown.array[E].left-=1;var G=countDown.array[E].left;if(G<=0){countDown.array[E].cObj=null;$(F).html('<p class="timeOut">'+resources_Home.countOver+"</p>")}else{var D=Math.floor(G/(60*60));var H=Math.floor(G/(60))%60;var C=Math.floor(G)%60;$(F).find("strong").each(function(I){if(I==0){$(this).text(D)}else{if(I==1){$(this).text(H)}else{if(I==2){$(this).text(C)}}}})}}}if(B==true){clearInterval(countDown.interv);countDown.array=null}}};function initLogin(){var B=$.newegg.cookie.get("ThirdPartyLogin","LogonType"),C=decodeURI(escape($.newegg.cookie.get("CustomerLogin","ID"))),G=decodeURI(escape($.newegg.cookie.get("CustomerLogin","ID"))),D="",A="";var E=$.trim($("#txtWelcome").val());if(G==""){C=decodeURI(escape($.newegg.cookie.get("LoginValidate","CID")));if(C==""){D=E.length==0?resources_Head.welcome_NotLogin2:$.newegg.format(resources_Head.welcome_NotLogin,E)}else{D=$.newegg.format(resources_Head.welcome_Login,C,E)}if(B=="PingAn"){A=$.newegg.format(resources_Head.noRegister,$.newegg.buildSSL("Customer/Login.aspx"))}else{A=$.newegg.format(resources_Head.login,$.newegg.buildSSL("Customer/Login.aspx"),$.newegg.buildSSL("Customer/Register.aspx"))}}else{if(B==""){D=E.length==0?$.newegg.format(resources_Head.welcome_Login2,C):$.newegg.format(resources_Head.welcome_Login,C,E)}else{C=decodeURI(escape($.newegg.cookie.get("ThirdPartyLogin","PassportName")))||decodeURI(escape($.newegg.cookie.get("ThirdPartyLogin","ThirdPartyID")));var F=decodeURI(escape($.newegg.cookie.get("ThirdPartyLogin","ThirdPartyName")));if(B=="QQFanli"){D=$.newegg.format(resources_Head.welcome_QQLogin,F,C.replace("%3F","?"))}else{if(B=="Netease"){D=$.newegg.format(resources_Head.welcome_Netease,F,C.replace("%3F","?"))}else{D=$.newegg.format(resources_Head.welcome_ThirdLogin,F,C)}}}A=$.newegg.format(resources_Head.logOut,$.newegg.buildSSL("Customer/Logout.aspx"))}$(".welcome").html(D+A)}function initCMMC(){var B=$.trim($.newegg.querystring.get("cm_mmc"));if(!B){return}var A="cmp";if(B.indexOf("google")>-1){A="google"}$.newegg.cookie.set("NewAdvEffectMonitor",{Advalue:B,Type:A},{topdomain:true,expires:10})}function subScription(){var B=$.trim($("#txtEmail").val());if(B.length==0){alert(resources_Home.mailEmpty);return}var D=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/;var E=/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;if(D.test(B)==true||E.test(B)==false){alert(resources_Home.addressError);return}var A={txtEmail:escape(B)};var C=$.newegg.buildWWW("Ajax/Common/AjaxSubscription.aspx");$.post(C,A,function(F){alert(F.Description);$("#txtEmail").attr("value",resources_Home.mailInit);$("#txtEmail").removeClass("hasDefaultTextOn");defaultText()},"json")}function clickPoll(D,C){var A=$(".voteContent input:checked").val();if(typeof(A)=="undefined"){A=0}var B=$.newegg.buildWWW("Service/Poll.aspx")+"?PollSysno="+D+"&PollType="+C;if(C=="1"){B+="&PollItemSysno="+A}window.open(B,"","")}$("#header").ready(function(){if($(".welcome").length){initLogin()}var A=$.newegg.cookie.get("ThirdPartyLogin","LogonType");if(A=="PingAn"){if($(".extraFunc").length){$(".extraFunc").hide()}if($(".logo-wanlitong").length){$(".logo-wanlitong").show()}}if($(".subTopCate").length){onoffDelay("subTopCate")}if($(".myCot").length){onoff("myCot")}if($(".cartCot").length){onoff_4("cartCot",function(D,C){miniCart("","load",D,C)})}if($("#headerCartCount").length){var B=$.newegg.cookie.get("CartCookie","cartQty");if(B==""){B=0}$("#headerCartCount").text(B)}if($(".Search").length){autoFilledKeywords.url=$.newegg.buildCurrent("Ajax/Common/AutoFilledKeywords.aspx");autoFilledKeywords.onload();initSearch("topSearch")}});jQuery(function(A){initCMMC();imgPlayer.init();openWinMode.init()});

