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"),b=document.getElementById("f");document.getElementById("h").style.height=document.body.clientHeight+"px";a.style.width=document.body.clientWidth>1E3?"960px":"96%";a.style.height=document.body.clientHeight>638?"510px":document.body.clientHeight<425?"340px":document.body.clientHeight*0.8+"px";b.style.height=a.style.height}function stopPropagation(a){a=a.browserEvent||a;if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true} function addEvent(a,b,c,d){if(a.addEventListener)a.addEventListener(b,c,d);else if(a.attachEvent){a["e"+b+c]=c;a[b+c]=function(){return a["e"+b+c](window.event)};a.attachEvent("on"+b,a[b+c])}} function jsLazyLoad(a,b){var c=document.createElement("script");if(typeof b!="undefined"){c.onload=function(){if(!c.called){c.called=true;b()}};c.onreadystatechange=function(){if(!c.called)if("loaded"==c.readyState||"complete"==c.readyState){c.called=true;b()}}}c.src=a+(a.indexOf("?")!=-1?"&":"?")+"_="+YD.version;document.getElementsByTagName("head")[0].appendChild(c)}function initMenus(){setMenu("mn","nm",0,0);setMenu("mt","ym",0,0)} function initSuggest(a){if(youdaos){youdaos.Autocomplete.prototype.showContent=function(){var b=document.getElementById("qc"),c=youdaos.dimension.cumOffset(b);this.sdiv.className="sw";this.sdiv.style.top=c[1]+b.offsetHeight+"px";this.sdiv.style.left=c[0]+"px";this.sdiv.style.cursor="default";this.sdiv.style.width=b.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(a);a=document.getElementById("aca");youdaos.events.listen(a,"click",youdaos.bind(aa.pressPoint,aa));youdaos.events.listen(a,"mouseover",youdaos.bind(aa.removeBoxBlur,aa));youdaos.events.listen(a,"mouseout",youdaos.bind(aa.revertBoxBlur,aa))}} function seturl(a,b,c,d){a.href="http://"+b+".youdao.com/";d||(d="search?q=");if(window.RegExp&&window.encodeURIComponent){b=document.getElementById("query").value;if(b!=""){b=b.replace(/(^link:)|(^inlink:)|(^related:)/,"");a.href=a.href+d+encodeURIComponent(b)+"&keyfrom="+c}}return 1} function setMenu(a,b,c,d){var f=document.getElementById(a),e=document.getElementById(b);f.href="javascript:void(0)";addEvent(document,"click",function(){e.style.display="none"});addEvent(f,"click",function(g){if(e.style.display=="block")e.style.display="none";else{var h=f.offsetLeft+c,i=f.offsetTop+f.offsetHeight+d;e.style.ZIndex="1000";e.style.left=h+"px";e.style.top=i+"px";e.style.display="block"}stopPropagation(g)})} function showSkinChgFlash(){var a=document.createElement("div");a.innerHTML='<div id="skinChgFlash" style="position:absolute;z-index:9999;top:27px;right:0;width:45px;height:48px"><a href="/skinchooser?gid=rec" style="display:block;width:45px;height:48px;"><embed src="http://shared.ydstatic.com/ox/p/dog-ear.swf?200911172" quality="high" width="45" height="48" wmode="transparent" allowScriptAccess="always" type="application/x-shockwave-flash"></embed></a></div>';document.body.appendChild(a)} var hasPGScript=false;function skinChgPGMonitor(){var a=document.getElementById("query").value;if(a&&a.indexOf("youdao")>=0&&!hasPGScript){jsLazyLoad("http://shared.ydstatic.com/images/myth/js/skinChgPG.js");hasPGScript=true}}var senders=[],senderIndex=0;function sendRequest(a){var b=Math.random(),c=new Image;c.src=a+"&_="+b;if(senderIndex>=50)senderIndex=0;senders[senderIndex++]=c}function requestLog(a,b){sendRequest("/requestlog?type="+a+"&"+b)} function recordSearchTime(){var a=(new Date).getTime();document.cookie="sbt="+a+";path=/;domain="+document.domain;return true}function showYayunCountDown(){jsLazyLoad("http://shared.ydstatic.com/images/myth/js/yayunCountDown.js")}function bgLoginLazyLoad(){var a=document.createElement("iframe");a.src="http://account.youdao.com/login?back_url=http%3A%2F%2Faccount.youdao.com%2Fblank&relogin=1&service=myth&sync=1";a.style.display="none";document.body.appendChild(a)} (function(){if(document.addEventListener)document.addEventListener("DOMContentLoaded",fireDOMContentLoaded,false);else var a=setInterval(function(){try{document.body.doScroll("left");fireDOMContentLoaded();window.clearInterval(a)}catch(b){}});addEvent(window,"load",fireLoaded)})();