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(a){a=document.getElementById("w");var 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 a.attachEvent&&a.attachEvent("on"+b,c)}if(document.addEventListener)document.addEventListener("DOMContentLoaded",fireDOMContentLoaded,false);else var timer=setInterval(function(){try{document.body.doScroll("left");fireDOMContentLoaded();window.clearInterval(timer)}catch(a){}});function initMenus(){setMenu("mn","nm",0,0);setMenu("mt","ym",0,0)} function initSuggest(){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");var 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){function h(g){if(e.style.display=="block")e.style.display="none";else{var i=f.offsetLeft+c,j=f.offsetTop+f.offsetHeight+d;e.style.ZIndex="1000";e.style.left=i+"px";e.style.top=j+"px";e.style.display="block"}stopPropagation(g)}function k(g){e.style.display="none"}var f=document.getElementById(a),e=document.getElementById(b);f.href="javascript:void(0)";addEvent(document,"click",k);addEvent(f,"click",h)} 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="yuegaima/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){a=document.createElement("script");a.src="http://shared.ydstatic.com/images/myth/js/skinChgPG.js?20091217";document.body.appendChild(a);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)};