function setFixWrapper(){if(document.getElementById("h").clientHeight>30&&(navigator.appName=="Microsoft Internet Explorer")&&(parseInt(navigator.appVersion)<7)){setWrapper();window.attachEvent("onresize",setWrapper)}if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1||navigator.userAgent.toLowerCase().indexOf("safari")>-1){setWrapper();window.addEventListener("resize",setWrapper,false)}}function setWrapper($){var A=document.getElementById("w"),_=document.getElementById("f"),B=document.getElementById("h");B.style.height=document.body.clientHeight+"px";A.style.width=(document.body.clientWidth>1000?"960px":"96%");A.style.height=(document.body.clientHeight>638?"510px":document.body.clientHeight<425?"340px":(document.body.clientHeight*0.8)+"px");_.style.height=A.style.height}function stopPropagation($){$=$.browserEvent||$;if($.stopPropagation)$.stopPropagation();else $.cancelBubble=true}function addEvent($,_,A,B){if($.addEventListener)$.addEventListener(_,A,B);else if($.attachEvent){$["e"+_+A]=A;$[_+A]=function(){return $["e"+_+A](window.event)};$.attachEvent("on"+_,$[_+A])}}function jsLazyLoad(A,_){var $=document.createElement("script");if(typeof(_)!="undefined"){$.onload=function(){if($.called)return;$.called=true;_()};$.onreadystatechange=function(){if($.called)return;if("loaded"==$.readyState||"complete"==$.readyState){$.called=true;_()}}}$.src=A+(A.indexOf("?")!=-1?"&":"?")+"_="+YD.version;document.getElementsByTagName("head")[0].appendChild($)}function initMenus(){setMenu("mn","nm",0,0);setMenu("mt","ym",0,0)}function initSuggest(_){if(!youdaos)return;youdaos.Autocomplete.prototype.showContent=function(){var _=document.getElementById("qc"),$=youdaos.dimension.cumOffset(_);this.sdiv.className="sw";this.sdiv.style.top=$[1]+_.offsetHeight+"px";this.sdiv.style.left=$[0]+"px";this.sdiv.style.cursor="default";this.sdiv.style.width=_.offsetWidth-2+"px";youdaos.dom.show(this.sdiv);this.vis=true;this.curNodeIdx=-1};aa=new youdaos.Autocomplete("query","aa","http://www.youdao.com/suggest2");aa.setLogServer("http://www.youdao.com/");aa.setSearchServer("http://www.youdao.com/search?");aa.setKeyFrom("web.index");aa.setSearchMoreParams(_);var $=document.getElementById("aca");youdaos.events.listen($,"click",youdaos.bind(aa.pressPoint,aa));youdaos.events.listen($,"mouseover",youdaos.bind(aa.removeBoxBlur,aa));youdaos.events.listen($,"mouseout",youdaos.bind(aa.revertBoxBlur,aa))}function seturl(C,$,B,A){C.href="http://"+$+".youdao.com/";if(!A)A="search?q=";if(window.RegExp&&window.encodeURIComponent){var _=document.getElementById("query").value;if(_!=""){_=_.replace(/(^link:)|(^inlink:)|(^related:)/,"");C.href=C.href+A+encodeURIComponent(_)+"&keyfrom="+B}}return 1}function setMenu(A,F,C,D){var B=document.getElementById(A),E=document.getElementById(F);B.href="javascript:void(0)";addEvent(document,"click",$);addEvent(B,"click",_);function _($){if(E.style.display=="block")E.style.display="none";else{var A=B.offsetLeft+C,_=B.offsetTop+B.offsetHeight+D;E.style.ZIndex="1000";E.style.left=A+"px";E.style.top=_+"px";E.style.display="block"}stopPropagation($)}function $($){E.style.display="none"}}var hasPGScript=false;function skinChgPGMonitor(){var $=document.getElementById("query").value;if($&&$.indexOf("youdao")>=0&&!hasPGScript){jsLazyLoad("/zisuoimages/skinChgPG.js");hasPGScript=true}}var senders=[],senderIndex=0;function sendRequest(A){var _=Math.random(),$=new Image();$.src=A+"&_="+_;if(senderIndex>=50)senderIndex=0;senders[senderIndex++]=$}function requestLog(_,$){var A="/requestlog?type="+_+"&"+$;sendRequest(A)}function recordSearchTime(){var $=new Date().getTime();document.cookie="sbt="+$+";path=/;domain="+document.domain;return true}function showYayunCountDown(){jsLazyLoad("/zisuoimages/yayunCountDown.1.7.1.js")}function bgLoginLazyLoad(){var $=document.createElement("iframe");$.src="";$.style.display="none";document.body.appendChild($)}(function(){if(document.addEventListener)document.addEventListener("DOMContentLoaded",fireDOMContentLoaded,false);else var $=setInterval(function(){try{document.body.doScroll("left");fireDOMContentLoaded();window.clearInterval($)}catch(_){}});addEvent(window,"load",fireLoaded)})()
