﻿var Zhishi={loginStateUrl:"",loginStateBarUrl:"",popLoginUrl:"",loginOutUrl:"",ptLoginUrl:"http://ui.ptlogin2.soso.com/cgi-bin/login?link_target=blank&appid=6000201&f_url=loginerroralert&hide_uin_tip=1",popIframeUrlFix:"&target=self&hide_title_bar=1&s_url=",pageIframeUrlFix:"&target=parent&hide_close_icon=1&s_url=",Browser:{isIE:!!(window.attachEvent&&!window.opera),isFirefox:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,isOpera:!!window.opera,isTT:false,isIE6:navigator.appVersion.indexOf("MSIE 6.")>=0,isWebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1}};try{if(window.external.getTTVerStr!=null)Zhishi.Browser.isTT=true}catch(e){}Object.extend=function(A,$){for(var _ in $)A[_]=$[_];return A};Object.extend(Object,{isElement:function($){return $&&$.nodeType==1},isArray:function($){return $!=null&&typeof $=="object"&&"splice"in $&&"join"in $},isFunction:function($){return typeof $=="function"},isString:function($){return typeof $=="string"},isNumber:function($){return typeof $=="number"},isUndefined:function($){return typeof $=="undefined"}});Object.extend(Function.prototype,{bind:function(){var $=this,_=$A(arguments),A=_.shift();return function(){return $.apply(A,_.concat($A(arguments)))}},delay:function(){var $=this,_=$A(arguments),A=_.shift();return window.setTimeout(function(){return $.apply($,_)},A)},methodize:function(){if(this._methodized)return this._methodized;var $=this;return this._methodized=function(){return $.apply(null,[this].concat($A(arguments)))}}});Object.extend(Array.prototype,{first:function(){return this[0]},last:function(){return this[this.length-1]},size:function(){return this.length},indexOf:function($,A){A||(A=0);var _=this.length;if(A<0)A=_+A;for(;A<_;A++)if(this[A]===$)return A;return-1}});Object.extend(String.prototype,{trim:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},contains:function($){return this.indexOf($)>-1},startsWith:function($){return this.indexOf($)===0},endsWith:function(_){var $=this.length-_.length;return $>=0&&this.lastIndexOf(_)===$},empty:function(){return this==""||this==null}});function get($){if(Object.isString($))$=document.getElementById($);return Element.extend($)}function $($){return document.getElementById($)}function $A(A){if(!A)return[];if(A.toArray)return A.toArray();var _=A.length||0,$=new Array(_);while(_--)$[_]=A[_];return $}function trim($){if(typeof $=="string")return $.replace(/(^\s*)|(\s*$)/g,"")}Zhishi.Ajax={_transaction_id:0,_poll:{},_timeOut:{},createXhrObject:function(){if(Zhishi.Browser.isIE){var $=["MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(var A=$.length-1;A>=0;A--){try{return new ActiveXObject($[A])}catch(_){}}}else return new XMLHttpRequest()},getConnectionObj:function(){var $=this.createXhrObject(),_={"conn":$,"tId":this._transaction_id};if($)this._transaction_id++;return _},sendRequest:function(D,E,B){var C=this.getConnectionObj();C.onSuccess=B.onSuccess;C.onLoading=B.onLoading?B.onLoading:"";C.onErr=B.onErr?B.onErr:this.onErr;C.cacheTime=B.cacheTime?B.cacheTime:0;C.postdata=B.postdata?B.postdata:"";C.timeOut=B.timeOut?B.timeOut:30000;C.para=B.para?B.para:"";C.isClearCache=B.isClearCache?B.isClearCache:false;C.isAsyn=true;C.encode=true;if(B.isAsyn!=null&&!B.isAsyn)C.isAsyn=false;if(B.encode!=null&&!B.encode)C.encode=false;var $=new Date();if(C.isClearCache||C.cacheTime==0)var _=$.valueOf().toString();else{_=$.getDate()*24*3600+$.getHours()*3600+$.getMinutes()*60+$.getSeconds();if(_%C.cacheTime!=0)_-=_%C.cacheTime}if(D.toUpperCase()=="GET")E+=((E.indexOf("?")==-1)?"?":"&")+"rnd="+_;C.conn.open(D,E,C.isAsyn);if(B.contentType)C.conn.setRequestHeader("Content-Type",B.contentType);else C.conn.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");this.handleReadyState(C);if(B.raw)C.conn.send(C.postdata);else{var A=C.postdata!=""?this.toQueryString(C.postdata):null;if(!C.encode)A=C.postdata!=""?C.postdata:null;C.conn.send(A)}},handleReadyState:function($){var _=this;this._timeOut[$.tId]=window.setTimeout(function(){$.conn.abort();$.onErr()},$.timeOut);this._poll[$.tId]=window.setInterval(function(){if($.conn&&$.conn.readyState===4&&$.conn.status==200){window.clearInterval(_._poll[$.tId]);delete _._poll[$.tId];window.clearTimeout(_._timeOut[$.tId]);delete _._timeOut[$.tId];$.onSuccess($.conn.responseText,$.para)}else if($.onLoading)$.onLoading()},20)},onErr:function(){},toQueryString:function(_){var $="";if(_.indexOf("&")==-1)return _.split("=")[0]+"="+encodeURIComponent(_.split("=")[1]);else{var A=_.split("&");for(var B=0;B<A.length;B++)$+=A[B].split("=")[0]+"="+encodeURIComponent(A[B].split("=")[1])+"&";return $.substring(0,$.length-1)}}};Zhishi.Cookie={setCookie:function(A,B,_){var $="";if(_!=null){$=new Date((new Date()).getTime()+_*3600000);$="; expires="+$.toGMTString()}document.cookie=A+"="+escape(B)+$},getCookie:function($){var A="",_=$+"=";if(document.cookie.length>0){offset=document.cookie.indexOf(_);if(offset!=-1){offset+=_.length;end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;A=unescape(document.cookie.substring(offset,end))}}return A},delCookie:function(_){var $="; expires=Mon, 26 Jul 1997 05:00:00 GMT";document.cookie=_+"="+$}};Zhishi.Event={attachEventListener:function(_,B,A,$){if(_.addEventListener)_.addEventListener(B,A,$);else if(_.attachEvent)_.attachEvent("on"+B,A);return true},removeEventListener:function(_,B,A,$){if(_.removeEventListener)_.removeEventListener(B,A,$);else if(_.detachEvent)_.detachEvent("on"+B,A);return true},getTarget:function(_){var $=_||window.event;if($)return $.target||$.srcElement;else return null},mouseX:function($){$=$||window.event;return $.pageX||($.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},mouseY:function($){$=$||window.event;return $.pageY||($.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}};Zhishi.Size={getScrollSize:function(){var A=document,B=A.compatMode=="CSS1Compat"?A.documentElement.scrollLeft:A.body.scrollLeft,_=A.compatMode=="CSS1Compat"?A.documentElement.scrollTop:A.body.scrollTop,C=A.compatMode=="CSS1Compat"?A.documentElement.scrollHeight:A.body.scrollHeight,$=A.compatMode=="CSS1Compat"?A.documentElement.scrollWidth:A.body.scrollWidth,E=A.compatMode=="CSS1Compat"?A.documentElement.clientHeight:A.body.clientHeight,D=A.compatMode=="CSS1Compat"?A.documentElement.clientWidth:A.body.clientWidth;if(C<E)C=E;if($<D)$=D;return[B,_,$,C]},getClientSize:function(){var _=document,A=_.compatMode=="CSS1Compat"?_.documentElement.clientHeight:_.body.clientHeight,$=_.compatMode=="CSS1Compat"?_.documentElement.clientWidth:_.body.clientWidth;return[$,A]}};var Element={};Element.extend=(function(){return function(_){if(!_||_._extended||_.nodeType!=1||_==window)return _;var $=Object.extend({},Element.Methods),A=_.tagName,C,B;for(C in $){B=$[C];if(Object.isFunction(B)&&!(C in _))_[C]=B.methodize()}_._extended=true;return _}})();Element.Methods={visible:function($){return get($).style.display!="none"},hide:function($){get($).style.display="none";return $},show:function($){get($).style.display="";return $},hasClassName:function(_,A){if(!(_=get(_)))return;var $=_.className;return($.length>0&&($==A||new RegExp("(^|\\s)"+A+"(\\s|$)").test($)))},addClassName:function($,_){if(!($=get($)))return;if(!$.hasClassName(_))$.className+=($.className?" ":"")+_;return $},removeClassName:function($,_){if(!($=get($)))return;$.className=$.className.replace(new RegExp("(^|\\s+)"+_+"(\\s+|$)")," ").trim();return $},scrollTo:function($){$=get($);var _=$.cumulativeOffset();window.scrollTo(_[0],_[1]);return $},getSize:function(_){var $=_.offsetWidth,A=_.offsetHeight;return[$,A]},setSize:function(_,B,A){var $=(!B||B<0)?"auto":parseInt(B)+"px",C=(!A||A<0)?"auto":parseInt(A)+"px";_.width=$;_.height=C},getXY:function($){var _=0,C=0;if(document.documentElement.getBoundingClientRect){var B=$.getBoundingClientRect(),A=$.ownerDocument;_=B.top-2+Zhishi.Size.getScrollSize(A)[1];C=B.left-2+Zhishi.Size.getScrollSize(A)[0]}else while($.offsetParent){_+=$.offsetTop;C+=$.offsetLeft;$=$.offsetParent}return[C,_]},setXY:function($,C,B){var A=$.style.marginLeft?$.style.marginLeft:0,_=$.style.marginTop?$.style.marginTop:0;$.style.left=parseInt(C)-A+"px";$.style.top=parseInt(B)-_+"px"},setStyle:function($,A,_){switch(A){case"opacity":if(Zhishi.Browser.isIE)$.style.filter="alpha(opacity="+parseFloat(_)+")";else $.style["opacity"]=parseFloat(_)/100;break;default:$.style[A]=_;break}}};Zhishi.LayerBase=function($,A,B,C){try{this.oldSize=Zhishi.Size.getScrollSize()}catch(_){}this.height=A||100;this.width=B||100;this.title=$||"\u641c\u641c\u95ee\u95ee";this.maskObj=null,this.maskClass="layer_mask_class";this.maskOpacity=25;this.backIframeObj=null;this.backIframeClass="layer_backIframe_class";this.mainObj=null;this.mainClass="layer_main_class";this.headObj=null;this.headHeight=35;this.headClass="layer_head_class";this.hasBottomHr=true;this.headBottomHrClass="layer_head_bottomHr";this.closeLinkClass="layer_closeLink_class";this.containerObj=null;this.canDrag=false;this.top=null;for(var D in C)this[D]=C[D]};Zhishi.LayerBase.prototype.show=function(){if(Zhishi.isDialogAlive)return;Zhishi.isDialogAlive=true;this.createUI();this.initEvent();if(this.canDrag)this.bindDrag();this.appendClose();if(this.hasBottomHr)this.appendBottomBorder();this.setPosition()};Zhishi.LayerBase.prototype.bindDrag=function(){this.headMouseDownEvent=this.headMouseDown.bind(this);Zhishi.Event.attachEventListener(this.headObj,"mousedown",this.headMouseDownEvent)};Zhishi.LayerBase.prototype.headMouseDownEvent=function(){};Zhishi.LayerBase.prototype.headMouseDown=function(A){A=A||window.event;var _=this.mainObj;_.oldX=A.clientX;_.oldY=A.clientY;var $=_.style.left?parseInt(_.style.left):0,B=_.style.top?parseInt(_.style.top):0;_.differenceX=$-A.clientX;_.differenceY=B-A.clientY;this.headMouseMoveEvent=this.headMouseMove.bind(this);Zhishi.Event.attachEventListener(document,"mousemove",this.headMouseMoveEvent);this.headMouseUpEvent=this.headMouseUp.bind(this);Zhishi.Event.attachEventListener(document,"mouseup",this.headMouseUpEvent);this.stopDefaultEvent(A)};Zhishi.LayerBase.prototype.headMouseMoveEvent=function(){};Zhishi.LayerBase.prototype.headMouseMove=function(_){_=_||window.event;var $=this.mainObj;$.style.left=_.clientX+$.differenceX+"px";$.style.top=_.clientY+$.differenceY+"px";this.stopDefaultEvent(_)};Zhishi.LayerBase.prototype.headMouseUpEvent=function(){};Zhishi.LayerBase.prototype.headMouseUp=function($){Zhishi.Event.removeEventListener(document,"mousemove",this.headMouseMoveEvent);Zhishi.Event.removeEventListener(document,"mouseup",this.headMouseUpEvent);this.stopDefaultEvent($)};Zhishi.LayerBase.prototype.stopDefaultEvent=function($){$=$||window.event;$.returnValue=false;if($.preventDefault)$.preventDefault();return true};Zhishi.LayerBase.prototype.initEvent=function(){this.resetPositonEvent=this.resetPosition.bind(this);Zhishi.Event.attachEventListener(window,"resize",this.resetPositonEvent)};Zhishi.LayerBase.prototype.removeEvent=function(){Zhishi.Event.removeEventListener(window,"resize",this.resetPositonEvent);Zhishi.Event.removeEventListener(this.headObj,"mousedown",this.headMouseDownEvent)};Zhishi.LayerBase.prototype.resetPositonEvent=function(){};Zhishi.LayerBase.prototype.resetPosition=function(){var $=this.maskObj,B=this.mainObj;$.style.left="0px";$.style.top="0px";$.style.width="100%";$.style.height="100%";if(Zhishi.Browser.isIE6||document.compatMode!="CSS1Compat"){$.style.width=Zhishi.Size.getScrollSize()[2]+"px";$.style.height=Zhishi.Size.getScrollSize()[3]+"px"}var _=Zhishi.Size.getScrollSize()[1]+125,A=Zhishi.Size.getScrollSize()[1]+(Zhishi.Size.getClientSize()[1]-this.height)/2;if(this.top){_=Zhishi.Size.getScrollSize()[1]+this.top;A=Zhishi.Size.getScrollSize()[1]+this.top}if(Zhishi.Browser.isIE6){this.backIframeObj.style.left=(Zhishi.Size.getScrollSize()[0]+(Zhishi.Size.getClientSize()[0]-this.width)/2)+"px";this.backIframeObj.style.top=_+"px";if(this.height>400)this.backIframeObj.style.top=A+"px"}B.style.left=(Zhishi.Size.getScrollSize()[0]+(Zhishi.Size.getClientSize()[0]-this.width)/2)+"px";B.style.top=_+"px";if(this.height>400)B.style.top=A+"px"};Zhishi.LayerBase.prototype.setPosition=function(){var _=this.maskObj,D=this.mainObj,B=this.headObj,A=Zhishi.Size.getScrollSize()[1]+125,C=Zhishi.Size.getScrollSize()[1]+(Zhishi.Size.getClientSize()[1]-this.height)/2;if(this.top){A=Zhishi.Size.getScrollSize()[1]+this.top;C=Zhishi.Size.getScrollSize()[1]+this.top}_.style.left="0px";_.style.top="0px";_.style.width="100%";_.style.height="100%";if(Zhishi.Browser.isIE6||document.compatMode!="CSS1Compat"){_.style.width=this.oldSize[2]+"px";_.style.height=this.oldSize[3]+"px"}if(Zhishi.Browser.isIE6){var $=this.backIframeObj;$.style.left=(Zhishi.Size.getScrollSize()[0]+(Zhishi.Size.getClientSize()[0]-this.width)/2)+"px";$.style.top=A+"px";if(this.height>400)$.style.top=C+"px";if(Zhishi.Browser.isFirefox)$.style.height=this.height+9+"px";else $.style.height=this.height+2+"px";$.style.width=this.width+2+"px"}D.style.left=(Zhishi.Size.getScrollSize()[0]+(Zhishi.Size.getClientSize()[0]-this.width)/2)+"px";D.style.top=A+"px";if(this.height>400)D.style.top=C+"px";D.style.height=this.height+"px";D.style.width=this.width+"px";B.style.width=this.width+"px"};Zhishi.LayerBase.prototype.createUI=function(){var B=document.createElement("div");B.style.position="fixed";if(Zhishi.Browser.isIE6||document.compatMode!="CSS1Compat")B.style.position="absolute";B.className=this.maskClass;this.setOpacity(B,this.maskOpacity);var D=document.createElement("div");D.style.position="absolute";D.className=this.mainClass;var _=document.createElement("div"),C=document.createElement("div");C.style.width=this.width+"px";C.style.height=this.headHeight+"px";C.className=this.headClass;var A=document.createElement("span");A.className="layer_title";A.innerHTML=this.title;A.setAttribute("style","height:"+(this.headHeight-2)+"px;line-height:"+(this.headHeight-2)+"px;");C.appendChild(A);D.appendChild(C);D.appendChild(_);document.body.appendChild(B);document.body.appendChild(D);if(Zhishi.Browser.isIE6){var $=document.createElement("iframe");$.style.position="absolute";$.className=this.backIframeClass;$.setAttribute("scrolling","no");$.setAttribute("frameborder","0",0);this.setOpacity($,this.borderOpacity);document.body.appendChild($);this.backIframeObj=$}this.maskObj=B;this.containerObj=_;this.mainObj=D;this.headObj=C};Zhishi.LayerBase.prototype.removeUI=function(){get(this.maskObj).hide();get(this.mainObj).hide();if(Zhishi.Browser.isIE6)get(this.backIframeObj).hide()};Zhishi.LayerBase.prototype.appendClose=function(){var _=document.createElement("a");_.href="javascript:void(0)";_.onclick=this.close.bind(this);_.title="\u5173\u95ed";_.className=this.closeLinkClass;var $=document.createElement("span");$.className="layer_close";$.setAttribute("style","height:"+(this.headHeight-9)+"px;line-height:"+(this.headHeight-9)+"px;");$.appendChild(_);this.headObj.appendChild($)};Zhishi.LayerBase.prototype.appendBottomBorder=function(){var $=document.createElement("div");$.className=this.headBottomHrClass;this.headObj.appendChild($)};Zhishi.LayerBase.prototype.onClose=null;Zhishi.LayerBase.prototype.afterClose=function(){};Zhishi.LayerBase.prototype.close=function(){if(this.onClose==null){this.removeEvent();this.removeUI();this.afterClose()}else if(this.onClose!=null&&this.onClose()){this.removeEvent();this.removeUI();this.afterClose()}Zhishi.isDialogAlive=false};Zhishi.LayerBase.prototype.setOpacity=function($,_){if(Zhishi.Browser.isIE)$.style.filter="alpha(opacity="+parseFloat(_)+")";else $.style["opacity"]=parseFloat(_)/100};Zhishi.Dialog=function($,A,_,D,B,C){Zhishi.LayerBase.call(this,$,_,A,C);this.iframe=document.createElement("iframe");this.iframe.setAttribute("scrolling","no");this.iframe.setAttribute("frameborder","0",0);this.isFrame=D||false;this.value=B||""};Zhishi.Dialog.prototype=new Zhishi.LayerBase();Zhishi.Dialog.prototype.constructor=Zhishi.Dialog;Zhishi.Dialog.prototype.createUI=function(){Zhishi.LayerBase.prototype.createUI.call(this);if(this.isFrame){this.iframe.setAttribute("src",this.value);this.iframe.setAttribute("height",this.height-this.headHeight);this.iframe.setAttribute("width",this.width);this.containerObj.appendChild(this.iframe)}else this.containerObj.innerHTML=this.value};Zhishi.Dialog.prototype.resize=function(B,_){if(Zhishi.Browser.isIE6)var A=this.backIframeObj;var $=this.iframe,D=this.mainObj,C=this.headObj;if(Zhishi.Browser.isFirefox){if(Zhishi.Browser.isIE6)A.style.height=9+_+"px";$.style.height=9+_-35+"px"}else{if(Zhishi.Browser.isIE6)A.style.height=2+_+"px";$.style.height=2+_-35+"px"}if(Zhishi.Browser.isIE6)A.style.width=B+"px";$.style.width=B+"px";D.style.height=_+"px";D.style.width=B+"px";C.style.width=B+"px";this.height=_;this.width=B};Zhishi.Effect=function(A,C,$,B,_){this.obj=get(A);this.isColor=/^#/.test($);this.prop=C;var D=/\d+([a-z%]+)/i.exec($);this.suffix=D?D[1]:"";this.startValue=this.isColor?0:parseFloat($);this.finishValue=this.isColor?100:parseFloat(B);if(this.isColor){this.startColor=this.convertHexColor($);this.finishColor=this.convertHexColor(B)}this.duration=_||10;this.startTime=0;this.currentValue=0;this.changeValue=this.finishValue-this.startValue;this.isPlayed=false};Zhishi.Effect.prototype.fun=function(A,$,B,_){return B*A/_+$};Zhishi.Effect.prototype.start=function(){this.reloadTimer();this.isPlayed=true;this.runTime()};Zhishi.Effect.prototype.reloadTimer=function(){this.startTime=new Date().getTime()};Zhishi.Effect.prototype.playTime=function(_){var A=false;if(_>this.duration){_=this.duration;A=true}var $=this.fun(_,this.startValue,this.changeValue,this.duration);this.currentValue=/(opacity)/i.test(this.prop)?$:Math.round($);if(this.isColor)this.currentValue=this.getColor(this.startColor,this.finishColor,$);this.obj.setStyle(this.prop,this.currentValue+this.suffix);if(A){this.isPlayed=false;if(window.CollectGarbage)CollectGarbage()}};Zhishi.Effect.prototype.runTime=function(){var $=this;if($.isPlayed){$.playTime((new Date().getTime()-this.startTime)/1000);setTimeout(function(){$.runTime.apply($)},0)}};Zhishi.Effect.prototype.getColor=function(B,A,$){var C=B,E=A,_=[];if($>100)$=100;if($<0)$=0;for(var D=0;D<3;D++){_[D]=Math.floor(C[D]*1+($/100)*(E[D]-C[D])).toString(16);if(_[D].length<2)_[D]="0"+_[D]}return"#"+_.join("")};Zhishi.Effect.prototype.simpleFun=function(A,$,B,_){return B*A/_+$};Zhishi.Effect.prototype.convertHexColor=function(B){B=/^#/.test(B)?B.substr(1):B;var C=new RegExp("\\w{2}","ig");B=B.match(C);if(!B||B.length<3)return[0,0,0];var A=parseInt(B[0],16),$=parseInt(B[1],16),_=parseInt(B[2],16);return[A,$,_]};Zhishi.Login={loginList:[],callBackObj:"",loginDialog:null,loginNavIds:["TW","loginNav"],getElements:function(){var $=[];Zhishi.Login.pushElements("input",$);Zhishi.Login.pushElements("button",$);Zhishi.Login.pushElements("a",$);return $},pushElements:function($,A){var _=document.getElementsByTagName($);for(var B=0;B<_.length;B++)if((" "+_[B].className+" ").indexOf(" login_require ")!=-1)A.push(_[B])},init:function(){var A=Zhishi.Login.getElements();for(var B=0;B<A.length;B++){var _=A[B];if(_.onclick)Zhishi.Login.loginList[B]=_.onclick;else if(_.tagName.toLowerCase()=="a"){Zhishi.Login.loginList[B]=_.href;_.href="#"}_.setAttribute("wenwenid",B);_.onclick=Zhishi.Login.newMethod;_.style.cursor="pointer"}Zhishi.Event.attachEventListener(window,"load",function(){if(Zhishi.Cookie.getCookie("searchWord")!=null){if($("sb")&&$("sb").value=="")$("sb").value=Zhishi.Cookie.getCookie("searchWord");Zhishi.Cookie.setCookie("searchWord","")}},false)},changeLoginStateBar:function(B){var $="",_=Zhishi.Login.loginNavIds;for(var A=0;A<_.length;A++)if(get(_[A])!=null){$=_[A];break}if($!="")get($).innerHTML=B},newMethod:function(){var _=Zhishi.Browser.isIE?event.srcElement:arguments[0].target,$={onSuccess:Zhishi.Login.checkLogin,para:_};Zhishi.Ajax.sendRequest("GET",Zhishi.loginStateUrl,$)},execOldMethod:function(_){var $=Zhishi.Login.loginList[_.getAttribute("wenwenid")];if(_.tagName.toLowerCase()=="input"||typeof $=="function")$();else document.location=$},checkLogin:function(_,$){if(_=="1")Zhishi.Login.execOldMethod($);else if(_=="0")Zhishi.Login.openLoginDialog($)},openLoginDialog:function(B,C){this.callBackObj=B?B:this.callBackObj;var _=290;if(Zhishi.popLoginUrl.indexOf(Zhishi.ptLoginUrl)>=0)var A=Zhishi.popLoginUrl;else A=Zhishi.ptLoginUrl+Zhishi.popIframeUrlFix+encodeURIComponent(Zhishi.popLoginUrl);if(C!=null&&C==true){_=310;A+="&qlogin_jumpname=wenwen_clientJump";document.domain="soso.com"}var $=Zhishi.Browser.isIE?373:371;if(Zhishi.Browser.isFirefox)_=280;else if(Zhishi.Browser.isOpera)_=275;Zhishi.Login.loginDialog=new Zhishi.Dialog("<img src=\"http://cache.soso.com/wenwen/i/loginIcon_2.gif\" style=\"vertical-align:middle;\" height=\"30\" width=\"20\"/>&nbsp;\u7528\u6237\u767b\u5f55",373,_,true,A);Zhishi.Login.loginDialog.show()},loginLink:function(){Zhishi.Login.rememberSearchWord();Zhishi.Cookie.setCookie("oneKeyUrl",document.location,1);Zhishi.Ajax.sendRequest("GET",Zhishi.loginStateUrl,{onSuccess:Zhishi.Login.doLoginForOnekey})},doLogin:function($){Zhishi.Login.rememberSearchWord();if($=="1")document.location.reload();else if($=="0")Zhishi.Login.openLoginDialog()},doLoginForOnekey:function($){if($=="1")document.location.reload();else if($=="0")Zhishi.Login.openLoginDialog(null,true)},rememberSearchWord:function(){if($("sb")&&$("sb").value!="")Zhishi.Cookie.setCookie("searchWord",$("sb").value)},logout:function($){Zhishi.Login.rememberSearchWord();document.location=$},autoCloseLoginDialog:function(){Zhishi.Login.loginDialog.close();var B=Zhishi.Login.callBackObj;if(B){var $="",_=Zhishi.Login.loginNavIds;for(var C=0;C<_.length;C++)if(get(_[C])!=null){$=_[C];break}var A=Zhishi.Login.loginList[B.getAttribute("wenwenid")];if(typeof A!="function")document.location=A;else if((" "+Zhishi.Login.callBackObj.className+" ").indexOf(" login_norefresh ")==-1&&(" "+get($).className+" ").indexOf(" reload ")!=-1)document.location=document.location;else{Zhishi.Ajax.sendRequest("GET",Zhishi.loginStateBarUrl,{onSuccess:Zhishi.Login.changeLoginStateBar});if(Zhishi.Login.callBackObj)Zhishi.Login.execOldMethod(Zhishi.Login.callBackObj)}}else document.location=document.location}};Zhishi.Validator={realTimeCheckLength:function(C,A,B,_){var $=get(B),D=A;if(get(C).value!=_)D-=get(C).value.length;if(D>=0){$.removeClassName("error red");$.innerHTML="\u8fd8\u53ef\u4ee5\u8f93\u5165<b>"+D+"</b>\u4e2a\u5b57"}else{$.addClassName("error red");$.innerHTML="\u5df2\u8d85\u8fc7\u4e0a\u9650<b>"+(0-D)+"</b>\u4e2a\u5b57\uff0c\u8bf7\u5220\u51cf\uff01"}}};Zhishi.Tool={};Zhishi.Tool.InputHelp={_inputId:"",_message:"",_messageClassName:"",startT:function(A,$,_){this._inputId=A?A:this._inputId;this._message=$?$:"";this._messageClassName=_?_:"WenwenInputHelpClass";if(get(Zhishi.Tool.InputHelp._inputId).value==""){Zhishi.Tool.InputHelp.createT();Zhishi.Tool.InputHelp.setT();Zhishi.Event.attachEventListener(window,"resize",Zhishi.Tool.InputHelp.setT,false)}},createT:function(){var $=document.createElement("div");$.id="WenwenTipId";$.innerHTML=Zhishi.Tool.InputHelp._message;document.body.appendChild($)},setT:function(){var $=get(Zhishi.Tool.InputHelp._inputId),F=get("WenwenTipId");F.style.position="absolute";F.className=Zhishi.Tool.InputHelp._messageClassName;var E=$.style.padding?parseInt($.style.padding):0,D=$.style.margin?parseInt($.style.margin):0;if(Zhishi.Browser.isIE){var B=0,A=0,_=$;while(_!=null&&_!=document.body){B+=_.offsetLeft;A+=_.offsetTop;parseInt(_.currentStyle.borderLeftWidth)>0?B+=parseInt(_.currentStyle.borderLeftWidth):"";parseInt(_.currentStyle.borderTopWidth)>0?A+=parseInt(_.currentStyle.borderTopWidth):"";_=_.offsetParent}var C=B+E+4,G=A+E}else C=$.offsetLeft+E+4,G=$.offsetTop+E;if($.tagName.toLowerCase()=="textarea"){C+=4;G+=4}if($.tagName.toLowerCase()=="input")G+=($.offsetHeight-D-E-F.scrollHeight)/2;F.style.left=C+"px";F.style.top=G+"px";F.onclick=Zhishi.Tool.InputHelp.stopT;$.onblur=Zhishi.Tool.InputHelp.startT;$.onfocus=Zhishi.Tool.InputHelp.stopT},stopT:function(){try{document.body.removeChild(get("WenwenTipId"));get(Zhishi.Tool.InputHelp._inputId).focus()}catch($){}}}