var i=0;var inputId="";var hiddId="";var lastValue="";var nowInnerHTML="";var nowData="";function removeSpecialWord(txtId){var value=document.getElementById(txtId).value;if(value==null){return}var specialsEn="~0`0!0@0#0$0%0^0&0(0)0;0:0'0\"0<0,0>0.0?0/0|0\\0_0-0+0=0{0}0[0]0*";var specialsCh="·0~0！0@0#0￥0%0……0&0（0：0；0‘0“0《0，0.0》0?0/0|0\\0_0-0+0=0*";var specialsEnWhole="～0｀0！0＠0＃0￥0％0……0＆0×0（0）0｛0｝0［0］0；0：0＇0＂0，0＜0．0＞0／0？0｜0＼0－0＿0＋0＝";var specialsChWhole="·0～0！0＠0＃0￥0％0……0＆0×0（0）0——0＋0－0＝0｛0｝0【0】0｜0＼0：0；0’0”0《0，0》0。0、0？";var ss=specialsEn+"0"+specialsCh+"0"+specialsEnWhole+"0"+specialsChWhole;var s1=ss.split("0");var t=0;for(var k=0;k<s1.length-1;k++){for(var j=k+1;j<s1.length;j++){if(s1[j]==s1[k]){s1.splice(j,1)}}}for(var k=0;k<s1.length;k++){var str="\\"+s1[k];eval("var s = /"+str+"/g;");value=value.replace(s,"")}value=value.replace(/\s/g," ").replace(/[\s\u3000]/g," ");var len=value.length;for(var k=0;k<len;k++){value=value.replace(/(^\s*)|(\s*$)/g,"").replace(/(^[\s\u3000]*)|([\s\u3000]*$)/g,"")}return value}function getLis(){var c="l1";var g=new Array();var h="";var b=document.getElementsByName("l1");var f=document.getElementsByTagName("li");var d=0;if(b.length>0){g=b}else{for(var a=0;a<f.length;a++){if(f[a].id.substring(0,f[a].id.length)=="hotWordLi"+(d+1)){g[d]=f[a];d++}}}return g}function setAHover(d){var b=new Array();if(d=="headKey"){b[0]=document.getElementById("hotWordA1");b[1]=document.getElementById("hotWordA2");for(var c=0;c<b.length;c++){if(b[c].innerHTML=="积分活动"){b[c].innerHTML="";b[c].id="hotWordA1"}if(b[c].innerHTML=="快速订单"){b[c].innerHTML="";b[c].id="hotWordA2"}}}}function reSetAHover(d){if(d=="headKey"){var b=document.getElementsByTagName("a");for(var c=0;c<b.length;c++){if(b[c].id=="hotWordA1"){b[c].innerHTML="积分活动"}if(b[c].id=="hotWordA2"){b[c].innerHTML="快速订单"}}}}function writeToHTML(){var d=getData();var b=document.createElement("ul");b.setAttribute("id","hotWordUl");b.setAttribute("style","width:140px");document.getElementById(hiddId).appendChild(b);var a="";if(d!=null){for(var c=0;c<d.length;c++){var e=d[c];a+="<li id='hotWordLi"+(c+1)+"' style='width:"+(document.getElementById(inputId).offsetWidth-2)+"px; height:20px;' name='l1' onmouseover=getColor(this,'"+inputId+"') onmousedown=getValue(this,'"+inputId+"','"+hiddId+"',event) value='"+e+"' onmouseout=loseColor('"+inputId+"','"+hiddId+"')>"+e+"</li>"}nowInnerHTML=a}else{return}if(a!=""&&document.getElementById("hotWordUl")){document.getElementById("hotWordUl").innerHTML=a}}function getData(){return nowData}function getHotWordList(a,c){clearInterval("getHotWordList");inputId=a;hiddId=c;var b=removeSpecialWord(a);i=0;if(b!=""&&b!=null){try{merchandiseKeyWordService.doGetSearchKeyWords(b,showHotWordList)}catch(d){}}}function showHotWordList(b){nowData=b;writeToHTML();if(navigator.userAgent.indexOf("MSIE")>=0){hidden(hiddId);writeToHTML();var a=getLis();show(inputId,hiddId,a)}else{var a=getLis();nowInnerHTML=nowInnerHTML.replace(/\s/g," ").replace(/[\s\u3000]/g," ");if(nowInnerHTML!=null&&nowInnerHTML!=""){nowInnerHTML="";show(inputId,hiddId,a)}else{hidden(hiddId);return}}}function hidden(a){if(document.getElementById(a)){document.getElementById(a).style.display="none"}reSetAHover(inputId);if(document.getElementById("ifHidden3")){document.getElementById("ifHidden3").style.display="none"}if(document.getElementById(a)){document.getElementById(a).innerHTML=""}lastValue="";nowInnerHTML="";i=0}function getValue(f,c,e,a){setAHover(c);var b=getLis();if(b.length>0){document.getElementById(c).onblur="";if(b[0].style.backgroundColor=="#00f"||b[0].style.backgroundColor=="rgb(0, 0, 255)"){document.getElementById(c).value=b[0].innerHTML.replace(/(\s\u3000*$)/g,"")}}document.getElementById(e).style.display="block";var d=f.innerHTML.replace(/(\s\u3000*$)/g,"");document.getElementById(c).value=d;if(e=="hidden"&&document.getElementById("hidden").style.display=="block"){findResultHead()}else{if(e=="hidden2"&&document.getElementById("hidden2").style.display=="block"){findResult()}else{if(e=="hidden8"&&document.getElementById("hidden8").style.display=="block"){doClick("keyWordBtn08")}else{if(e=="hidden5"&&document.getElementById("hidden5").style.display=="block"){classKeySubmit()}else{if(e=="hidden6"&&document.getElementById("hidden6").style.display=="block"){doClick("hotWordBtn3")}else{if(e=="hidden9"&&document.getElementById("hidden9").style.display=="block"){doClick("selectResult")}else{if(e=="hidden7"&&document.getElementById("hidden7").style.display=="block"){doClick("keySearch02")}else{if(e=="hidden3"&&document.getElementById("hidden3").style.display=="block"){doClick("howWordBtn1")}}}}}}}}hidden(e)}function getValueByEnter(c,d,b){document.getElementById(c).onblur="";document.getElementById(c).onkeydown="";for(var a=0;a<b.length;a++){if(b[a].style.backgroundColor=="#00f"||b[a].style.backgroundColor=="rgb(0, 0, 255)"){document.getElementById(c).value=b[a].innerHTML.replace(/(\s\u3000*$)/g,"");hidden(d);break}}document.getElementById(c).onblur=function(){var e=document.getElementById(d);e.style.display="none";i=0;document.getElementById(d).innerHTML=""}}function setProperty(c,d,a){var e=window.location.pathname;var f=navigator.userAgent;if(d=="hidden2"){if(document.getElementById("hidden2")){document.getElementById("hidden2").style.zIndex="0"}}if(d=="hidden7"){if(document.getElementById("scriptErrorMessages")&&document.getElementById("scriptErrorMessages").style.display=="block"){if(document.all){if(navigator.userAgent.indexOf("MSIE 6.0")>=0){document.getElementById(d).style.top="260px"}else{document.getElementById(d).style.top="250px"}}else{document.getElementById(d).style.top="249px"}}if(document.getElementById("errorMessages")){if(document.all){if(navigator.userAgent.indexOf("MSIE 6.0")>=0){document.getElementById(d).style.top="260px"}else{document.getElementById(d).style.top="250px"}}else{document.getElementById(d).style.top="249px"}}}if(d=="hidden5"&&(e=="/blueboy/category/office-furnitures-storage/index.html"||e=="/category/office-furnitures-storage/index.html")){if(f.indexOf("MSIE")>=0){document.getElementById(d).style.top="282px"}else{if(f.indexOf("Firefox")>=0){document.getElementById(d).style.top="299px"}}}if(c=="headKey"){for(var b=0;b<a.length;b++){a[b].style.width=document.getElementById(c).offsetWidth+3+"px";a[b].style.fontColor="black"}}if(d=="hidden9"){if(document.getElementById("scriptErrorMessages").style.display=="block"){if(document.all){if(navigator.userAgent.indexOf("MSIE 6.0")>=0){document.getElementById(d).style.top="254px"}else{document.getElementById(d).style.top="244px"}}else{document.getElementById(d).style.top="261px"}}if(document.getElementById("errorMessages")){if(document.all){if(navigator.userAgent.indexOf("MSIE 6.0")>=0){document.getElementById(d).style.top="254px"}else{document.getElementById(d).style.top="244px"}}else{document.getElementById(d).style.top="261px"}}}if(d=="hidden3"){if(document.getElementById("scriptErrorMessages").style.display=="block"){if(document.all){if(navigator.userAgent.indexOf("MSIE 6.0")>=0){document.getElementById("ifHidden3").style.top="335px";document.getElementById(d).style.top="335px"}else{document.getElementById("ifHidden3").style.top="325px";document.getElementById(d).style.top="325px"}}else{document.getElementById(d).style.top="328px"}}}if(d=="hidden8"){if(document.getElementById("scriptErrorMessages").style.display=="block"){if(document.all){if(navigator.userAgent.indexOf("MSIE 6.0")>=0){document.getElementById(d).style.top="456px"}else{document.getElementById(d).style.top="444px"}}else{document.getElementById(d).style.top="480px"}}}if(d=="hidden6"){if(document.getElementById("scriptErrorMessages").style.display=="block"){if(document.all){if(navigator.userAgent.indexOf("MSIE 6.0")>=0){document.getElementById(d).style.top="323px"}else{document.getElementById(d).style.top="314px"}}else{document.getElementById(d).style.top="324px"}}}if(d=="hidden5"){if(document.getElementById("scriptErrorMessages").style.display=="block"){if(document.all){if(navigator.userAgent.indexOf("MSIE 6.0")>=0){if(e=="/blueboy/category/office-furnitures-storage/index.html"||e=="/category/office-furnitures-storage/index.html"){document.getElementById(d).style.top="350px"}else{document.getElementById(d).style.top="350px"}}else{if(e=="/blueboy/category/office-furnitures-storage/index.html"||e=="/category/office-furnitures-storage/index.html"){document.getElementById(d).style.top="339px"}else{document.getElementById(d).style.top="339px"}}}else{if(e=="/blueboy/category/office-furnitures-storage/index.html"||e=="/category/office-furnitures-storage/index.html"){document.getElementById(d).style.top="369px"}else{document.getElementById(d).style.top="369px"}}}}}function hiddenForIE(a,b){setTimeout(function(){getHotWordList(a,b)},1000)}function show(f,h,c){if(c.length==0){hidden(h);return}var g=removeSpecialWord(f);if(g==""&&g==null){return}for(var b=0;b<c.length;b++){c[b].style.color="black";c[b].style.backgroundColor="#FFF"}i=0;setProperty(f,h,c);var e=document.getElementById(h);if(document.getElementById("hotWordUl").innerHTML==""){hidden(h)}else{setAHover(f);if(navigator.userAgent.indexOf("MSIE 6.0")>=0){if(h=="hidden3"){document.getElementById("ifHidden3").style.display="block";var d=20*c.length;document.getElementById("ifHidden3").style.height=d+"px"}}var a=20*c.length;document.getElementById(h).heigth=a+"px";e.style.display="block"}}function doClick(b){if(navigator.userAgent.indexOf("MSIE")>=0){document.getElementById(b).click()}else{var a=document.createEvent("MouseEvent");a.initEvent("click",true,true);document.getElementById(b).dispatchEvent(a)}}function getSelect(c,f,g){var d=getLis();if(d.length>0){if(c.keyCode==40&&i<=d.length){if(document.getElementById(g).style.display=="block"){setAHover(f);for(var b=0;b<i;b++){d[b].style.backgroundColor="#FFF";d[b].style.color="black"}if(i<d.length){i++}else{i=1}document.getElementById(f).value=d[i-1].innerHTML.replace(/(\s\u3000*$)/g,"");d[i-1].style.color="white";d[i-1].style.backgroundColor="#00F"}}}if(c.keyCode==38&&i>0&&i<=d.length){if(document.getElementById(g).style.display=="block"){setAHover(f);if(i==1){if(d.length==1){document.getElementById(f).value=d[0].innerHTML.replace(/(\s\u3000*$)/g,"");d[0].style.color="white";d[0].style.backgroundColor="#00F";i=1;return}for(var b=0;b<i+1;b++){d[b].style.color="black";d[b].style.backgroundColor="#FFF"}i=d.length+1}for(var b=i-1;b<d.length;b++){d[b].style.color="black";d[b].style.backgroundColor="#FFF"}if(i>1){i--}document.getElementById(f).value=d[i-1].innerHTML.replace(/(\s\u3000*$)/g,"");d[i-1].style.color="white";d[i-1].style.backgroundColor="#00F"}}if(c.keyCode==13&&i<=d.length){for(var b=0;b<d.length;b++){if(document.getElementById(g).style.display=="block"&&(d[b].style.backgroundColor=="#00F"||d[b].style.backgroundColor=="rgb(0, 0, 255)")){getValueByEnter(f,g,d);break}}var e=0;for(var b=0;b<d.length;b++){if(d[b].style.backgroundColor=="#FFF"||d[b].style.backgroundColor=="rgb(255, 255, 255)"){e+=1}}if(e<d.length){getValueByEnter(f,g,d)}if(g=="hidden"){enterSubmitForPageHeadKeyWord(c)}else{if(g=="hidden2"){}else{if(g=="hidden8"){enterSubmitForEnvironment()}else{if(g=="hidden5"){enterSubmitClass(c)}else{if(g=="hidden6"){doClick("hotWordBtn3")}else{if(g=="hidden9"){doClick("selectResult")}else{if(g=="hidden3"){doClick("howWordBtn1")}}}}}}}}if(c.keyCode!=40&&c.keyCode!=38&&c.keyCode!=13&&c.keyCode!=37&&c.keyCode!=39){var a=removeSpecialWord(f);if(a==""||a==null){hidden(g);return}hiddenForIE(f,g)}}function getColor(d,c){setAHover(c);var a=getLis();for(var b=0;b<a.length;b++){if(a[b].id!=d.id){a[b].style.color="black";a[b].style.backgroundColor="#FFF"}else{a[b].style.color="white";a[b].style.backgroundColor="#00F"}}for(var b=0;b<a.length;b++){if(d.id==a[b].id){i=b+1}}}function loseColor(a,b){setAHover(a)};
