var getbody="getBody";var borderColor="#009C7B";var acTimer;var searchKey=0;var searchKeyCount=0;function searchBar(w){w=w||"358";var a="";if(w=="358"){a="float:left;"}var k=w-120;str="<div id='searchBar' style='"+a+"width:"+w+"px'><div class='ico'>Õ¾ÄÚËÑË÷</div><div class='key' style='width:"+k+"px'><input type='text' id='searchKey' style='width:"+(k-5)+"px' /></div><div class='button'><img src='/style/space.gif' alt='' onclick='searchGo()' /></div></div>";document.write(str);document.body.onclick=bodyClick;$("searchKey").onkeyup=searchACKeyUp;$("searchKey").onclick=searchACKeyUp;$("searchAC").onkeyup=searchACKeyUp;if($("searchKey").value.trim()!=""){$("searchKey").setAttribute("class","searchBG1");$("searchKey").setAttribute("className","searchBG1")}}function searchACKeyUp(e){if(e==null)e=window.event;var a=e.keyCode;if(a==38||a==40){if(a==38){if(searchKey==0)searchKey=searchKeyCount;else searchKey--}else{if(searchKey==searchKeyCount)searchKey=0;else searchKey++}if(searchKey==0){$("searchKey").focus()}for(var i=1;i<searchKeyCount+1;i++){if(i==searchKey){$("searchKey"+i).className="searchOver";$("searchKey"+i).setAttribute("class","searchOver")}else{$("searchKey"+i).className="searchOut";$("searchKey"+i).setAttribute("class","searchOut")}}}else if(a==13){if(searchKey==0){searchGo()}else{execSearch($("searchResult"+searchKey).innerHTML)}}else{var b;b=isIE?e.srcElement:e.target;if(b.id="searchKey")getAC("searchKey")}}function bodyClick(a){if(a==null)a=window.event;var e;e=isIE?a.srcElement:a.target;if(e.id!="searchKey")execGetAC('searchKey','|||')}function getAC(a){clearTimeout(acTimer);var b=$(a);b.setAttribute("class","searchBG1");b.setAttribute("className","searchBG1");var c=b.value;b=null;if(c!=""){var d=getbody+"('/searchAC.asp?qu="+escape(c)+"','get',null,'if(err!=\"\"){result=\"|||\"};parent.execGetAC(\""+a+"\",result)',0,true,'http://search."+webDomain+"/proxy.html?')";acTimer=setTimeout(d,300)}else{execGetAC(a,"|||")}}function execGetAC(c,d){searchKey=0;var r=$(c);var e=0,top=0;if(isIE){var f=r.getBoundingClientRect();e=f.left-2;top=f.top+r.offsetHeight-3}else{e=r.offsetLeft;top=r.offsetTop+r.offsetHeight-2}var g=$("searchAC");var h=r.offsetWidth-6;var j=160;var k=h-j;var s=d.split("|||");var a=s[0].split("$$$");var b=s[1].split("$$$");if(s[0]!=""){g.style.cssText="width:"+h+"px;top:"+top+"px;left:"+e+"px;line-height:20px;position:absolute; z-index:1; visibility:visible;border:solid 1px "+borderColor+";background-color:#F2F5EC;padding:2px;";g.innerHTML="";searchKeyCount=a.length;for(var i=0;i<a.length;i++){g.innerHTML+="<div id='searchKey"+(i+1)+"' onclick=\"execSearch('"+a[i]+"')\" onmouseout='this.setAttribute(\"class\",\"searchOut\");this.className=\"searchOut\"' onmouseover='this.setAttribute(\"class\",\"searchOver\");this.className=\"searchOver\"' style='overflow:hidden;width:"+h+"px' class='search'><div id='searchResult"+(i+1)+"' style='text-align:left;width:"+j+"px;float:left'>"+a[i]+"</div><div class='a' style='text-align:right;float:left;width:"+k+"px'>"+b[i]+"</div></div>"}}else{searchKeyCount=0;g.innerHTML="";g.style.cssText="display:none"}r=null;g=null}function execSearch(k){execGetAC("searchKey","|||");$("searchKey").value=k}function searchGo(a){if(a==null){a="searchKey"};var b=$(a);var c=b.value.trim();if(c==""){b.setAttribute("class","searchBG");b.setAttribute("className","searchBG")}else{window.location="http://search."+webDomain+"/?w="+escape(c)}b=null}