﻿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=",onBeforeClose:null,isLogin:"0",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},removeWindowCloseEvent:function(){if(Zhishi.Browser.isIE&&window.onbeforeunload){Zhishi.onBeforeClose=window.onbeforeunload;window.onbeforeunload=null}},resumeWindowCloseEvent:function(){if(Zhishi.Browser.isIE&&Zhishi.onBeforeClose){setTimeout(function(){window.onbeforeunload=Zhishi.onBeforeClose;Zhishi.onBeforeClose=null},100)}},hackForIeReload:function(){if(Zhishi.Browser.isIE){document.body.style.zoom=1.1;document.body.style.zoom=""}}};try{if(window.external.getTTVerStr!=null){Zhishi.Browser.isTT=true}}catch(e){}Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};Object.extend(Object,{isElement:function(a){return a&&a.nodeType==1},isArray:function(a){return a!=null&&typeof a=="object"&&"splice" in a&&"join" in a},isFunction:function(a){return typeof a=="function"},isString:function(a){return typeof a=="string"},isNumber:function(a){return typeof a=="number"},isUndefined:function(a){return typeof a=="undefined"}});Object.extend(Function.prototype,{bind:function(){var a=this,c=$A(arguments),b=c.shift();return function(){return a.apply(b,c.concat($A(arguments)))}},delay:function(){var a=this,b=$A(arguments),c=b.shift();return window.setTimeout(function(){return a.apply(a,b)},c)},methodize:function(){if(this._methodized){return this._methodized}var a=this;return this._methodized=function(){return a.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(c,a){a||(a=0);var b=this.length;if(a<0){a=b+a}for(;a<b;a++){if(this[a]===c){return a}}return -1}});Object.extend(String.prototype,{trim:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},contains:function(a){return this.indexOf(a)>-1},startsWith:function(a){return this.indexOf(a)===0},endsWith:function(a){var b=this.length-a.length;return b>=0&&this.lastIndexOf(a)===b},empty:function(){return this==""||this==null}});function get(a){if(Object.isString(a)){a=document.getElementById(a)}return Element.extend(a)}function gets(a){if(a){return Zhishi.Selector.find(a)}}function $(a){return document.getElementById(a)}function $A(c){if(!c){return[]}if(c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}function trim(a){if(typeof a=="string"){return a.replace(/(^\s*)|(\s*$)/g,"")}}Zhishi.Ajax={_transaction_id:0,_poll:{},_timeOut:{},createXhrObject:function(){if(Zhishi.Browser.isIE){var c=["MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(var a=c.length-1;a>=0;a--){try{return new ActiveXObject(c[a])}catch(b){}}}else{return new XMLHttpRequest()}},getConnectionObj:function(){var b=this.createXhrObject();var a={conn:b,tId:this._transaction_id};if(b){this._transaction_id++}return a},sendRequest:function(j,a,h){var g=this.getConnectionObj();g.onSuccess=h.onSuccess;g.onLoading=h.onLoading?h.onLoading:"";g.onErr=h.onErr?h.onErr:this.onErr;g.cacheTime=h.cacheTime?h.cacheTime:0;g.postdata=h.postdata?h.postdata:"";g.timeOut=h.timeOut?h.timeOut:30000;g.para=h.para?h.para:"";g.isClearCache=h.isClearCache?h.isClearCache:false;g.isAsyn=true;g.encode=true;if(h.isAsyn!=null&&!h.isAsyn){g.isAsyn=false}if(h.encode!=null&&!h.encode){g.encode=false}var f=new Date();if(g.isClearCache||g.cacheTime==0){var b=f.valueOf().toString()}else{var b=f.getDate()*24*3600+f.getHours()*3600+f.getMinutes()*60+f.getSeconds();if(b%g.cacheTime!=0){b-=b%g.cacheTime}}if(j.toUpperCase()=="GET"){a+=((a.indexOf("?")==-1)?"?":"&")+"rnd="+b}g.conn.open(j,a,g.isAsyn);if(h.contentType){g.conn.setRequestHeader("Content-Type",h.contentType)}else{g.conn.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8")}this.handleReadyState(g);if(h.raw){g.conn.send(g.postdata)}else{var c=g.postdata!=""?this.toQueryString(g.postdata):null;if(!g.encode){c=g.postdata!=""?g.postdata:null}g.conn.send(c)}},handleReadyState:function(b){var a=this;this._timeOut[b.tId]=window.setTimeout(function(){b.conn.abort();b.onErr()},b.timeOut);this._poll[b.tId]=window.setInterval(function(){if(b.conn&&b.conn.readyState===4&&b.conn.status==200){window.clearInterval(a._poll[b.tId]);delete a._poll[b.tId];window.clearTimeout(a._timeOut[b.tId]);delete a._timeOut[b.tId];b.onSuccess(b.conn.responseText,b.para)}else{if(b.onLoading){b.onLoading()}}},20)},onErr:function(){},toQueryString:function(c){var d="";if(c.indexOf("&")==-1){return c.split("=")[0]+"="+encodeURIComponent(c.split("=")[1])}else{var b=c.split("&");for(var a=0;a<b.length;a++){d+=b[a].split("=")[0]+"="+encodeURIComponent(b[a].split("=")[1])+"&"}return d.substring(0,d.length-1)}}};Zhishi.Cookie={setCookie:function(c,d,a){var b="";if(a!=null){b=new Date((new Date()).getTime()+a*3600000);b="; expires="+b.toGMTString()}document.cookie=c+"="+escape(d)+b},getCookie:function(a){var c="";var b=a+"=";if(document.cookie.length>0){offset=document.cookie.indexOf(b);if(offset!=-1){offset+=b.length;end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length}c=unescape(document.cookie.substring(offset,end))}}return c},delCookie:function(b){var a="; expires=Mon, 26 Jul 1997 05:00:00 GMT";document.cookie=b+"="+a}};Zhishi.Event={domLoadedEventList:new Array(),attachEventListener:function(d,b,c,a){if(Object.isString(d)){d=get(d)}if(d==window&&b=="domready"){Zhishi.Event.domLoadedEventList.push(c)}else{if(d.addEventListener){d.addEventListener(b,c,a)}else{if(d.attachEvent){d.attachEvent("on"+b,c)}}}},removeEventListener:function(d,b,c,a){if(d.removeEventListener){d.removeEventListener(b,c,a)}else{if(d.detachEvent){d.detachEvent("on"+b,c)}}return true},fireDomReady:function(){if(Zhishi.Event.domLoadedEventList){for(var a=0;a<Zhishi.Event.domLoadedEventList.length;a++){Zhishi.Event.domLoadedEventList[a]()}}},getTarget:function(a){var b=a||window.event;if(b){return b.target||b.srcElement}else{return null}},mouseX:function(a){a=a||window.event;return a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},mouseY:function(a){a=a||window.event;return a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}};Zhishi.Size={getScrollSize:function(){var j=document;var c=j.compatMode=="CSS1Compat"?j.documentElement.scrollLeft:j.body.scrollLeft;var f=j.compatMode=="CSS1Compat"?j.documentElement.scrollTop:j.body.scrollTop;var g=j.compatMode=="CSS1Compat"?j.documentElement.scrollHeight:j.body.scrollHeight;var b=j.compatMode=="CSS1Compat"?j.documentElement.scrollWidth:j.body.scrollWidth;var d=j.compatMode=="CSS1Compat"?j.documentElement.clientHeight:j.body.clientHeight;var a=j.compatMode=="CSS1Compat"?j.documentElement.clientWidth:j.body.clientWidth;if(g<d){g=d}if(b<a){b=a}return[c,f,b,g]},getClientSize:function(){var c=document;var b=c.compatMode=="CSS1Compat"?c.documentElement.clientHeight:c.body.clientHeight;var a=c.compatMode=="CSS1Compat"?c.documentElement.clientWidth:c.body.clientWidth;return[a,b]}};var Element={};Element.extend=(function(){return function(c){if(!c||c._extended||c.nodeType!=1||c==window){return c}var a=Object.extend({},Element.Methods),b=c.tagName,f,d;for(f in a){d=a[f];if(Object.isFunction(d)&&!(f in c)){c[f]=d.methodize()}}c._extended=true;return c}})();Element.Methods={visible:function(a){return get(a).style.display!="none"},hide:function(a){get(a).style.display="none";return a},show:function(a){get(a).style.display="";return a},hasClassName:function(a,b){if(!(a=get(a))){return}var c=a.className;return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))},addClassName:function(a,b){if(!(a=get(a))){return}if(!a.hasClassName(b)){a.className+=(a.className?" ":"")+b}return a},removeClassName:function(a,b){if(!(a=get(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").trim();return a},overwriteClassName:function(a,b){if(!(a=get(a))){return}a.className=b;return a},scrollTo:function(a){a=get(a);var b=a.cumulativeOffset();window.scrollTo(b[0],b[1]);return a},getSize:function(b){var a=b.offsetWidth;var c=b.offsetHeight;return[a,c]},setSize:function(c,f,a){var b=(!f||f<0)?"auto":parseInt(f)+"px";var d=(!a||a<0)?"auto":parseInt(a)+"px";c.width=b;c.height=d},getXY:function(d){var c=0;var b=0;if(document.documentElement.getBoundingClientRect){var f=d.getBoundingClientRect();var a=d.ownerDocument;c=f.top-2+Zhishi.Size.getScrollSize(a)[1];b=f.left-2+Zhishi.Size.getScrollSize(a)[0]}else{while(d.offsetParent){c+=d.offsetTop;b+=d.offsetLeft;d=d.offsetParent}}return[b,c]},setXY:function(c,a,f){var d=c.style.marginLeft?c.style.marginLeft:0;var b=c.style.marginTop?c.style.marginTop:0;c.style.left=parseInt(a)-d+"px";c.style.top=parseInt(f)-b+"px"},setStyle:function(a,c,b){switch(c){case"opacity":if(Zhishi.Browser.isIE){a.style.filter="alpha(opacity="+parseFloat(b)+")"}else{a.style.opacity=parseFloat(b)/100}break;default:a.style[c]=b;break}},insertAfter:function(b,a){if(!(b=get(b))){return}var c=b.parentNode;if(c.lastChild==b){c.appendChild(a)}else{c.insertBefore(a,b.nextSibling)}},fadeIn:function(b,a){if(!(b=get(b))){return}a=a||3;b.setStyle("opacity",0);b.setStyle("display","block");var c=new Zhishi.Effect(b,"opacity",0,100,a);c.start()},fadeOut:function(b,a){if(!(b=get(b))){return}a=a||3;var c=new Zhishi.Effect(b,"opacity",100,0,a);c.start();setTimeout(function(){b.setStyle("display","none");b.setStyle("opacity","100")},a*1000)},slideUp:function(c,b){if(!(c=get(c))){return}b=b||3;var a=parseInt(c.getSize()[1]);var d=new Zhishi.Effect(c,"height",a+"px",0+"px",b);d.start()},slideDown:function(b,c,a){if(!(b=get(b))){return}if(c){a=a||3;var d=new Zhishi.Effect(b,"height",0+"px",c+"px",a);d.start()}},gets:function(a,b){if(b){return Zhishi.Selector.find(b,a)}}};Zhishi.Selector={snack:/(?:[\w\-\\.#]+)+(?:\[\w+?=([\'"])?(?:\\\1|.)+?\1\])?|\*|>/ig,exprClassName:/^(?:[\w\-_]+)?\.([\w\-_]+)/,exprId:/^(?:[\w\-_]+)?#([\w\-_]+)/,exprNodeName:/^([\w\*\-_]+)/,na:[null,null],find:function(f,c){c=c||document;var a=/^[\w\-_#]+$/.test(f);if(!a&&c.querySelectorAll){var j=$A(c.querySelectorAll(f));if(j){for(var h=0;h<j.length;h++){j[h]=Element.extend(j[h])}}return j}if(f.indexOf(",")>-1){var n=f.split(/,/g),l=[];for(var k=0;k<n.length;k++){l=l.concat(Zhishi.Selector.find(n[k],c))}return Zhishi.Selector.uinq(l)}var g=f.match(Zhishi.Selector.snack),d=g.pop(),b=(d.match(Zhishi.Selector.exprId)||Zhishi.Selector.na)[1],m=!b&&(d.match(Zhishi.Selector.exprClassName)||Zhishi.Selector.na)[1],o=!b&&(d.match(Zhishi.Selector.exprNodeName)||Zhishi.Selector.na)[1],j;j=!b&&$A(c.getElementsByTagName(o||"*"));if(j){for(var h=0;h<j.length;h++){j[h]=Element.extend(j[h])}}if(m){j=Zhishi.Selector.filterByAttr(j,"className",RegExp("(^|\\s)"+m+"(\\s|$)"))}if(b){var p=c.getElementById(b);return p?[Element.extend(p)]:[]}return g[0]&&j[0]?Zhishi.Selector.filterParents(g,j):j},filterParents:function(n,g,d){var h=n.pop();if(h===">"){return Zhishi.Selector.filterParents(n,g,true)}var j=[],a=-1,b=(h.match(Zhishi.Selector.exprId)||Zhishi.Selector.na)[1],k=!b&&(h.match(Zhishi.Selector.exprClassName)||Zhishi.Selector.na)[1],m=!b&&(h.match(Zhishi.Selector.exprNodeName)||Zhishi.Selector.na)[1],l=-1,c,o,f;m=m&&m.toLowerCase();while((c=g[++l])){o=c.parentNode;do{f=!m||m==="*"||m===o.nodeName.toLowerCase();f=f&&(!b||o.id===b);f=f&&(!k||RegExp("(^|\\s)"+k+"(\\s|$)").test(o.className));if(d||f){break}}while((o=o.parentNode));if(f){j[++a]=Element.extend(c)}}return n[0]&&j[0]?Zhishi.Selector.filterParents(n,j):j},filterByAttr:function(h,a,g){var c=-1,f,d=-1,b=[];while((f=h[++c])){if(g.test(f[a])){b[++d]=Element.extend(f)}}return b},uinq:function(f){var h=[],a=0,k,g=+new Date(),b=1;for(var d=0;d<f.length;++d){k=f[d];var j=k[g],c=b++;if(!j){k[g]=c;h[a++]=k}}g++;return h}};Zhishi.LayerBase=function(g,b,d,a){try{this.oldSize=Zhishi.Size.getScrollSize()}catch(f){}this.height=b||100;this.width=d||100;this.title=g||"\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 c in a){this[c]=a[c]}};Zhishi.LayerBase.prototype.show=function(){if(Zhishi.isDialogAlive){return}Zhishi.isDialogAlive=true;Zhishi.removeWindowCloseEvent();this.createUI();this.initEvent();if(this.canDrag){this.bindDrag()}this.appendClose();if(this.hasBottomHr){this.appendBottomBorder()}this.setPosition();Zhishi.hackForIeReload()};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(d){d=d||window.event;var a=this.mainObj;a.oldX=d.clientX;a.oldY=d.clientY;var c=a.style.left?parseInt(a.style.left):0;var b=a.style.top?parseInt(a.style.top):0;a.differenceX=c-d.clientX;a.differenceY=b-d.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(d)};Zhishi.LayerBase.prototype.headMouseMoveEvent=function(){};Zhishi.LayerBase.prototype.headMouseMove=function(b){b=b||window.event;var a=this.mainObj;a.style.left=b.clientX+a.differenceX+"px";a.style.top=b.clientY+a.differenceY+"px";this.stopDefaultEvent(b)};Zhishi.LayerBase.prototype.headMouseUpEvent=function(){};Zhishi.LayerBase.prototype.headMouseUp=function(a){Zhishi.Event.removeEventListener(document,"mousemove",this.headMouseMoveEvent);Zhishi.Event.removeEventListener(document,"mouseup",this.headMouseUpEvent);this.stopDefaultEvent(a)};Zhishi.LayerBase.prototype.stopDefaultEvent=function(a){a=a||window.event;a.returnValue=false;if(a.preventDefault){a.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 b=this.maskObj;var a=this.mainObj;b.style.left="0px";b.style.top="0px";b.style.width="100%";b.style.height="100%";if(Zhishi.Browser.isIE6||document.compatMode!="CSS1Compat"){b.style.width=Zhishi.Size.getScrollSize()[2]+"px";b.style.height=Zhishi.Size.getScrollSize()[3]+"px"}var d=Zhishi.Size.getScrollSize()[1]+125;var c=Zhishi.Size.getScrollSize()[1]+(Zhishi.Size.getClientSize()[1]-this.height)/2;if(this.top){d=Zhishi.Size.getScrollSize()[1]+this.top;c=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=d+"px";if(this.height>400){this.backIframeObj.style.top=c+"px"}}a.style.left=(Zhishi.Size.getScrollSize()[0]+(Zhishi.Size.getClientSize()[0]-this.width)/2)+"px";a.style.top=d+"px";if(this.height>400){a.style.top=c+"px"}};Zhishi.LayerBase.prototype.setPosition=function(){var b=this.maskObj;var a=this.mainObj;var c=this.headObj;var g=Zhishi.Size.getScrollSize()[1]+125;var f=Zhishi.Size.getScrollSize()[1]+(Zhishi.Size.getClientSize()[1]-this.height)/2;if(this.top){g=Zhishi.Size.getScrollSize()[1]+this.top;f=Zhishi.Size.getScrollSize()[1]+this.top}b.style.left="0px";b.style.top="0px";b.style.width="100%";b.style.height="100%";if(Zhishi.Browser.isIE6||document.compatMode!="CSS1Compat"){b.style.width=this.oldSize[2]+"px";b.style.height=this.oldSize[3]+"px"}if(Zhishi.Browser.isIE6){var d=this.backIframeObj;d.style.left=(Zhishi.Size.getScrollSize()[0]+(Zhishi.Size.getClientSize()[0]-this.width)/2)+"px";d.style.top=g+"px";if(this.height>400){d.style.top=f+"px"}if(Zhishi.Browser.isFirefox){d.style.height=this.height+9+"px"}else{d.style.height=this.height+2+"px"}d.style.width=this.width+2+"px"}a.style.left=(Zhishi.Size.getScrollSize()[0]+(Zhishi.Size.getClientSize()[0]-this.width)/2)+"px";a.style.top=g+"px";if(this.height>400){a.style.top=f+"px"}a.style.height=this.height+"px";a.style.width=this.width+"px";c.style.width=this.width+"px"};Zhishi.LayerBase.prototype.createUI=function(){var c=document.createElement("div");c.style.position="fixed";if(Zhishi.Browser.isIE6||document.compatMode!="CSS1Compat"){c.style.position="absolute"}c.className=this.maskClass;this.setOpacity(c,this.maskOpacity);var a=document.createElement("div");a.style.position="absolute";a.className=this.mainClass;var b=document.createElement("div");var d=document.createElement("div");d.style.width=this.width+"px";d.style.height=this.headHeight+"px";d.className=this.headClass;var g=document.createElement("span");g.className="layer_title";g.innerHTML=this.title;g.setAttribute("style","height:"+(this.headHeight-2)+"px;line-height:"+(this.headHeight-2)+"px;");d.appendChild(g);a.appendChild(d);a.appendChild(b);document.body.appendChild(c);document.body.appendChild(a);if(Zhishi.Browser.isIE6){var f=document.createElement("iframe");f.style.position="absolute";f.className=this.backIframeClass;f.setAttribute("scrolling","no");f.setAttribute("frameborder","0",0);this.setOpacity(f,this.borderOpacity);document.body.appendChild(f);this.backIframeObj=f}this.maskObj=c;this.containerObj=b;this.mainObj=a;this.headObj=d};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 b=document.createElement("a");b.href="javascript:void(0)";b.onclick=this.close.bind(this);b.title="\u5173\u95ed";b.className=this.closeLinkClass;var a=document.createElement("span");a.className="layer_close";a.setAttribute("style","height:"+(this.headHeight-9)+"px;line-height:"+(this.headHeight-9)+"px;");a.appendChild(b);this.headObj.appendChild(a)};Zhishi.LayerBase.prototype.appendBottomBorder=function(){var a=document.createElement("div");a.className=this.headBottomHrClass;this.headObj.appendChild(a)};Zhishi.LayerBase.prototype.onClose=null;Zhishi.LayerBase.prototype.afterClose=function(){};Zhishi.LayerBase.prototype.close=function(){if(this.onClose==null){Zhishi.resumeWindowCloseEvent();this.removeEvent();this.removeUI();this.afterClose()}else{if(this.onClose!=null&&this.onClose()){Zhishi.resumeWindowCloseEvent();this.removeEvent();this.removeUI();this.afterClose()}}Zhishi.isDialogAlive=false};Zhishi.LayerBase.prototype.setOpacity=function(a,b){if(Zhishi.Browser.isIE){a.style.filter="alpha(opacity="+parseFloat(b)+")"}else{a.style.opacity=parseFloat(b)/100}};Zhishi.Dialog=function(g,d,c,b,f,a){Zhishi.LayerBase.call(this,g,c,d,a);this.iframe=document.createElement("iframe");this.iframe.setAttribute("scrolling","no");this.iframe.setAttribute("frameborder","0",0);this.isFrame=b||false;this.value=f||""};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(f,b){if(Zhishi.Browser.isIE6){var g=this.backIframeObj}var d=this.iframe;var a=this.mainObj;var c=this.headObj;if(Zhishi.Browser.isFirefox){if(Zhishi.Browser.isIE6){g.style.height=9+b+"px"}d.style.height=9+b-35+"px"}else{if(Zhishi.Browser.isIE6){g.style.height=2+b+"px"}d.style.height=2+b-35+"px"}if(Zhishi.Browser.isIE6){g.style.width=f+"px"}d.style.width=f+"px";a.style.height=b+"px";a.style.width=f+"px";c.style.width=f+"px";this.height=b;this.width=f};Zhishi.Effect=function(g,d,a,c,f){this.obj=get(g);this.isColor=/^#/.test(a);this.prop=d;var b=/\d+([a-z%]+)/i.exec(a);this.suffix=b?b[1]:"";this.startValue=this.isColor?0:parseFloat(a);this.finishValue=this.isColor?100:parseFloat(c);if(this.isColor){this.startColor=this.convertHexColor(a);this.finishColor=this.convertHexColor(c)}this.duration=f||10;this.startTime=0;this.currentValue=0;this.changeValue=this.finishValue-this.startValue;this.isPlayed=false};Zhishi.Effect.prototype.fun=function(d,a,b,c){return b*d/c+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(c){var b=false;if(c>this.duration){c=this.duration;b=true}var a=this.fun(c,this.startValue,this.changeValue,this.duration);this.currentValue=/(opacity)/i.test(this.prop)?a:Math.round(a);if(this.isColor){this.currentValue=this.getColor(this.startColor,this.finishColor,a)}this.obj.setStyle(this.prop,this.currentValue+this.suffix);if(b){this.isPlayed=false;if(window.CollectGarbage){CollectGarbage()}}};Zhishi.Effect.prototype.runTime=function(){var a=this;if(a.isPlayed){a.playTime((new Date().getTime()-this.startTime)/1000);setTimeout(function(){a.runTime.apply(a)},0)}};Zhishi.Effect.prototype.getColor=function(g,b,f){var h=g;var d=b;var a=[];if(f>100){f=100}if(f<0){f=0}for(var c=0;c<3;c++){a[c]=Math.floor(h[c]*1+(f/100)*(d[c]-h[c])).toString(16);if(a[c].length<2){a[c]="0"+a[c]}}return"#"+a.join("")};Zhishi.Effect.prototype.simpleFun=function(d,a,b,c){return b*d/c+a};Zhishi.Effect.prototype.convertHexColor=function(d){d=/^#/.test(d)?d.substr(1):d;var c=new RegExp("\\w{2}","ig");d=d.match(c);if(!d||d.length<3){return[0,0,0]}var h=parseInt(d[0],16);var f=parseInt(d[1],16);var a=parseInt(d[2],16);return[h,f,a]};Zhishi.Tween={Linear:function(f,a,h,g){return h*f/g+a},Quad:{easeIn:function(f,a,h,g){return h*(f/=g)*f+a},easeOut:function(f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOut:function(f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a}},Cubic:{easeIn:function(f,a,h,g){return h*(f/=g)*f*f+a},easeOut:function(f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOut:function(f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a}},Quart:{easeIn:function(f,a,h,g){return h*(f/=g)*f*f*f+a},easeOut:function(f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOut:function(f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a}},Quint:{easeIn:function(f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOut:function(f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOut:function(f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a}},Sine:{easeIn:function(f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOut:function(f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOut:function(f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a}},Expo:{easeIn:function(f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOut:function(f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOut:function(f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a}},Circ:{easeIn:function(f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOut:function(f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOut:function(f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a}},Elastic:{easeIn:function(h,f,m,l,g,k){if(h==0){return f}if((h/=l)==1){return f+m}if(!k){k=l*0.3}if(!g||g<Math.abs(m)){g=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*l-j)*(2*Math.PI)/k))+f},easeOut:function(h,f,m,l,g,k){if(h==0){return f}if((h/=l)==1){return f+m}if(!k){k=l*0.3}if(!g||g<Math.abs(m)){g=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/g)}return(g*Math.pow(2,-10*h)*Math.sin((h*l-j)*(2*Math.PI)/k)+m+f)},easeInOut:function(h,f,m,l,g,k){if(h==0){return f}if((h/=l/2)==2){return f+m}if(!k){k=l*(0.3*1.5)}if(!g||g<Math.abs(m)){g=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*l-j)*(2*Math.PI)/k))+f}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*l-j)*(2*Math.PI)/k)*0.5+m+f}},Back:{easeIn:function(f,a,j,h,g){if(g==undefined){g=1.70158}return j*(f/=h)*f*((g+1)*f-g)+a},easeOut:function(f,a,j,h,g){if(g==undefined){g=1.70158}return j*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOut:function(f,a,j,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return j/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return j/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a}},Bounce:{easeIn:function(f,a,h,g){return h-Zhishi.Tween.Bounce.easeOut(g-f,0,h,g)+a},easeOut:function(f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOut:function(f,a,h,g){if(f<g/2){return Zhishi.Tween.Bounce.easeIn(f*2,0,h,g)*0.5+a}else{return Zhishi.Tween.Bounce.easeOut(f*2-g,0,h,g)*0.5+h*0.5+a}}}};Zhishi.Login={loginList:[],callBackObj:"",loginDialog:null,loginNavIds:["s_user"],q_bInit:false,q_type:0,q_hummerQtrl:null,g_vOptData:null,q_aUinList:new Array(),hummer_loaduin:function(){Zhishi.Login.q_aUinList.length=0;var g=Zhishi.Login.q_hummerQtrl.DoOperation(1,Zhishi.Login.g_vOptData);if(null==g){return}try{var k=g.GetArray("PTALIST");var b=k.GetSize();var h="";var s=document.getElementById("list_uin");for(var a=0;a<b;a++){var v=k.GetData(a);var d=v.GetDWord("dwSSO_Account_dwAccountUin");var r="";var c="";try{r=v.GetArray("SSO_Account_AccountValueList");c=r.GetStr(0)}catch(f){c=0}var m=0;try{m=v.GetWord("wSSO_Account_wFaceIndex")}catch(f){m=0}var l="";try{l=v.GetStr("strSSO_Account_strNickName")}catch(f){l=""}var o=0;try{o=v.GetByte("cSSO_Account_cGender")}catch(f){o=0}var n=0;try{n=v.GetDWord("dwSSO_Account_dwUinFlag")}catch(f){n=0}var u=v.GetBuf("bufGTKey_PTLOGIN");var t=v.GetBuf("bufST_PTLOGIN");var p="";var x=t.GetSize();for(var j=0;j<x;j++){var w=t.GetAt(j).toString("16");if(w.length==1){w="0"+w}p+=w}var q={uin:d,name:c,face:m,nick:l,gender:o,key:p};Zhishi.Login.q_aUinList[a]=q}}catch(f){}},ptui_qInit:function(){if(Zhishi.Login.q_bInit){return}Zhishi.Login.q_bInit=true;if(!window.ActiveXObject){return}try{Zhishi.Login.q_hummerQtrl=new ActiveXObject("SSOAxCtrlForPTLogin.SSOForPTLogin");var a=Zhishi.Login.q_hummerQtrl.CreateTXSSOData();Zhishi.Login.q_hummerQtrl.InitSSOFPTCtrl(0,a);Zhishi.Login.g_vOptData=Zhishi.Login.q_hummerQtrl.CreateTXSSOData()}catch(b){Zhishi.Login.q_hummerQtrl=null}if(Zhishi.Login.q_hummerQtrl!=null){Zhishi.Login.q_type=2;Zhishi.Login.hummer_loaduin();if(Zhishi.Login.q_aUinList.length>0){return}}if(Zhishi.Login.q_hummerQtrl!=null){Zhishi.Login.q_type=2}},isSupportLogin:function(){Zhishi.Login.ptui_qInit();if(0==Zhishi.Login.q_type){return false}if(2==Zhishi.Login.q_type&&Zhishi.Login.q_aUinList.length<=0){return false}return true},getElements:function(){var a=[];Zhishi.Login.pushElements("input",a);Zhishi.Login.pushElements("button",a);Zhishi.Login.pushElements("a",a);return a},pushElements:function(a,c){var d=document.getElementsByTagName(a);for(var b=0;b<d.length;b++){if((" "+d[b].className+" ").indexOf(" login_require ")!=-1){c.push(d[b])}}},init:function(a){var h=Zhishi.Cookie.getCookie("hasLogOut");if(Zhishi.isLogin=="0"&&Zhishi.Login.isSupportLogin()&&(h==null||h=="")){var j=Zhishi.Login.q_aUinList;if(j&&j.length==1){var c=document.location.href;if(c.indexOf("pid=")==-1){c+=c.indexOf("?")==-1?"?":"&";c+="pid=wenwen.autologin"}Zhishi.Cookie.setCookie("oneKeyUrl",c,1);Zhishi.Cookie.setCookie("hasLogOut","1");var f="http://ptlogin2.soso.com/wenwen_clientJump?clientuin="+j[0].uin+"&clientkey="+j[0].key+"&keyindex=9";document.location.href=f}}a=a||"s_user";if(a){Zhishi.Login.loginNavIds.push(a)}var b=Zhishi.Login.getElements();for(var d=0;d<b.length;d++){var g=b[d];if(g.onclick){Zhishi.Login.loginList[d]=g.onclick}else{if(g.tagName.toLowerCase()=="a"){Zhishi.Login.loginList[d]=g.href;g.href="#"}}g.setAttribute("wenwenid",d);g.onclick=Zhishi.Login.newMethod;g.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(c){var d="",b=Zhishi.Login.loginNavIds;for(var a=0;a<b.length;a++){if(get(b[a])!=null){d=b[a];break}}if(d!=""){get(d).innerHTML=c}},newMethod:function(){var a=Zhishi.Browser.isIE?event.srcElement:arguments[0].target;while(a.parentNode){if(a.tagName!="A"&&a.tagName!="BUTTON"&&a.tagName!="INPUT"){a=a.parentNode}else{break}}var b={onSuccess:Zhishi.Login.checkLogin,para:a};Zhishi.Ajax.sendRequest("GET",Zhishi.loginStateUrl,b)},execOldMethod:function(a){var b=Zhishi.Login.loginList[a.getAttribute("wenwenid")];if(a.tagName.toLowerCase()=="input"||typeof b=="function"){b()}else{if(b){document.location=b}}},checkLogin:function(a,b){if(a=="1"){Zhishi.Login.execOldMethod(b)}else{if(a=="0"){Zhishi.Login.openLoginDialog(b)}}},openLoginDialog:function(a,c){this.callBackObj=a?a:this.callBackObj;var b=290;if(Zhishi.popLoginUrl.indexOf(Zhishi.ptLoginUrl)>=0){var f=Zhishi.popLoginUrl}else{var f=Zhishi.ptLoginUrl+Zhishi.popIframeUrlFix+encodeURIComponent(Zhishi.popLoginUrl)}if(c!=null&&c==true&&Zhishi.Login.isSupportLogin()){b=310;f+="&qlogin_jumpname=wenwen_clientJump"}var d=Zhishi.Browser.isIE?373:371;if(Zhishi.Browser.isFirefox){b=280}else{if(Zhishi.Browser.isOpera){b=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,b,true,f);Zhishi.Login.loginDialog.show()},loginLink:function(){Zhishi.Login.rememberSearchWord();var a=document.location.href;if(a.indexOf("pid=")==-1){a+=a.indexOf("?")==-1?"?":"&";a+="pid=wenwen.fastlogin"}Zhishi.Cookie.setCookie("oneKeyUrl",a,1);Zhishi.Ajax.sendRequest("GET",Zhishi.loginStateUrl,{onSuccess:Zhishi.Login.doLoginForOnekey})},doLogin:function(a){Zhishi.Login.rememberSearchWord();if(a=="1"){document.location.reload()}else{if(a=="0"){Zhishi.Login.openLoginDialog()}}},doLoginForOnekey:function(a){if(a=="1"){document.location.reload()}else{if(a=="0"){Zhishi.Login.openLoginDialog(null,true)}}},rememberSearchWord:function(){if($("sb")&&$("sb").value!=""){Zhishi.Cookie.setCookie("searchWord",$("sb").value)}},logout:function(a){Zhishi.Cookie.setCookie("hasLogOut","1");Zhishi.Login.rememberSearchWord();document.location=a},autoCloseLoginDialog:function(){Zhishi.Login.loginDialog.close();var c=Zhishi.Login.callBackObj;if(c){var f="",b=Zhishi.Login.loginNavIds;for(var a=0;a<b.length;a++){if(get(b[a])!=null){f=b[a];break}}var d=Zhishi.Login.loginList[c.getAttribute("wenwenid")];if(typeof d!="function"&&d){document.location=d}else{if((" "+Zhishi.Login.callBackObj.className+" ").indexOf(" login_norefresh ")==-1&&(" "+get(f).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(g,b,a,c){var d=get(a),f=b;if(get(g).value!=c){f-=get(g).value.length}if(f>=0){d.removeClassName("error red");d.innerHTML="\u8fd8\u53ef\u4ee5\u8f93\u5165<b>"+f+"</b>\u4e2a\u5b57"}else{d.addClassName("error red");d.innerHTML="\u5df2\u8d85\u8fc7\u4e0a\u9650<b>"+(0-f)+"</b>\u4e2a\u5b57，\u8bf7\u5220\u51cf！"}}};Zhishi.Tool={};Zhishi.Tool.InputHelp={_inputId:"",_message:"",_messageClassName:"",startT:function(a,c,b){this._inputId=a?a:this._inputId;this._message=c?c:"";this._messageClassName=b?b:"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 a=document.createElement("div");a.id="WenwenTipId";a.innerHTML=Zhishi.Tool.InputHelp._message;document.body.appendChild(a)},setT:function(){var k=get(Zhishi.Tool.InputHelp._inputId),h=get("WenwenTipId");h.style.position="absolute";h.className=Zhishi.Tool.InputHelp._messageClassName;var g=k.style.padding?parseInt(k.style.padding):0;var c=k.style.margin?parseInt(k.style.margin):0;if(Zhishi.Browser.isIE){var d=0,j=0,a=k;while(a!=null&&a!=document.body){d+=a.offsetLeft;j+=a.offsetTop;parseInt(a.currentStyle.borderLeftWidth)>0?d+=parseInt(a.currentStyle.borderLeftWidth):"";parseInt(a.currentStyle.borderTopWidth)>0?j+=parseInt(a.currentStyle.borderTopWidth):"";a=a.offsetParent}var b=d+g+4,f=j+g}else{var b=k.offsetLeft+g+4,f=k.offsetTop+g}if(k.tagName.toLowerCase()=="textarea"){b+=4;f+=4}if(k.tagName.toLowerCase()=="input"){f+=(k.offsetHeight-c-g-h.scrollHeight)/2}h.style.left=b+"px";h.style.top=f+"px";h.onclick=Zhishi.Tool.InputHelp.stopT;k.onblur=Zhishi.Tool.InputHelp.startT;k.onfocus=Zhishi.Tool.InputHelp.stopT},stopT:function(){try{document.body.removeChild(get("WenwenTipId"));get(Zhishi.Tool.InputHelp._inputId).focus()}catch(a){}}};function smartboxInit(a){Zhishi.oldSearchText="";Zhishi.searchOldTime=-1;Zhishi.Event.attachEventListener(document,"click",hideSb);Zhishi.g_msg=[];Zhishi.jsAutoInstance=new jsAuto("Zhishi.jsAutoInstance","divc",a)}function withRefererRedirect(c){if(Zhishi.Browser.isIE||Zhishi.Browser.isOpera){var b=document.createElement("a");b.href=c;document.body.appendChild(b);b.click()}else{document.location=c}}function hideSb(){Zhishi.jsAutoInstance._o.style.visibility="hidden";Zhishi.jsAutoInstance._o.style.height="2px";Zhishi.jsAutoInstance._f=false}function onSuggest(a,c){if(a.length<=1){Zhishi.g_msg=[]}else{Zhishi.g_msg=a.replace(/(^\s*)|(\s*$)/g,"").split("\n");if(Zhishi.Browser.isFirefox){Zhishi.g_msg[Zhishi.g_msg.length-1]=Zhishi.g_msg[Zhishi.g_msg.length-1].replace(/\0/g,"")}}try{Zhishi.jsAutoInstance.handleEvent(get(c).value.trim(),c,g_event)}catch(b){}}function userControl(a,c,b){var b=b?b:window.event;g_event=b.keyCode?b.keyCode:b.which;if(g_event!=40&&g_event!=38){return}Zhishi.jsAutoInstance.directionKey()}function userInput(a,f,c){var b=(new Date()).getTime();if(a.replace(/\s/g,"")==""){Zhishi.jsAutoInstance.handleEvent("",0,g_event);return}if(Zhishi.searchOldTime==-1||(b-Zhishi.searchOldTime>200&&(g_event>40||g_event<37))){var c=c?c:window.event;g_event=c.keyCode?c.keyCode:c.which;Zhishi.searchOldTime=(new Date()).getTime();if(a.replace(/\s/g,"")==""){Zhishi.jsAutoInstance.handleEvent("",0,g_event);return}if(g_event!=40&&g_event!=38&&g_event!=27){Zhishi.oldSearchText=get(f).value.trim()}var d=siteBaseUrl+"SmartBox.e?sp=S"+encodeURIComponent(Zhishi.oldSearchText);Zhishi.Ajax.sendRequest("GET",d,{onSuccess:onSuggest,cacheTime:600,para:f})}}function jsAuto(a,b,c){this._msg=[];this._x=null;this._o=get(b);if(!this._o){return}this._f=false;this._i=a;this._fid=c;this._r=get(c);this._c=-1;this._v=null;this._e=0;return this}jsAuto.prototype.directionKey=function(){with(this){if(_o.style.visibility=="hidden"&&_r.value!=""){_i.showBox();if(document.flpage.w.value!=Zhishi.oldSearchText){for(var i=0;i<Zhishi.g_msg.length;i++){var text=Zhishi.g_msg[i].split(",")[1];if(text==document.flpage.w.value){_c=i;document.flpage.w.value=_x[_c];_o.childNodes[_c].className="sb_mouseover";document.flpage.w.focus()}}}}else{if(_o.childNodes.length<1){return}var e=g_event;var l=_o.childNodes.length-1;if(e==40){if(_c>=0||_c==l){_o.childNodes[_c].className="sb_mouseout"}_c++;if(_c>=0&&_c<l+1){_o.childNodes[_c].className="sb_mouseover";document.flpage.w.value=_x[_c]}else{if(_c==l+1){_c=-1;document.flpage.w.value=Zhishi.oldSearchText}}}else{if(e==38){if(_c==-1){_c=_o.childNodes.length}if(_c<l||_c==l){_o.childNodes[_c].className="sb_mouseout"}_c--;if(_c>=0){_o.childNodes[_c].className="sb_mouseover";document.flpage.w.value=_x[_c]}else{if(_c==-1){document.flpage.w.value=Zhishi.oldSearchText}}}}document.flpage.w.focus()}}};jsAuto.prototype.domouseover=function(a){a.tagName=="DIV"?a.className="sb_mouseover":a.parentElement.className="sb_mouseover"};jsAuto.prototype.domouseout=function(a){a.tagName=="DIV"?a.className="sb_mouseout":a.parentElement.className="sb_mouseout"};jsAuto.prototype.doclick=function(c){if(this._r){var a=siteBaseUrl;a+="Search.e?sp=S";var b=document.flpage;a+=encodeURIComponent(c)+"&pid=ask.smb";withRefererRedirect(a)}};jsAuto.prototype.append=function(msg){with(this){_i?"":_i=eval(_i);var div=document.createElement("DIV");div.style.lineHeight="175%";div.className="sb_mouseout";info=msg.split(",");if(!info||info.length<3){return}num=info[0];if(num!=null&&num.indexOf("|")>=0){var patt=/(\|+)/g;num=num.replace(patt,",")}var word=info[1];var len=info.length;if(len>3){for(var ii=2;ii<len-1;ii++){word+=","+info[ii]}}var flag=eval(info[info.length-1]);_x.push(word);var word2=word.replace(/&/gi,"&amp;");word2=word2.replace(/</gi,"&lt;");word2=word2.replace(/>/gi,"&gt;");word2=word2.replace(Zhishi.oldSearchText,"<b>"+Zhishi.oldSearchText+"</b>");lv=_v.toLowerCase();msg="<li class='sb_itemLeft'>"+((flag==0)?word2:('<span class="sb_zd">'+word2+'&nbsp;<img src="http://cache.soso.com/img/sb0.gif" align="absmiddle"></img></span>'))+"</li><li class='sb_itemRight'>"+num+((flag!=0)?"":"&nbsp;\u7ed3\u679c")+"</li><br />";if(_v){div.innerHTML=msg}div.style.fontFamily="verdana";div.onmouseover=function(){_i.domouseover(this)};div.onmouseout=function(){_i.domouseout(this)};div.onclick=function(){_i.doclick(word)};_o.appendChild(div);this._o.style.height=parseInt(this._o.style.height)+21}};jsAuto.prototype.handleEvent=function(fValue,fID,event){with(this){var e=event;_v=fValue;_i=eval(_i);if(e==27){_r.value=Zhishi.oldSearchText;_o.innerHTML="";_o.style.height="2px";_o.style.visibility="hidden";return}if(e==38||e==40||e==13){if(_o.style.visibility=="hidden"){_i.showBox()}return}_i.showBox()}};jsAuto.prototype.showBox=function(){with(this){_c=-1;_x=[];_o.innerHTML="";_o.style.height="2";_f=false;for(var i=0;i<Zhishi.g_msg.length;i++){_i.append(Zhishi.g_msg[i]);_f=true}if((_f&&_v!="")||_e==-1){var l=_r.offsetLeft;var t=_r.offsetTop+_r.offsetHeight;_o.style.width=_r.offsetWidth-2+"px";var tmp=_r;while(tmp=tmp.offsetParent){l+=tmp.offsetLeft;t+=tmp.offsetTop}_o.style.left=l+"px";_o.style.top=t+"px";_o.style.height=_o.childNodes.length*21+"px";_o.style.visibility="visible"}else{_o.style.visibility="hidden"}}};function ctrlSubmit(a,b){if(b.ctrlKey&&(b.keyCode==13)){document.getElementById(a).click()}}function setTab(name,itemCnt,curItem,classHide,classShow){for(i=1;i<=itemCnt;i++){eval("document.getElementById('tab_"+name+"_"+i+"').className='"+classHide+"'")}eval("document.getElementById('tab_"+name+"_"+curItem+"').className='"+classShow+"'");for(i=1;i<=itemCnt;i++){eval("ele_hide = document.getElementById('con_"+name+"_"+i+"')");if(ele_hide){ele_hide.style.display="none"}}eval("ele_play = document.getElementById('con_"+name+"_"+curItem+"')");if(ele_play){ele_play.style.display="block"}}function isEmpty(a){return(a==null)||(a.length==0)}function searchAnswer(a){var b=a.value.trim();return !isEmpty(b)}var importFriendDialog=null;var questionOperateDialog=null;function checkKey(a,b){if(b.keyCode==13){if(searchAnswer(a)){window.location.href=search_url+encodeURIComponent(a.value)}else{window.location.reload()}return false}return true}function redirectToOthers(b){var a=document.forms[0].w.value;if(a!=null){window.location.href=siteBaseUrl+"Portal.htm?t=60&r="+encodeURIComponent(b.href)+"&w="+encodeURIComponent(a)}}function redirectToOthersNoEncode(b){var a=document.forms[0].w.value;if(a!=null){window.location.href=b.href+encodeURIComponent(a)}}function redirectSearch(a,b){if(b){if(!a.empty()){window.location.href=siteBaseUrl+"Search.e?sp=S"+encodeURIComponent(a)+"&ch=k2"}else{window.location.reload()}}else{window.location.href=siteBaseUrl+"AskQuestionConfirm.e?sp=0&sp=S"+encodeURIComponent(a)+"&ch=k1"}}function redirectSearch4Form(h){var d=h.w.value.trim();if(d==""){window.location.reload();return false}else{var g="";try{if(search_solved_url){g=search_solved_url.replace(/\?.*/gi,"")}}catch(j){g="/z/Search.e"}if(Zhishi.Browser.isIE||Zhishi.Browser.isOpera){var b=document.createElement("a");b.href=g+"?sp=S"+encodeURIComponent(d);var c=get("sb");c.parentNode.appendChild(b);b.click();return false}else{h.action=g;h.sp.value="S"+d;return true}}}function redirectForAsk(a,d){var c=a.value.trim();var b="";if(c.empty()){b=siteBaseUrl+"AskQuestionForTitle.e?sp=0&ch="+pageId}else{var f=siteBaseUrl+"AskQuestionConfirm.e?sp=0&sp=S"+encodeURIComponent(c)+"&ch="+pageId;if(!d){f+="&ch=k9"}b=f}withRefererRedirect(b)}function alertExpert(){setTimeout(function(){var a=new Zhishi.Dialog("\u56fe\u6807\u8bf4\u660e",380,240,true,"http://cache.soso.com/wenwen/help_sw_new3.htm");a.show()},0)}function redirectAskWithParam(d,f){var h=d.value.trim();var g="";if(f==null){f=""}if(isEmpty(h)){var c=ask_for_title_url+"&ch="+f;g=c}else{var c=ask_url+encodeURIComponent(h)+"&ch="+f;g=c}if(Zhishi.Browser.isIE||Zhishi.Browser.isOpera){var b=document.createElement("a");b.href=g;document.body.appendChild(b);b.click()}else{document.location=g}}function redirectSearch4FormWithParam(k,h){var j="";try{if(search_solved_url){j=search_solved_url.replace(/\?.*/gi,"")}}catch(l){j="/z/Search.e"}var d=k.znInput.value.trim();var g=h==null?"":h;if(d==""){window.location.reload();return false}else{if(Zhishi.Browser.isIE||Zhishi.Browser.isOpera){var b=document.createElement("a");b.href=j+"?sp=S"+encodeURIComponent(d)+"&ch="+g;var c=get("sb");c.parentNode.appendChild(b);b.click();return false}else{k.action=j;k.sp.value="S"+d;k.ch.value=g;return true}}}function mark(c,l,h){var g=c.childNodes;var j=null;if(!g||!g.length){return}for(var d=0;d<g.length;d++){j=null;if(g[d].tagName=="A"){if(l&&g[d].setAttribute){var a=g[d].href;var k=a.indexOf("?")<0?"?":"&";var f="";if(a.indexOf("#")>-1){f=a.substring(a.indexOf("#"),a.length);a=a.substring(0,a.indexOf("#"))}var b=g[d].innerHTML;if(h=="pid"){g[d].href=a+k+"pid="+l+f}if(h=="ch"){g[d].href=a+k+"ch="+l+f}if(h=="cid"){g[d].href=a+k+"cid="+l+f}g[d].innerHTML=b}}else{if(typeof g[d]!="null"){if(document.all&&g[d].ch){j=g[d].ch;h="ch"}else{if(document.all&&g[d].pid){j=g[d].pid;h="pid"}else{if(document.all&&g[d].cid){j=g[d].cid;h="cid"}else{if(navigator.userAgent.toLowerCase().search("msie")<0&&g[d].getAttribute){if(g[d].getAttribute("ch")){j=g[d].getAttribute("ch");h="ch"}if(g[d].getAttribute("pid")){j=g[d].getAttribute("pid");h="pid"}if(g[d].getAttribute("cid")){j=g[d].getAttribute("cid");h="cid"}}}}}if(j){mark(g[d],j,h)}else{mark(g[d],l,h)}}}}}function focus_input(a){if(!a||a.disabled){return true}else{a.select();return false}}function aboutSpecialty(){setTimeout(function(){var a=new Zhishi.Dialog("\u56fe\u6807\u8bf4\u660e",380,240,true,"http://cache.soso.com/wenwen/help_sw_new3.htm");a.show()},0)}function importQQFriend(){importFriendDialog=new Zhishi.Dialog("\u6dfb\u52a0\u597d\u53cb",390,450,true,"MyFriendImportNew.htm");importFriendDialog.afterClose=function(){document.location.reload()};importFriendDialog.show()}function questionOperate(b,d,c,a){questionOperateDialog=new Zhishi.Dialog(d,c,a,true,b);questionOperateDialog.afterClose=function(){document.location.reload()};questionOperateDialog.show()}function splitResNum(h){var g=h.toString();var a=g.length;if(a<4){document.write(g);return}var f=a/3;var c=Math.floor(f);var b=a%3;res="";if(b==0){b=3;c=c-1}res+=g.substr(0,b)+","+g.substr(b,3);for(var d=1;d<c;d++){res+=","+g.substr(b+d*3,3)}document.write(res)}function addFavourite(a){Zhishi.Ajax.sendRequest("GET",a+"&r="+Math.random(),{onSuccess:function(b){alert(b);window.location.reload()}})}function expandUser(k){if(k){var h=k.id;var f=document.getElementById(h);var j=h.charAt(h.length-1);var a=j+j;var b;var c;if(h.indexOf(a)>-1){b=h.substring(0,h.length-1);c=document.getElementById(b)}else{b=h+j;c=document.getElementById(b)}var g=f.style.display;var d=c.style.display;f.style.display=d;c.style.display=g}}function WenwenAjaxEvent(b,a,c){this.url=b;this.cbh=(a==null||typeof a=="undefined")?this.defaultCbHandler:a;this.async=(c==null||typeof c=="undefined")?false:c;this.errMsg="[-1, '\u64cd\u4f5c\u672a\u80fd\u6210\u529f，\u8bf7\u91cd\u8bd5！']"}WenwenAjaxEvent.prototype.setUrl=function(a){this.url=a};WenwenAjaxEvent.prototype.setCbh=function(a){this.cbh=a};WenwenAjaxEvent.prototype.setAsync=function(a){this.async=a};WenwenAjaxEvent.prototype.defaultCbHandler=function(rstMsg){var rsp=null;try{rsp=eval(rstMsg)}catch(e){rsp=eval(this.errMsg)}if(rsp!=null){var code=rsp[0];var msg=rsp[1];alert(msg);window.location.reload()}};WenwenAjaxEvent.prototype.getXmlHttp=function(){var a=null;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){a=null}}if(!a&&typeof XMLHttpRequest!="undefined"){try{a=new XMLHttpRequest()}catch(c){a=null}}if(!a&&window.createRequest){try{a=window.createRequest()}catch(c){a=null}}return a};WenwenAjaxEvent.prototype.notify=function(){var b=this.getXmlHttp();if(!b){this.cbh(this.errMsg);return}b.open("GET",this.url+(this.url.indexOf("?")<0?"?":"&")+"r="+Math.random(),this.async);if(this.async){var a=this;b.onreadystatechange=function(){if(b.readyState==4&&b.status==200){a.cbh(b.responseText)}}}b.send(null);if(!this.async){this.cbh(b.responseText)}};var Wenwen=new Object();Wenwen.defaultHttpRequest=function(a){Wenwen.syncHttpRequest(a)};Wenwen.syncHttpRequest=function(a,b){var c=new WenwenAjaxEvent(a,b);c.notify()};Wenwen.asyncHttpRequest=function(a,b){var c=new WenwenAjaxEvent(a,b,true);c.notify()};Wenwen.openWindow=function(c,j,b,f,a,d){var g=window.open(c,j,"scrollbars=yes,width="+b+",height="+f+",left="+a+",top="+d);if(g.focus){g.focus()}};if(Zhishi.Browser.isIE){document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");var script=document.getElementById("__ie_onload");script.onreadystatechange=function(){if(this.readyState=="complete"){Zhishi.Event.fireDomReady()}}}else{if(Zhishi.Browser.isWebKit){var _timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(_timer);Zhishi.Event.fireDomReady()}},10)}else{document.addEventListener("DOMContentLoaded",Zhishi.Event.fireDomReady,false)}};
