function $(a){return document.getElementById(a);}update=function(b,a){$(b).innerHTML=a;};function getElementsByClassName(k,g){var c=$(g)||document;var d=c.getElementsByTagName("*");var h=new Array();for(var f=0;f<d.length;f++){var b=d[f];var a=b.className.split(" ");for(var e=0;e<a.length;e++){if(a[e]==k){h.push(b);break;}}}return h;}function objGetClass(b){var a=b.getAttribute("className");if(!a){a=b.getAttribute("class");}return a;}function addLoadEvent(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a;}else{window.onload=function(){b();a();};}}function StringTrim(a){return a.replace(/(^\s*)|(\s*$)/g,"");}ajax=function(a,e,d,c,b){this.url=a;this.postback=e;this.params=c;this.xmlHttpRequest=null;this.method=d;this.format=b;this.getDocument(a);};ajax.prototype={createXMLHttpRequest:function(){if(typeof XMLHttpRequest!="undefined"){this.xmlHttpRequest=new XMLHttpRequest();}else{if(typeof ActiveXObject!="undefined"){var c=["Microsoft.XMLHTTP","MSXML.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.7.0","Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"];for(var a=0;a<c.length;a++){try{this.xmlHttpRequest=new ActiveXObject(c[a]);break;}catch(b){}}}else{return this.xmlHttpRequest;}}},getDocument:function(a){this.createXMLHttpRequest();if(this.xmlHttpRequest){try{this.xmlHttpRequest.open(this.method,a,true);var c=this;this.xmlHttpRequest.onreadystatechange=function(){c.onReadyState();};this.xmlHttpRequest.send(this.params);}catch(b){}}},onReadyState:function(){if(this.xmlHttpRequest.readyState==4){if(this.xmlHttpRequest.status==200||this.xmlHttpRequest.status==0){reuqest=this.xmlHttpRequest.responseText;if(this.format=="json"){var json=eval("("+reuqest+")");this.postback(json);}else{this.postback(reuqest);}}}}};function ajaxUpdater(d,b){var a=function(e){$(d).innerHTML=e;};var c=new ajax(b,a,"get","");}function ajaxRequest(c,b,f,a,e){var d=new ajax(c,b,f,a,e);}function stateHtml(b,a){return'<div class="'+b+'">'+a+"</div>";}function getUrlParms(e,b){var d=b.substr(b.indexOf("?")+1);var f=d.split("&");var a;var c="";for(i in f){a=f[i].split("=")[0];c=f[i].split("=")[1];if(a==e){return(c);}}return"";}function readCookie(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=decodeURIComponent(document.cookie.substring(offset,end));}}return c;}function delCookie(a){var c=new Date();c.setTime(c.getTime()-1);var b=readCookie(a);if(b!=null){document.cookie=a+"="+b+";path=/;expires="+c.toGMTString();}}function setCookie(a,b){var c=new Date();c.setTime(c.getTime()+3600000000);document.cookie=a+"="+encodeURIComponent(b)+"; path=/; expires="+c.toGMTString();}function showMessage(){if($("message_notify")==undefined){return;}var a=(readCookie("__notes"));if(a){if(a=="recheck"){$("message_notify").innerHTML="";}else{if(a!=0){$("message_notify").innerHTML=' | <a href="/wo/?action=pm" onclick="setNote();" target="_blank"> <font color="red"> 您有'+a+"条新消息</font></a> ";}}}else{back=function(c){if(!c){c=0;}var b=new Date();b.setTime(b.getTime()+300000);document.cookie="__notes="+encodeURIComponent(c)+";path=/;expires="+b.toGMTString();if(c!=0){$("message_notify").innerHTML=' | <a href="/wo?action=pm" onclick="setNote();" target="_blank"> <font color="red"> 您有'+c+"条新消息</font></a> ";}};ajaxRequest("/services/unreadMessages",back,"get","","");}}function setNote(){var a=new Date();a.setTime(a.getTime()+30000);document.cookie="__notes=recheck;path=/;expires="+a.toGMTString();}function myAddPanel(c,a,b){if((typeof window.sidebar=="object")&&(typeof window.sidebar.addPanel=="function")){window.sidebar.addPanel(c,a,b);}else{window.external.AddFavorite(a,c);}}var cateArray=new Array();function AjaxCategoryBox(j,f,g){var l=$("ajaxCategoryBox");var b=l.getElementsByTagName("dt")[0];var k=l.getElementsByTagName("dd")[0];var d=$("categoryId");if(f==2){j.className="out";return;}else{if(f==3){j.className="move";return;}else{if(f==1){$("categoryId").value=cateArray[g][0];b.innerHTML=cateArray[g][1];k.style.display="none";k.innerHTML="";return;}}}function h(){var p="";var m="";var c=true;var n=0;for(var o=0;o<cateArray.length;o++){if(d.value==cateArray[o][0]){b.innerHTML=cateArray[o][1];}if(cateArray[o][2]==2){m+='<li onclick="AjaxCategoryBox(this,1,'+o+');" onmouseout="AjaxCategoryBox(this,2,'+cateArray[o][0]+');" onmousemove="AjaxCategoryBox(this,3,'+cateArray[o][0]+');">'+cateArray[o][1]+"</li>";n++;}}for(var o=0;o<cateArray.length;o++){if(d.value==cateArray[o][0]){b.innerHTML=cateArray[o][1];}if(cateArray[o][2]!=2){p+='<span onclick="AjaxCategoryBox(this,1,'+o+');" onmouseout="AjaxCategoryBox(this,2,'+cateArray[o][0]+');" onmousemove="AjaxCategoryBox(this,3,'+cateArray[o][0]+');">&nbsp;&nbsp;'+cateArray[o][1]+"</span>";}else{if(c){p+='<div id="subDiv"><ul class="sub">'+m+'</div></ul><div class="clear"></div>';c=false;}}}if(p!=""){k.innerHTML=p;k.style.display="block";}if($("subDiv")){$("subDiv").previousSibling.style.fontWeight="bold";}k.onmouseover=function(){k.style.display="block";};l.onmousedown=function(){k.style.display="block";};l.onmouseout=function(){k.style.display="none";};if(n>14){k.style.width=335+"px";k.style.marginLeft="-100px";}return;}if(cateArray.length<3){var a="/services/ajaxCategory?c="+d.value;var e=function(m){for(var c=0;c<m.length;c++){cateArray[c]=new Array(m[c][0],m[c][1],m[c][2]);}h();};new ajax(a,e,"get","","json");}else{h();}}function userHistory(){if($("userHistory")==undefined){return;}if($("toRootTitle")==undefined){return;}setHistory($("userHistory"),$("toRootTitle"));}function setHistory(c,j){var k="";var e=("");if(readCookie("__Links")){k=readCookie("__Links");}var l=window.location.pathname+"______"+j.innerHTML+"xxyyzz";var b=false;var g=new Array();var m=k.split("xxyyzz");for(var d=0;d<m.length;d++){if(m[d]!="null"){var h=m[d].split("______");if(h[1]!=undefined&&h[0]!=undefined){g[d]={lk:h[0],va:h[1]};if(h[0]==window.location.pathname){b=true;}}}}if(!b){k=l;var f=0;for(y in g){k+=g[y].lk+"______"+g[y].va+"xxyyzz";f++;if(f==4){break;}}}for(y in g){e+=('<li><a href="'+g[y].lk+'?src=bobolishi">'+g[y].va+"</a></li>");}if(e==""){c.getElementsByTagName("ul")[0].innerHTML=("您没有任何浏览纪录！");}else{c.getElementsByTagName("ul")[0].innerHTML=e;}setCookie("__Links",k);}function cc(){var a="/x/pages/cc";new ajax(a,function(b){},"get",null,"");}function popWindow(c,b,a,d){newwindow=window.open(c,b,"height="+d+",width="+a+",resizable=yes,scrollbars=yes,toolbar=yes,status=yes,menubar=yes,location=yes");if(window.focus){newwindow.focus();}return false;}