var coni;var userPassword;var Ptr=document.getElementsByTagName("li");function GetObj(objName){return document.getElementById(objName)}function show_none(isShow){if(document.all){var objSel=GetObj("selectPrice");if(objSel==null){return}if(isShow){objSel.style.display="block"}else{objSel.style.display="none"}}}function productClass(obj){var id=obj.id;var objParent=obj.parentNode;for(var i=0;i<objParent.childNodes.length;i++){if(id==objParent.childNodes[i].id){GetObj(id).className='small_on'}else{objParent.childNodes[i].className=''}}}String.prototype.trim=function String$trim(){return this.replace(/^\s+|\s+$/g,"")};function menuFix(){var sfEls=GetObj("nav").getElementsByTagName("li");for(var i=0;i<sfEls.length;i++){sfEls[i].onmouseover=function(){show_none(false);this.className+=(this.className.length>0?" ":"")+"sfhover"};sfEls[i].onMouseDown=function(){this.className+=(this.className.length>0?" ":"")+"sfhover"};sfEls[i].onMouseUp=function(){this.className+=(this.className.length>0?" ":"")+"sfhover"};sfEls[i].onmouseout=function(){show_none(true);this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),"")}}}function $(){for(var a=1;a<Ptr.length+1;a++){Ptr[a-1].className=(a%2>0)?"t2":"t1"}}window.onload=function(){$();GetFoucs("txtSearch")};function menuonload(){menuFix()}for(var a=0;a<Ptr.length;a++){Ptr[a].onmouseover=function(){this.tmpClass=this.className;this.className="t3"};Ptr[a].onmouseout=function(){this.className=this.tmpClass}}function addBookmark(title,url){if(window.sidebar){window.sidebar.addPanel(title,url,"")}else if(document.all){window.external.AddFavorite(url,title)}else if(window.opera&&window.print){return true}}function ShowMore(obj){var id1=obj.id;var arrId=id1.split("an");var moreId="divmore"+arrId[1];var minimizeId="divminimize"+arrId[1];GetObj(moreId).style.display="none";GetObj(minimizeId).style.display="block"}function ShowMinimize(obj){var id1=obj.id;var arrId=id1.split("am");var moreId="divmore"+arrId[1];var minimizeId="divminimize"+arrId[1];GetObj(moreId).style.display="block";GetObj(minimizeId).style.display="none"}var last_id='';function ShowInfomation(obj){var objId=obj.id;if(last_id==objId){return}else{last_id=objId}var liId=objId.split('-');var dt=document.getElementsByTagName("dt");for(var i=0;i<dt.length;i++){if(dt[i].id==liId[1]){GetObj(dt[i].id).className='small_on'}else{GetObj(dt[i].id).className=''}}var num="div"+liId[0];coni="con"+liId[0];GetObj(num).style.display="block";fade('showImg',num);GetObj(coni).style.display="block";GetObj("con").style.display="none";for(var j=0;j<=9;j++){if("divli"+j==num){continue}GetObj("divli"+j).style.display="none"}GetObj("showImg").style.display="none"}var xmlHttp;function createXmlHttpReqeust(){if(window.ActiveXObject){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}else if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest()}}function SmallImgMouseOver(obj){id=obj.id;if(last_id==id){return}else{last_id=id}oldId=GetObj("hiddenHotGoods").value;if(id!=oldId){productClass(obj)}createXmlHttpReqeust();xmlHttp.open("POST","Handler.ashx?id="+id,true);xmlHttp.onreadystatechange=SelectInfomation;xmlHttp.send(null)}function SmallMouseOut(obj){var id=obj.id;GetObj("hiddenHotGoods").value=id;productClass(obj)}function SelectInfomation(){if(xmlHttp.readyState==4&&xmlHttp.status==200){var itemDesc=xmlHttp.responseText;var arr=new Array();var price=GetObj("price");var name=GetObj("name");arr=itemDesc.split("|");GetObj(coni).style.display="none";GetObj("con").style.display="block";fade("showImg","con");name.innerHTML=arr[2];var parames=arr[0]+"_"+arr[8]+"_"+arr[9]+"_"+arr[10];name.href="../SPCP-"+arr[1]+"-"+StrReplace(arr[2])+"-3-"+parames;if(arr[3].length>4){var vJpg=arr[3].substring(arr[3].length-4);if(vJpg==".jpg"||vJpg==".gif"){GetObj("img").src=arr[3]}else{GetObj("img").src=arr[3]+"_150X150.jpg"}}else{GetObj("img").src=arr[3]}price.innerHTML=arr[4];price.href="../SPCP-"+arr[1]+"-"+StrReplace(arr[2])+"-3-"+parames;GetObj("desc").innerHTML=arr[5];GetObj("kind").innerHTML=arr[6];GetObj("number").innerHTML=arr[7];GetObj("btn").onclick=function(){location.href="../SPCP-"+arr[1]+"-"+StrReplace(arr[2])+"-3-"+parames}}}function GetDataTable(url){location.href=url}function GetPrice(minObj,maxObj){var minPrice=GetObj(minObj).value;var maxPrice=GetObj(maxObj).value;if(minPrice==null||minPrice==""){minPrice="1"}if(maxPrice==null||maxPrice==""){maxPrice="100000000"}if((minPrice!=null||minPrice!="")&&(maxPrice!=null||maxPrice!="")){if(minPrice.indexOf("-")!=-1){minPrice=minPrice.replace("-","")}if(maxPrice.indexOf("-")!=-1){maxPrice=maxPrice.replace("-","")}if(isNaN(minPrice)){minPrice=1}if(isNaN(maxPrice)){maxPrice=100000000}if(!isNaN(maxPrice)&&!isNaN(maxPrice)){minPrice=Math.round(minPrice);maxPrice=Math.round(maxPrice);if(minPrice>maxPrice){var price=minPrice;minPrice=maxPrice;maxPrice=price;SendPriceRequest(minPrice,maxPrice)}else if(minPrice==maxPrice){minPrice=1;maxPrice=100000000;SendPriceRequest(minPrice,maxPrice)}else{SendPriceRequest(minPrice,maxPrice)}}}}function SendPriceRequest(minPrice,maxPrice){var paraemterValue=location.href;var parame='';var index=paraemterValue.indexOf("-price_");if(index>-1){var str2='';var str1=paraemterValue.substr(0,index);var idx=index+7;var strReault=paraemterValue.substr(idx,paraemterValue.Length-idx);var dx=strReault.indexOf("_");if(dx>-1){str2=strReault.substr(dx,strReault.Length-dx)}parame=str1+str2}else{parame=paraemterValue}var countPrice="-price_"+minPrice+"~"+maxPrice;location.href=parame+countPrice}function Rearch(kw,msg){var keyword=searchTextValueIsNullOrEmpty(GetObj(kw));if(keyword!=""){var keystring=new Array('%','&','.','*','?','|','//','\\','_','-','#','/','\"',':','<','>','+');var string='';for(var j=0;j<keystring.length;j++){if(keyword.indexOf(keystring[j])!=-1){string+=keystring[j]}}if(string.length>0){for(var k=0;k<string.length;k++){keyword=DisPoseUrl(keyword,string.charAt(k))}}location.href="../SCH-"+keyword}else{return}}function DisPoseUrl(keyword,key){switch(key){case"&":keyword=keyword.replace(/&/g,'[100]');break;case"%":keyword=keyword.replace(/%/g,'[101]');break;case".":keyword=keyword.replace(/\./g,'[102]');break;case"*":keyword=keyword.replace(/\*/g,'[103]');break;case"?":keyword=keyword.replace(/\?/g,'[104]');break;case"|":keyword=keyword.replace(/\|/g,'[105]');break;case"/":keyword=keyword.replace(/\//g,'[106]');break;case"\\":keyword=keyword.replace(/\\/g,'[107]');break;case"_":keyword=keyword.replace(/_/g,'[108]');break;case"-":keyword=keyword.replace(/-/g,'[109]');break;case"#":keyword=keyword.replace(/#/g,'[110]');break;case"\"":keyword=keyword.replace(/\"/g,'[111]');break;case":":keyword=keyword.replace(/\:/g,'[112]');break;case"<":keyword=keyword.replace(/</g,'[113]');break;case">":keyword=keyword.replace(/>/g,'[114]');break;case"+":keyword=keyword.replace(/\+/g,'[115]');break}return keyword}function chanageStyle(obj){if(obj.id==""){obj.id="cho";document.cookie="state="+obj}else{obj.id=""}}function ShowLocation(){var stateVal=getCook("state");if(stateVal!=null&&　stateVal!='undefined'){stateVal.id="cho"}}function ifCheck(){var itemId=document.getElementsByName("itemId");var kindId=GetObj("kid").value;var n=itemId.length;var val="";for(var i=0;i<n;i++){if(itemId[i].checked){var str=itemId[i].value;val+=str+"~"}}if(val!=null&&val!=""){window.location.href='../property-'+kindId+"-"+unescape(val)}else{return false}}function ShowItem(){var kindid=GetObj("kindId").value;switch(kindid){case"1":GetObj("clothdiv").style.display="block";GetObj("name").innerHTML="Clothing and Accessories";break;case"2":GetObj("shoesdiv").style.display="block";GetObj("name").innerHTML="Shoes";break;case"3":GetObj("computerdiv").style.display="block";GetObj("name").innerHTML="Computers and Software";break;case"4":GetObj("electronicsdiv").style.display="block";GetObj("name").innerHTML="Electronics";break;case"5":GetObj("giftdiv").style.display="block";GetObj("name").innerHTML="Gift Card";break;case"6":GetObj("homegardendiv").style.display="block";GetObj("name").innerHTML="Home and Garden";break;case"7":GetObj("healthdiv").style.display="block";GetObj("name").innerHTML="Health and Beauty";break;case"8":GetObj("kidsdiv").style.display="block";GetObj("name").innerHTML="Kids and Family";break}}var taxis;function selectPriceTaxis(obj){taxis=obj.id;var htmlVal=document.getElementById(taxis).innerHTML;htmlVal=htmlVal.replace("\n","");document.cookie="value="+htmlVal;document.getElementById("fnt").innerHTML=htmlVal;document.getElementById("box").style.display="none";document.getElementById("box").style.display="none";var parame='';var p=location.href;var index=p.indexOf("-sort_");if(index>-1){var idx=index+6;var str1=p.substr(idx,p.length-idx);str1=str1.replace(str1.substr(0,1),taxis);str2=p.substr(0,idx);parame=str2+str1}else{parame=p+"-sort_"+taxis}location.href=parame}function getCook(objName){var arr=document.cookie.split(';');for(var i=0;i<arr.length;i++){var temp=arr[i].split('=');if(temp[0].trim()==objName.trim()){return temp[1]}}}function getValue(fntObj){var val=getCook("value");if(val!=null&&val!=undefined){document.getElementById(fntObj).innerHTML=val}}var size;function SelectPageSize(obj){var parame='';size=obj.id;var htmlVal=document.getElementById(size).innerHTML;htmlVal=htmlVal.replace("\n","");document.cookie="pagevalue="+htmlVal;document.getElementById("page").innerHTML=htmlVal;document.getElementById("box").style.display="none";document.getElementById("box").style.display="none";var paraemeter=location.href;var index=paraemeter.indexOf("-psize_");if(index>-1){var str2='';var str1=paraemeter.substr(0,index);var idx=index+7;var strReault=paraemeter.substr(idx,paraemeter.length-idx);var dx=strReault.indexOf("-");if(dx>-1){str2=strReault.substr(dx,strReault.length-dx)}parame=str1+str2}else{parame=paraemeter}if(parame.indexOf("-pindex_1")==-1){location.href=parame+"-psize_"+size+"-pindex_1"}else{location.href=parame+"-psize_"+size}}function FnGetCookie(objName){var arr=document.cookie.split(';');for(var i=0;i<arr.length;i++){var temp=arr[i].split('=');if(temp[0].trim()==objName.trim()){return temp[1]}}}function getPageValue(fntObj){var val=FnGetCookie("pagevalue");if(val!=null&&val!=undefined){document.getElementById(fntObj).innerHTML=val}}var single;function SingleSort(){var param=GetObj("parameval").value;var kindid=GetObj("kindid").value;var name=GetObj("itemname").value;var selectPrice=GetObj("selectPrice");if(name!=null){if(param!=""&&kindid!=""){SortSelect(selectPrice);location.href="../SPCP-"+kindid+"-"+name+"-"+single+"-"+param}}}function SortSelect(selectPrice){for(var i=0;i<selectPrice.options.length;i++){if(selectPrice.options[i].selected==true){single=selectPrice.options[i].value}}}function IsShowDesc(){GetObj("selectPrice").style.display="none";GetObj("desc").style.display="none";GetObj("spSortby").innerHTML="<h4>Stores and Prices</h4> "}function FindRearch(){var parame='';var findvalue=escape(StrReplace(GetObj("txtfind").value));var paraemeter=location.href;var indexPg=paraemeter.indexOf("-kw=");if(indexPg>-1){var str2='';var str1=paraemeter.substr(0,indexPg);var idx=indexPg+4;var strReault=parame.substr(idx,paraemeter.length-idx);var dx=strReault.indexOf("-");if(dx>-1){str2=strReault.substr(dx,strReault.length-dx)}parame=str1+str2}else{parame=paraemeter}var index=parame.indexOf("-pindex_");if(index>-1){var str2='';var str1=paraemeter.substr(0,index);var idx=index+8;var strReault=paraemeter.substr(idx,paraemeter.length-idx);var dx=strReault.indexOf("-");if(dx>-1){str2=strReault.substr(dx,strReault.length-dx)}parame=str1+str2}location.href=parame+"-kw="+findvalue}function searchTextValueIsNullOrEmpty(txtObj){keyvalue=trim(txtObj.value);if(keyvalue.length<=-1)　　{SetAlertInfo(txtObj,"Please enter Keyword!");return"";　　}　　else　　{　　if(keyvalue.length>80){keyvalue=keyvalue.substr(0,80);var endKey=keyvalue.substr(77,3);SetAlertInfo(txtObj,"no more than 80 characters,all the words after '"+endKey+"' will be ignored.")}else{SetAlertInfo(txtObj,"")}return keyvalue;　　}}function SetAlertInfo(txtObj,msg){if(txtObj.id=="txtfootSearch"){GetObj("validate").innerHTML=msg}else if(txtObj.id=="txtSearch"){GetObj("tt").innerHTML=msg}}function OnBlurResult(){if(xmlHttp.readyState==4&&xmlHttp.status==200){var msg=xmlHttp.responseText;if(msg.length>0){userPassword=msg}}}function getCursorPosition(eventObj,txtObj){var msg="Can not enter illegal characters";var keywords=txtObj.value;var flag=searchTextValueIsNullOrEmpty(txtObj,msg);if(flag==""){return}　　if(eventObj.keyCode==13){　eventObj=eventObj?eventObj:(window.event?window.event:null);if(txtObj.id=="minPrice"){GetPrice(txtObj.id,GetObj("maxPrice").id)}else if(txtObj.id=="sign"){LoginMsg()}else if(txtObj.id=="maxPrice"){GetPrice(GetObj("minPrice").id,txtObj.id)}else if(txtObj.id=="txtfind"){FindRearch()}else if(txtObj.id=="iptPwd"){if(txtObj.value.length==userPassword.length){SignIn();userPassword=""}else{document.getElementById("spMsg").innerHTML="You have entered an invalid username/password. Please try again."}}else{Rearch(txtObj.id,"tt")}}}function ltrim(s){return s.replace(/^[" "|"　"]*/,"")}function rtrim(s){return s.replace(/[" "|"　"]*$/,"")}function trim(s){return rtrim(ltrim(s))}function StrReplace(str){if(str!=undefined&&str!=null){var num=str.length;var array=["#","*","%","<",">","?","&","$",".",":","|","\\","\"","/","_","-","+"," ","'"];for(var i=0;i<=num;i++){for(var j=0;j<array.length;j++){var s=array[j];str=str.replace(s,"_")}}return str}}function GetFoucs(txtobj){GetObj(txtobj).focus();document.getElementById("spMsg").innerHTML=""}function showbox(divname,num){var a=document.getElementsByName(divname);for(var i=0;i<a.length;i++){if(i==num){a[i].style.display='block'}else{a[i].style.display='none'}}}function SeeAll(obj){var a_id=obj.id;var arr_id=a_id.split('_');var sp_id="sp_"+arr_id[1];document.getElementById(a_id).style.display="none";document.getElementById(sp_id).style.display="block"}function Minimize(obj){var id=obj.id;var arr_id=id.split('_');var sp_id="sp_"+arr_id[1];var a_id="a_"+arr_id[1];document.getElementById(a_id).style.display="block";document.getElementById(sp_id).style.display="none"}function ClearValue(){document.getElementById("iptEmail").value="";document.getElementById("iptName").value="";document.getElementById("iptPassword").value="";document.getElementById("iptComparePwd").value="";document.getElementById("iptValid").value="";document.getElementById("spName").innerHTML="";document.getElementById("spPwd").innerHTML="";document.getElementById("spComparePwd").innerHTML="";document.getElementById("spValid").innerHTML="";document.getElementById("varimg").src=document.getElementById("varimg").src+"?";document.getElementById("spEmail").innerHTML="Please input the correct E-mail,in order to find the password."}var Speed=40;var Space=5;var PageWidth=120;var fill=0;var MoveLock=false;var MoveTimeObj;var Comp=0;var AutoPlayObj=null;function AutoPlay(){clearInterval(AutoPlayObj);AutoPlayObj=setInterval('ISL_GoDown();ISL_StopDown();',8000)}function ISL_GoUp(){if(MoveLock){return}clearInterval(AutoPlayObj);MoveLock=true;MoveTimeObj=setInterval('ISL_ScrUp();',Speed)}function ISL_StopUp(){clearInterval(MoveTimeObj);if(GetObj('ISL_Cont').scrollLeft%PageWidth-fill!=0){Comp=fill-(GetObj('ISL_Cont').scrollLeft%PageWidth);CompScr()}else{MoveLock=false}AutoPlay()}function ISL_ScrUp(){if(GetObj('ISL_Cont').scrollLeft<=0){GetObj('ISL_Cont').scrollLeft=GetObj('ISL_Cont').scrollLeft+GetObj('List1').offsetWidth}GetObj('ISL_Cont').scrollLeft-=Space}function ISL_GoDown(){clearInterval(MoveTimeObj);if(MoveLock){return}clearInterval(AutoPlayObj);MoveLock=true;ISL_ScrDown();MoveTimeObj=setInterval('ISL_ScrDown()',Speed)}function ISL_StopDown(){clearInterval(MoveTimeObj);if(GetObj('ISL_Cont').scrollLeft%PageWidth-fill!=0){Comp=PageWidth-GetObj('ISL_Cont').scrollLeft%PageWidth+fill;CompScr()}else{MoveLock=false}AutoPlay()}function ISL_ScrDown(){if(GetObj('ISL_Cont').scrollLeft>=GetObj('List1').scrollWidth){GetObj('ISL_Cont').scrollLeft=GetObj('ISL_Cont').scrollLeft-GetObj('List1').scrollWidth}else{GetObj('ISL_Cont').scrollLeft+=Space}}function CompScr(){var num;if(Comp==0){MoveLock=false;return}if(Comp<0){if(Comp<-Space){Comp+=Space;num=Space}else{num=-Comp;Comp=0}GetObj('ISL_Cont').scrollLeft-=num;setTimeout('CompScr()',Speed)}else{if(Comp>Space){Comp-=Space;num=Space}else{num=Comp;Comp=0}GetObj('ISL_Cont').scrollLeft+=num;setTimeout('CompScr()',Speed)}}var timer=null;var ele_a=null;var ele_b=null;function fade(a,b){ele_a=document.getElementById(a);ele_b=document.getElementById(b);if(!ele_a||!ele_b){return}if(document.all){ele_a.className="showDiv";ele_b.className="con_contain";ele_a.filters.alpha.opacity=100;ele_b.filters.alpha.opacity=0}else{ele_a.style.opacity=1;ele_b.style.opacity=0}ele_a.style.zIndex=1;ele_b.style.zIndex=0;fade_opacity()}function fade_opacity(){var ifstop=false;if(document.all){if(ele_a.filters.alpha.opacity>0){ele_a.filters.alpha.opacity-=10}else if(ele_b.filters.alpha.opacity<100){ele_b.filters.alpha.opacity+=10}else{ifstop=true}}else{if(ele_a.style.opacity>0){ele_a.style.opacity-=0.1}else if(ele_b.style.opacity<1){ele_b.style.opacity=parseFloat(ele_b.style.opacity)+0.1}else{ifstop=true}}if(ifstop==true){window.clearTimeout(timer);ele_b.style.zIndex=parseInt(ele_a.style.zIndex)+1}else{timer=window.setTimeout('fade_opacity()',50)}}