﻿if(document.addEventListener)document.addEventListener("DOMContentLoaded",fireDOMContentLoaded,false);else var timer=setInterval(function(){try{document.body.doScroll("left");fireDOMContentLoaded();clearInterval(timer)}catch(a){}},10);function fireDOMContentLoaded(){initSuggest();lazyLoadSkin()}var aa;
function initSuggest(){AutoComplete.prototype.showContent=function(){var b=document.getElementById("qc"),c=SP.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";SElement.show(this.sdiv);this.vis=true;this.curNodeIdx=-1};if(typeof SEvent!="undefined")if(SEvent.observe){aa=new AutoComplete("query","aa",true);aa.setSugServer("http://www.youdao.com/ac/");aa.setLogServer("http://www.youdao.com/");
aa.setSearchServer("http://www.youdao.com/search?");aa.setKeyFrom("web");aa.setSearchMoreParams(filterParams);var a=document.getElementById("aca");SEvent.observe(a,"click",aa.pressPoint.sbAEListener(aa));SEvent.observe(a,"mouseover",aa.onmouseover2.sbAEListener(aa));SEvent.observe(a,"mouseout",aa.onmouseout2.sbAEListener(aa))}};
function seturl(a,b,g,c){a.href="http://"+g+".youdao.com/";if(window.RegExp&&window.encodeURIComponent){b=document.getElementById(b).value;if(b!=""){b=b.replace(/(link:)|(inlink:)|(^related:)/,"");a.href=a.href+"search?q="+encodeURIComponent(b)+"&keyfrom="+c}}return 1};
function deleteHistory(){document.cookie="youdao_history=1;path=/search;expires="+(new Date("2066/6/6")).toGMTString();location.reload()}function ctlog(b,c,d,e){var f=new Image;f.src="ctlog?q="+c+"&url="+encodeURIComponent(b.href)+"&pos="+d+"&action="+e;return true}function ctlog(b,c,d,e,f){var g=new Image;g.src="ctlog?q="+c+"&url="+encodeURIComponent(b.href)+"&pos="+d+"&action="+e+"&srst="+f;return true}var ctImagesCache=[]; function ct(b,c,d,e,f,g,a){var h=new Image;if(typeof a=="undefined")a="";else if(a.length>0&&a[0]!="&")a="&"+a;h.src="ctlog?q="+c+"&url="+encodeURIComponent(b.href)+"&pos="+d+"&modifiers="+f+"&action="+e+"&hitSource="+g+a;ctImagesCache.push(h);return true};
(function(a){a(function(){function b(){if(f){e.removeClass("sidebarButton-over").attr("title","\u5173\u95ed\u5de6\u680f\u5bfc\u822a");if(navigator.userAgent.indexOf('MSIE 6')>-1&&navigator.userAgent.indexOf('MSIE 8')<0){c.animate({left:170})};$w.animate({paddingLeft:170},function(){$w.toggleClass(d)});f=false}else{e.removeClass("sidebarButton-over").attr("title","\u6253\u5f00\u5de6\u680f\u5bfc\u822a");if(navigator.userAgent.indexOf('MSIE 6')>-1&&navigator.userAgent.indexOf('MSIE 8')<0){c.animate({left:0})};$w.animate({paddingLeft:20},function(){$w.toggleClass(d)});f=true}document.cookie="resultSideCollapse="+f+";expires="+h.toGMTString()}a("#mt").hasMenu("#ym",".pm",0,17);a("#mn").hasMenu("#nm",".pm",0,17);a("#deleteHistory").hasMenu("#historyConfirm",".pm",0,15);a("#recommenderWidget li a,#historyWidget li a").each(function(){$this=a(this);$this.height()>$this.parent("li").height()&&$this.attr("title",$this.text())});var c=a("#s");a("#c");$body=a("body");$w=a("#w");var d="side-collapsed",f=$w.hasClass(d),e=a("#sideBarButton"),g=a('<div style="position:absolute;left:0;top:10px;width:13px;height:20px;cursor:pointer">&nbsp;</div>').css("cursor","pointer").click(b).hover(function(){e.addClass("sidebarButton-over")},function(){e.removeClass("sidebarButton-over")});e.append(g);g=new Date;var h=new Date;h.setTime(g.getTime()+31536E7)});a.fn.extend({hasMenu:function(b,c,d,f){var e=a(b),g=a(c);a("body").click(function(){g.hide()});this.click(function(){var h=a(this).offset();g.each(function(){"#"+a(this).attr("id")!=b&&a(this).hide()});a(this).blur();e.css({position:"absolute","z-index":1E3,left:h.left+d,top:h.top+f}).toggle();return false});return this}})})(jQuery);
//preview
var ydPrv={};ydPrv.util=function(){return{stopEvent:function(a){this.stopPropagation(a);this.preventDefault(a);return false},stopPropagation:function(a){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true},preventDefault:function(a){if(a.preventDefault)a.preventDefault();else a.returnValue=true}}}();
ydPrv.gvar=function(){return{nOverTimeout:150,nLeftColumnWidth:130,nDefSummaryWidth:510,nWinLeftIndent:70,nMinPrvWinWidth:400,nMaxPrvWinWidth:800,nMinPrvWinHeight:350,nMaxPrvWinHeight:650,animateTime:200}}();var g_eCurPrv=null,g_prvPrv=null,g_nOverTimer=null,g_winWidth=0,g_openTime=0,g_title=null,g_encodedQuery=null,g_pos=0,forbiddenHint="\u9884\u89c8\u5185\u5bb9\u6709\u53ef\u80fd\u4e0d\u7b26\u5408\u76f8\u5173\u6cd5\u5f8b\uff0c\u9884\u89c8\u4e0d\u80fd\u88ab\u663e\u793a\u3002",prvCache={};
(function(){jQuery(".preview").unbind().click(function(a){ydPrv.util.stopPropagation(window.event||a)}).mouseover(function(){var a=this;g_nOverTimer=setTimeout(function(){if(g_eCurPrv!=a){(g_prvPrv=g_eCurPrv)&&closePreviewWin(0);openPreviewWin(a)}},ydPrv.gvar.nOverTimeout)}).mouseout(function(){if(g_nOverTimer){clearTimeout(g_nOverTimer);g_nOverTimer=null}});jQuery("#close_prv").unbind().click(function(a){closePreviewWin(1);if(g_nOverTimer){clearTimeout(g_nOverTimer);g_nOverTimer=null}ydPrv.util.stopPropagation(window.event||
a)});jQuery(document).mousedown(function(){g_eCurPrv&&closePreviewWin(2)});jQuery("#prv-window").mousedown(function(a){ydPrv.util.stopPropagation(window.event||a)});jQuery("#find_next").unbind().click(function(a){document.getElementById("view_content").scrollTop=a})})();
function loadData(a,b,d,c,h,g,j,e){jQuery.ajax({type:"GET",url:"/preview?queryString="+a+"&encryptedTerms="+b+"&docId="+d+"&url="+c+"&sliceId="+h+"&encoding=UTF-8&isAttackSite="+e,cache:false,success:function(f){if(g_openTime>0){var i=Math.round(((new Date).getTime()-g_openTime)/1E3);ct(g_title,g_encodedQuery,g_pos,"MAG_HIT",undefined,undefined,"&opentime="+i)}if(f==null||f.length<=0){jQuery("#view_content").html("<center>\u5bf9\u4e0d\u8d77\uff0c\u672c\u7f51\u9875\u65e0\u6cd5\u8fdb\u884c\u9884\u89c8\u3002</center>");
ct(g_title,g_encodedQuery,g_pos,"OPEN_MAG",undefined,undefined,"&cerberus=0&isattack="+e)}else{f.indexOf(forbiddenHint)>=0?ct(g_title,g_encodedQuery,g_pos,"OPEN_MAG",undefined,undefined,"&cerberus=1&isattack="+e):ct(g_title,g_encodedQuery,g_pos,"OPEN_MAG",undefined,undefined,"&cerberus=0&isattack="+e);prvCache[j]=f;jQuery("#view_content").html(f);resizeVideo()}}})}
function openPreviewWin(a){resetIndex();var b=jQuery(a);g_eCurPrv=a;var d=jQuery("#prv_pseudo");b.find("> a").removeClass().addClass("yl1");var c=b.attr("pos");g_pos=c;a=document.getElementById("preview"+c);a=getAbsolutePos(a);var h=jQuery("#preview"+c),g=getWinScroll(),j=getWinSize(),e=jQuery("#f").height()+jQuery("#pt").height();e=g.top+20<e&&j.height>600?e:g.top+20;if(a.y-20<e)e=a.y-20;jQuery("#prv-window").css("top",e+"px");d.css("top",e+"px");var f=jQuery("#s").width()+20+jQuery("#results").width();
if(j.width<1050){f-=120;if(a.x+h.width()+3>f)f=a.x+h.width()+3;if(f>590)f=590}jQuery("#prv-window").css("left",f+"px");d.css("left",f+32+"px");h=j.width-f-5;if(h<ydPrv.gvar.nMinPrvWinWidth)h=ydPrv.gvar.nMinPrvWinWidth;if(h>ydPrv.gvar.nMaxPrvWinWidth)h=ydPrv.gvar.nMaxPrvWinWidth;jQuery("#prv-window").css("width",h+"px");g_winWidth=h;var i=b.attr("isAttack");g=j.height-(e-g.top)-85;if(i>0)g-=51;if(g<ydPrv.gvar.nMinPrvWinHeight)g=ydPrv.gvar.nMinPrvWinHeight;if(g>ydPrv.gvar.nMaxPrvWinHeight)g=ydPrv.gvar.nMaxPrvWinHeight;
if(e+g<a.y)g=a.y-e;jQuery("#prv-contentid").css("height",g+"px");jQuery(".prv-ml").css("top",a.y-e+"px");jQuery("#view_content").html('<center><img src="http://shared.ydstatic.com/r/'+staticVersion+"/p/preview_loading.gif?"+staticTimestamp+'" /> \u6b63\u5728\u52a0\u8f7d\u9884\u89c8\u4fe1\u606f\uff0c\u8bf7\u7a0d\u5019... ...</center>');var k=b.attr("encodedQuery");g_encodedQuery=k;var m=b.attr("encodedEncryptedTerms"),n=b.attr("docId"),o=b.attr("sliceId");a=jQuery("#hitURL"+c);b=jQuery("#title"+c);
g_title=document.getElementById("hitURL"+c);var l=a.attr("href");a="";a=i>0?b.html():'<a href="'+l+'" target="_blank" onclick="javascript:ct(this, \''+k+"', "+c+", 'MAG_HIT', undefined, undefined, 'magtitle=1')\">"+b.html()+"</a>";jQuery("#title_text").html(a);i>0?jQuery(".prv-dog").css("display","block"):jQuery(".prv-dog").css("display","none");g_openTime=(new Date).getTime();if(g_prvPrv){jQuery("#prv-window").css("display","block");if(prvCache[c]){prvCache[c].indexOf(forbiddenHint)>=0?ct(g_title,
g_encodedQuery,g_pos,"OPEN_MAG",undefined,undefined,"&cerberus=1&isattack="+i):ct(g_title,g_encodedQuery,g_pos,"OPEN_MAG",undefined,undefined,"&cerberus=0&isattack="+i);jQuery("#view_content").html(prvCache[c]);resizeVideo()}else loadData(k,m,n,l,o,-1,c,i)}else d.css({width:"0px",height:"0px"}).animate({width:jQuery("#prv-window").width()-32+"px",height:jQuery("#prv-window").height()+"px"},ydPrv.gvar.animateTime,function(){d.hide();jQuery("#prv-window").css("display","block");if(prvCache[c]){prvCache[c].indexOf(forbiddenHint)>=
0?ct(g_title,g_encodedQuery,g_pos,"OPEN_MAG",undefined,undefined,"&cerberus=1&isattack="+i):ct(g_title,g_encodedQuery,g_pos,"OPEN_MAG",undefined,undefined,"&cerberus=0&isattack="+i);jQuery("#view_content").html(prvCache[c]);resizeVideo()}else loadData(k,m,n,l,o,-1,c,i)})}
function closePreviewWin(a){if(g_openTime>0){var b=Math.round(((new Date).getTime()-g_openTime)/1E3);ct(g_title,g_encodedQuery,g_pos,"MAG_HIT",undefined,undefined,"&viewtime="+b+"&closetype="+a);g_openTime=0}jQuery("#prv-contentid").attr("scrollTop",0);jQuery(g_eCurPrv).find("> a").removeClass().addClass("yl");jQuery("#prv-window").css("display","none");if(g_eCurPrv)g_eCurPrv=null;resetIndex()}function getWinSize(){return{width:jQuery(window).width(),height:jQuery(window).height()}}
function getWinScroll(){return{top:jQuery(window).scrollTop(),left:jQuery(window).scrollLeft()}}function previewScrollTo(a){navigator.userAgent.toLowerCase().indexOf("msie")!=-1?jQuery("#prv-contentid").attr("scrollTop",a-75):jQuery("#prv-contentid").attr("scrollTop",a-100)}var termNavPosition=new Array(20);
function gotoNextKey(a){ct(g_title,g_encodedQuery,g_pos,"MAG_HIT",undefined,undefined,"gotonext=1");var b=termNavPosition[a],d=b+1,c=a+"_"+d;c=document.getElementById(c);b=document.getElementById(a+"_"+b);if(c){previewScrollTo(c.offsetTop);if(b)b.className="";c.className="hlb";termNavPosition[a]=d}else if(d==1){previewScrollTo(0);termNavPosition[a]=+0}else{c=a+"_1";c=document.getElementById(c);previewScrollTo(c.offsetTop);if(b)b.className="";c.className="hlb";termNavPosition[a]=1}}
function resetIndex(){for(var a=0;a<20;a++)termNavPosition[a]=0}function onLinkClick(){ct(g_title,g_encodedQuery,g_pos,"MAG_HIT",undefined,undefined,"linkclick=1")}function onImgLoad(a){a.onload=null;var b=jQuery(a),d=a.width;if(d>g_winWidth-80){d=a.height*(g_winWidth-80)/d;b.css("width",g_winWidth-80);b.css("height",d)}if(a.width<50&&a.height<50)a.style.display="none";else if(a.width<30||a.height<30)a.style.display="none";else{b.before("<br>");b.after("<br>")}}
function resizeVideo(){jQuery(".ydPrvVideo").each(function(a,b){a=jQuery(b);b=a.width();var d=a.height();if(b>g_winWidth-80){b=d*(g_winWidth-80)/b;a.width(g_winWidth-80);a.height(b)}})}function getAbsolutePos(a){for(var b=a.offsetLeft,d=a.offsetTop;a=a.offsetParent;){b+=a.offsetLeft;d+=a.offsetTop}a={};a.x=b;a.y=d;return a};