以下是 百度百科目录显示隐藏效果特效代码 的示例演示效果:
部分效果截图:
HTML代码(index.html):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="JS代码,菜单导航,JS广告代码,JS特效代码" />
<meta name="description" content="此代码内容为百度百科目录显示隐藏效果,属于站长常用代码" />
<title>百度百科目录显示隐藏效果</title>
<link href="css/css.css" rel="stylesheet" type="text/css"/>
<script src="js/tangram-1.1.0.js" type="text/javascript"></script>
<script src="js/base.js" type="text/javascript"></script>
</head>
<body>
<div id="wrap">
<fieldset class="text_dir" id="catalog">
<p>麦田圈 maitianquan.com <span>[<a href="javascript:void(0)" id="dir_alt" onClick="lemma.catalog.showCatalog();">隐藏</a>]</span></p>
<dl id="holder1">
<dd><a href="#">麦田圈简介</a></dd>
<dd><a href="#">形成原因</a><ol><li><a href="#">一是磁场说。</a></li><li><a href="#">二是龙卷风说。</a></li><li><a href="#">三是外星制造说。</a></li><li><a href="#">四是异端说。 </a></li><li><a href="#">五是流传较为广泛的说法是人造说。</a></li></ol></dd>
<dd><a href="#">麦田圈的资料及历史</a>
<ol><li><a href="#">水母形状的“麦田怪圈”</a></li><li><a href="#">麦田圈之谜破解</a></li><li><a href="#">麦田怪圈是种行为艺术?</a></li><li><a href="#">麦田怪圈成因又有新说法</a></li><li><a href="#">麦田怪圈惊现英国</a></li><li><a href="#">神秘标志</a></li></ol>
</dd>
<dd><a href="#">麦田圈的特征</a>
<ol><li><a href="#">人工制造麦田怪圈赏</a></li><li><a href="#">非人造麦田圈的十大特征</a></li><li><a href="#">白鸦行动</a></li><li><a href="#">麦田怪圈的猜想</a></li><li><a href="#">神秘的麦田怪圈</a></li><li><a href="#">破解麦田圈之谜破解</a></li><li><a href="#">英国出现凤凰涅磐状麦田怪圈</a></li><li><a href="#">麦田圈究竟来自何方?</a> </li></ol>
</dd>
</dl>
<dl id="holder2"></dl>
</fieldset>
<script type="text/javascript">lemma.catalog.start();</script>
</div>
</body>
</html>
JS代码(base.js):
var g_pop=g_pop||function(){
}
;
if(!Array.prototype.push){
Array.prototype.push=function(){
var B=this.length;
for(var A=0;
A<arguments.length;
A++){
this[B+A]=arguments[A]}
return this.length}
}
function G(){
var C=new Array();
for(var B=0;
B<arguments.length;
B++){
var A=arguments[B];
if(typeof A=="string"){
A=document.getElementById(A)}
if(arguments.length==1){
return A}
C.push(A)}
return C}
Function.prototype.bind=function(B){
var A=this;
return function(){
A.apply(B,arguments)}
}
;
Function.prototype.bindAsEventListener=function(B){
var A=this;
return function(C){
A.call(B,C||window.event)}
}
;
Object.extend=function(A,B){
for(property in B){
A[property]=B[property]}
return A}
;
if(!window.Event){
var Event=new Object()}
Object.extend(Event,{
observers:false,element:function(A){
return A.target||A.srcElement}
,isLeftClick:function(A){
return(((A.which)&&(A.which==1))||((A.button)&&(A.button==1)))}
,pointerX:function(A){
return A.pageX||(A.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))}
,pointerY:function(A){
return A.pageY||(A.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}
,stop:function(A){
if(A.preventDefault){
A.preventDefault();
A.stopPropagation()}
else{
A.returnValue=false;
A.cancelBubble=true}
}
,findElement:function(C,B){
var A=Event.element(C);
while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){
A=A.parentNode}
return A}
,_observeAndCache:function(D,C,B,A){
if(!this.observers){
this.observers=[]}
if(D.addEventListener){
this.observers.push([D,C,B,A]);
D.addEventListener(C,B,A)}
else{
if(D.attachEvent){
this.observers.push([D,C,B,A]);
D.attachEvent("on"+C,B)}
}
}
,unloadCache:function(){
if(!Event.observers){
return}
for(var A=0;
A<Event.observers.length;
A++){
Event.stopObserving.apply(this,Event.observers[A]);
Event.observers[A][0]=null}
Event.observers=false}
,observe:function(D,C,B,A){
if("string"==typeof D){
D=G(D)}
A=A||false;
if(C=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||D.attachEvent)){
C="keydown"}
this._observeAndCache(D,C,B,A)}
,stopObserving:function(D,C,B,A){
if("string"==typeof D){
D=G(D)}
A=A||false;
if(C=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||D.detachEvent)){
C="keydown"}
if(D.removeEventListener){
D.removeEventListener(C,B,A)}
else{
if(D.detachEvent){
D.detachEvent("on"+C,B)}
}
}
}
);
Event.observe(window,"unload",Event.unloadCache,false);
var Class=function(){
var A=function(){
this.initialize.apply(this,arguments)}
;
for(i=0;
i<arguments.length;
i++){
superClass=arguments[i];
for(member in superClass.prototype){
A.prototype[member]=superClass.prototype[member]}
}
A.child=function(){
return new Class(this)}
;
A.extend=function(B){
for(property in B){
A.prototype[property]=B[property]}
}
;
return A}
;
var Popup=new Class();
Popup.prototype={
iframeIdName:"ifr_popup",initialize:function(A){
this.config=Object.extend({
contentType:1,isHaveTitle:true,scrollType:"no",isBackgroundCanClick:false,isSupportDraging:true,isShowShadow:true,isReloadOnClose:true,width:400,isPop:false,height:300}
,A||{
}
);
this.info={
shadowWidth:3,title:"",contentUrl:"",contentHtml:"",callBack:null,parameter:null,confirmCon:"",alertCon:"",someHiddenTag:"select,object,embed",someDisabledBtn:"",someHiddenEle:"",overlay:0,coverOpacity:30}
;
this.color={
cColor:"#000",bColor:"#FFFFFF",tColor:"#709CD2",wColor:"#FFFFFF"}
;
this.dropClass=null;
this.someToHidden=[];
this.someToDisabled=[];
if(!this.config.isHaveTitle){
this.config.isSupportDraging=false}
this.iniBuild()}
,setContent:function(A,B){
if(B!=""){
switch(A){
case"width":this.config.width=B;
break;
case"height":this.config.height=B;
break;
case"title":this.info.title=B;
break;
case"contentUrl":this.info.contentUrl=B;
break;
case"contentHtml":this.info.contentHtml=B;
break;
case"callBack":this.info.callBack=B;
break;
case"parameter":this.info.parameter=B;
break;
case"confirmCon":this.info.confirmCon=B;
break;
case"alertCon":this.info.alertCon=B;
break;
case"someHiddenTag":this.info.someHiddenTag=B;
break;
case"someHiddenEle":this.info.someHiddenEle=B;
break;
case"someDisabledBtn":this.info.someDisabledBtn=B;
break;
case"overlay":this.info.overlay=B}
}
}
,iniBuild:function(){
var A=G("dialogCase");
if(A){
document.body.removeChild(A)}
A=document.createElement("DIV");
A.id="dialogCase";
A.style.zIndex=65535;
A.style.top=0;
A.style.left=0;
A.style.position="absolute";
A.style.width="100%";
document.body.appendChild(A)}
,build:function(){
var B=10001+this.info.overlay*10;
var I=B+2;
this.iframeIdName="ifr_popup"+this.info.overlay;
var K="http://img.baidu.com/hi/img/";
var J='<div id="dialogBoxClose" style="width:18px;
height:18px;
cursor:pointer;
margin-bottom:2px;
"><div>';
var F="filter:alpha(opacity="+this.info.coverOpacity+");
opacity:"+this.info.coverOpacity/100+";
";
var L='<div id="dialogBoxBG" style="position:absolute;
top:0px;
left:0px;
z-index:'+B+";
"+F+"background-color:"+this.color.cColor+';
display:none;
"></div>';
var E='<div id="dialogBox" style="border:1px solid #104987;
display:none;
z-index:'+I+";
position:relative;
width:"+this.config.width+'px;
background:url(\'http://img.baidu.com/img/baike/editor/bgs.gif\') repeat-x scroll 0 -68px #1169B1;
padding:1px;
"><table width="100%" border="0" cellpadding="0" cellspacing="0" style="background:url(\'http://img.baidu.com/img/baike/editor/bgs.gif\') repeat-x 0 -144px">';
if(this.config.isHaveTitle){
E+='<tr height="29"><td style="background:url(\'http://img.baidu.com/img/baike/editor/edithelper.gif\') no-repeat right -68px transparent;
"><table style="-moz-user-select:none;
height:24px;
" width="100%" border="0" cellpadding="0" cellspacing="0" ><tr><td width="6" height="24"></td><td id="dialogBoxTitle" style="color:'+this.color.wColor+';
font-size:14px;
font-weight:bold;
">'+this.info.title+'
</td><td id="dialogClose" width="18" align="right" valign="middle">'+J+'</td><td width="9"></td></tr></table></td></tr>'}
else{
E+='<tr height="10"><td align="right">'+J+"</td></tr>"}
E+='<tr id="container-tr" style="height:'+(this.config.height-36)+'px" valign="top"><td style="position:relative;
padding:1px;
"><div style="border:1px solid #FFF;
"><div style="background:url(\'http://img.baidu.com/img/baike/editor/bgs.gif\') repeat-x #FFF;
height:13px;
line-height:13px;
font-size:1px;
">
</div><div id="dialogBody" style="background-color:#FFF;
height:'+(this.config.height-46)+"px;
width:"+(this.config.width-4)+'px"></div></div></td></tr></table></div><div id="dialogBoxShadow" style="display:none;
z-index:'+B+';
"></div>';
if(!this.config.isBackgroundCanClick){
G("dialogCase").innerHTML=L+E;
var H=document,D=H.body,C=H.documentElement,A=H.compatMode=="BackCompat"?D:H.documentElement;
G("dialogBoxBG").style.height=Math.max(C.scrollHeight,D.scrollHeight,A.clientHeight)+"px";
G("dialogBoxBG").style.width=window.screen.width+"px"}
else{
G("dialogCase").innerHTML=E}
Event.observe(G("dialogBoxClose"),"click",this.reset.bindAsEventListener(this),false);
if(this.config.isSupportDraging){
dropClass=new Dragdrop(this.config.width,this.config.height,this.info.shadowWidth,this.config.isSupportDraging,this.config.contentType);
G("dialogBoxTitle").style.cursor="move"}
this.lastBuild()}
,lastBuild:function(){
var B='<div style="width:100%;
height:100%;
text-align:center;
"><div style="margin:0 20px 0 20px;
padding-top:20px;
font-size:14px;
line-height:16px;
color:#000000;
">'+this.info.confirmCon+'</div><div style="margin:20px;
"><input id="dialogOk" type="button" value=" ȷ�� "/>
<input id="dialogCancel" type="button" value=" ȡ�� "/></div></div>';
var E='<div style="width:100%;
height:100%;
text-align:center;
"><div style="margin:20px 20px 0 20px;
font-size:14px;
line-height:16px;
color:#000000;
">'+this.info.alertCon+'</div><div style="margin:20px;
"><input id="dialogYES" type="button" value=" ȷ�� "/></div></div>';
var A=10001+this.info.overlay*10;
var D=A+4;
if(this.config.contentType==1){
var C="<iframe style='height:"+(this.config.height-46)+"px;
width:"+(this.config.width-4)+"px;
' name='"+this.iframeIdName+"' id='"+this.iframeIdName+"' src='"+this.info.contentUrl+"' frameborder='0' scrolling='"+this.config.scrollType+"'></iframe>";
var F="<div id='iframeBG' style='position:absolute;
top:0px;
left:0px;
width:1px;
height:1px;
z-index:"+D+";
filter:alpha(opacity=00);
opacity:0.00;
background-color:#ffffff;
'><div>";
G("dialogBody").innerHTML=C+F}
else{
if(this.config.contentType==2){
G("dialogBody").innerHTML=this.info.contentHtml}
else{
if(this.config.contentType==3){
G("dialogBody").innerHTML=B;
Event.observe(G("dialogOk"),"click",this.forCallback.bindAsEventListener(this),false);
Event.observe(G("dialogCancel"),"click",this.close.bindAsEventListener(this),false)}
else{
if(this.config.contentType==4){
G("dialogBody").innerHTML=E;
Event.observe(G("dialogYES"),"click",this.close.bindAsEventListener(this),false)}
}
}
}
}
,reBuild:function(){
G("dialogBody").height=G("dialogBody").clientHeight;
this.lastBuild()}
,show:function(){
this.hiddenSome();
this.middle();
if(this.config.isShowShadow){
this.shadow()}
}
,resize:function(C,F,I){
this.setContent("width",C);
this.setContent("height",F);
var H=G("dialogBox");
var E=G("dialogBody");
H.style["width"]=C+"px";
H.style["height"]=F+"px";
var D=G(this.iframeIdName);
D.style["height"]=F-46+"px";
D.style["width"]=C-4+"px";
E.style["height"]=F-46+"px";
E.style["width"]=C-4+"px";
if(I){
this.setContent("title",I);
var B=G("dialogBoxTitle");
B.innerHTML=I+"
"}
var A=G("container-tr");
A.style["height"]=F-36+"px";
this.show()}
,forCallback:function(){
return this.info.callBack(this.info.parameter)}
,shadow:function(){
var A=G("dialogBoxShadow");
var B=G("dialogBox");
A.style["top"]=B.offsetTop+this.info.shadowWidth+10+"px";
A.style["left"]=B.offsetLeft+this.info.shadowWidth+6+"px";
A.style["width"]=B.offsetWidth-6+"px";
A.style["height"]=B.offsetHeight-10+"px";
A.style["position"]="absolute";
A.style["background"]="#000";
A.style["display"]="";
A.style["opacity"]="0.1";
A.style["filter"]="alpha(opacity=20)"}
,middle:function(){
if(!this.config.isBackgroundCanClick){
G("dialogBoxBG").style.display=""}
var F=G("dialogBox");
F.style["position"]="absolute";
F.style["display"]="";
var C=(document.documentElement.clientWidth||document.body.clientWidth);
var E=(document.documentElement.clientHeight||document.body.clientHeight);
var B=(document.documentElement.scrollTop||document.body.scrollTop);
var D=(C/2)-(F.offsetWidth/2);
var A=(E/2+B)-(F.offsetHeight/2);
if(A<B){
A=20+B}
if(D<1){
D=20}
F.style["left"]=D+"px";
F.style["top"]=A+"px"}
,reset:function(A){
this.close();
if(typeof A!=="boolean"){
A=false}
if(this.config.isReloadOnClose||A){
top.location.href=top.location.href.replace(/#.*$/g,"")}
}
,close:function(){
G("dialogBox").style.display="none";
if(!this.config.isBackgroundCanClick){
G("dialogBoxBG").style.display="none"}
if(this.config.isShowShadow){
G("dialogBoxShadow").style.display="none"}
G("dialogBody").innerHTML="";
this.showSome()}
,hiddenSome:function(){
var A=this.info.someHiddenTag.split(",");
if(A.length==1&&A[0]==""){
A.length=0}
for(var B=0;
B<A.length;
B++){
this.hiddenTag(A[B])}
var C=this.info.someHiddenEle.split(",");
if(C.length==1&&C[0]==""){
C.length=0}
for(var B=0;
B<C.length;
B++){
this.hiddenEle(C[B])}
var C=this.info.someDisabledBtn.split(",");
if(C.length==1&&C[0]==""){
C.length=0}
for(var B=0;
B<C.length;
B++){
this.disabledBtn(C[B])}
}
,disabledBtn:function(B){
var A=document.getElementById(B);
if(typeof (A)!="undefined"&&A!=null&&A.disabled==false){
A.disabled=true;
this.someToDisabled.push(A)}
}
,hiddenTag:function(B){
var C=document.getElementsByTagName(B);
if(C!=null){
for(var A=0;
A<C.length;
A++){
if(C[A].style.display!="none"&&C[A].style.visibility!="hidden"){
C[A].style.visibility="hidden";
this.someToHidden.push(C[A])}
}
}
}
,hiddenEle:function(B){
var A=document.getElementById(B);
if(typeof (A)!="undefined"&&A!=null){
A.style.visibility="hidden";
this.someToHidden.push(A)}
}
,showSome:function(){
for(var A=0;
A<this.someToHidden.length;
A++){
this.someToHidden[A].style.visibility="visible"}
for(var A=0;
A<this.someToDisabled.length;
A++){
this.someToDisabled[A].disabled=false}
}
,replaceIframe:function(A){
this.setContent("contentUrl",A);
G(this.iframeIdName).src=A}
}
;
var Dragdrop=new Class();
Dragdrop.prototype={
initialize:function(C,B,A,D,E){
this.dragData=null;
this.dragDataIn=null;
this.backData=null;
this.width=C;
this.height=B;
this.shadowWidth=A;
this.showShadow=D;
this.contentType=E;
this.IsDraging=false;
this.oObj=G("dialogBox");
Event.observe(G("dialogBoxTitle"),"mousedown",this.moveStart.bindAsEventListener(this),false)}
,moveStart:function(A){
this.IsDraging=true;
if(this.contentType==1){
G("iframeBG").style.display="";
G("iframeBG").style.width=this.width+"px";
G("iframeBG").style.height=this.height+"px"}
Event.observe(document,"mousemove",this.mousemove.bindAsEventListener(this),false);
Event.observe(document,"mouseup",this.mouseup.bindAsEventListener(this),false);
Event.observe(document,"selectstart",this.returnFalse,false);
this.dragData={
x:Event.pointerX(A),y:Event.pointerY(A)}
;
this.backData={
x:parseInt(this.oObj.style.left),y:parseInt(this.oObj.style.top)}
;
if(document.body.setCapture){
document.body.setCapture()}
}
,mousemove:function(A){
if(!this.IsDraging){
return}
var C=Event.pointerX(A)-this.dragData.x+parseInt(this.oObj.style.left);
var B=Event.pointerY(A)-this.dragData.y+parseInt(this.oObj.style.top);
if(this.dragData.y<parseInt(this.oObj.style.top)){
B=B-12}
else{
if(this.dragData.y>parseInt(this.oObj.style.top)+25){
B=B+12}
}
this.oObj.style.left=C+"px";
this.oObj.style.top=B+"px";
if(this.showShadow){
G("dialogBoxShadow").style.left=C+this.shadowWidth+6+"px";
G("dialogBoxShadow").style.top=B+this.shadowWidth+10+"px"}
this.dragData={
x:Event.pointerX(A),y:Event.pointerY(A)}
;
document.body.style.cursor="move"}
,mouseup:function(C){
if(!this.IsDraging){
return}
if(this.contentType==1){
G("iframeBG").style.display="none"}
document.onmousemove=null;
document.onmouseup=null;
var B=Event.pointerX(C)-(document.documentElement.scrollLeft||document.body.scrollLeft);
var A=Event.pointerY(C)-(document.documentElement.scrollTop||document.body.scrollTop);
if(B<1||A<1||B>document.body.clientWidth||A>document.body.clientHeight){
this.oObj.style.left=this.backData.x+"px";
this.oObj.style.top=this.backData.y+"px";
if(this.showShadow){
G("dialogBoxShadow").style.left=this.backData.x+this.shadowWidth+6+"px";
G("dialogBoxShadow").style.top=this.backData.y+this.shadowWidth+10+"px"}
}
this.IsDraging=false;
document.body.style.cursor="";
Event.stopObserving(window,"selectstart",this.returnFalse,false);
if(document.body.releaseCapture){
document.body.releaseCapture()}
}
,returnFalse:function(){
return false}
}
;
var Fe=Fe||{
version:"20080809",emptyFn:function(){
}
}
;
if(Object.prototype.propertyIsEnumerable){
Fe.propertyIsEnumerable=function(A,B){
return Object.prototype.propertyIsEnumerable.call(A,B)}
}
else{
Fe.propertyIsEnumerable=function(A,C){
if(C in A){
for(var B in A){
if(B==C){
return true}
}
}
return false}
}
Fe.isArray=function(A){
return(A&&typeof A.length=="number"&&typeof A.splice!="undefined"&&!Fe.propertyIsEnumerable(A,"length"))}
;
Fe.isObject=function(A){
return(A&&(typeof (A)=="object"||typeof (A)=="function"))||false}
;
Fe.trim=function(A){
return A.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+$)/g,"")}
;
Fe.format=function(I,K){
if(arguments.length>1){
var E=Fe.format,H=/([.*+?^=!:${
}
()|[\]\/\\])/g,F=(E.left_delimiter||"{
").replace(H,"\\$1"),A=(E.right_delimiter||"}
").replace(H,"\\$1");
var C=E._r1||(E._r1=new RegExp("#"+F+"([^"+F+A+"]+)"+A,"g")),B=E._r2||(E._r2=new RegExp("#"+F+"(\\d+)"+A,"g"));
if(typeof (K)=="object"){
return I.replace(C,function(L,N){
var M=K[N];
if(typeof M=="function"){
M=M(N)}
return typeof (M)=="undefined"?"":M}
)}
else{
if(typeof (K)!="undefined"){
var J=Array.prototype.slice.call(arguments,1);
var D=J.length;
return I.replace(B,function(L,M){
M=parseInt(M,10);
return(M>=D)?L:J[M]}
)}
}
}
return I}
;
Fe.format.delimiter=function(C,A){
var B=Fe.format;
B.left_delimiter=C||"{
";
B.right_delimiter=A||C||"}
";
B._r1=B._r2=null}
;
Fe.each=function(E,A){
if(typeof A!="function"){
return E}
if(E){
if(E.length===undefined){
for(var B in E){
A.call(E[B],E[B],B)}
}
else{
for(var C=0,D=E.length;
C<D;
C++){
A.call(E[C],E[C],C)}
}
}
return E}
;
Fe.extend=function(F,D){
if(F&&D&&typeof (D)=="object"){
for(var E in D){
F[E]=D[E]}
var C=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];
for(var A=0,B;
A<C.length;
A++){
B=C[A];
if(Object.prototype.hasOwnProperty.call(D,B)){
F[B]=D[B]}
}
}
return F}
;
Fe.Browser=(function(){
var C=navigator.userAgent;
var H=0,A=0,F=0,E=0;
var D=0,I=0,B=0;
if(typeof (window.opera)=="object"&&/Opera(\s|\/)(\d+(\.\d+)?)/.test(C)){
A=parseFloat(RegExp.$2)}
else{
if(/MSIE (\d+(\.\d+)?)/.test(C)){
H=parseFloat(RegExp.$1)}
else{
if(/Firefox(\s|\/)(\d+(\.\d+)?)/.test(C)){
E=parseFloat(RegExp.$2)}
else{
if(navigator.vendor=="Netscape"&&/Netscape(\s|\/)(\d+(\.\d+)?)/.test(C)){
B=parseFloat(RegExp.$2)}
else{
if(C.indexOf("Safari")>-1&&/Version\/(\d+(\.\d+)?)/.test(C)){
F=parseFloat(RegExp.$1)}
}
}
}
}
if(C.indexOf("Gecko")>-1&&C.indexOf("KHTML")==-1&&/rv\:(\d+(\.\d+)?)/.test(C)){
I=parseFloat(RegExp.$1)}
return{
ie:H,firefox:E,gecko:I,netscape:B,opera:A,safari:F}
}
)();
window.FeBrowser=Fe.Browser;
Fe.isGecko=(navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1&&/rv\:(\d+(\.\d+)?)/.test(navigator.userAgent))?RegExp.$1:0;
Fe.isStrict=(document.compatMode=="CSS1Compat");
Fe.isIE=/MSIE (\d+(\.\d+)?)/.test(navigator.userAgent)?RegExp.$1:0;
Fe.isFirefox=/Firefox(\s|\/)(\d+(\.\d+)?)/.test(navigator.userAgent)?RegExp.$2:0;
Fe.isSafari=(navigator.userAgent.indexOf("Safari")>-1&&/Version\/(\d+(\.\d+)?)/.test(navigator.userAgent))?RegExp.$1:0;
Fe.isWebkit=(navigator.userAgent.indexOf("KHTML")>-1&&/AppleWebKit\/([^\s]*)/.test(navigator.userAgent))?RegExp.$1:0;
Fe.isOpera=(window.opera&&/Opera(\s|\/)(\d+(\.\d+)?)/.test(navigator.userAgent))?RegExp.$2:0;
Fe.G=function(){
for(var A=[],B=arguments.length-1;
B>-1;
B--){
var C=arguments[B];
A[B]=null;
if(typeof C=="object"&&C&&C.dom){
A[B]=C.dom}
else{
if((typeof C=="object"&&C&&C.tagName)||C==window||C==document){
A[B]=C}
else{
if(typeof C=="string"&&(C=document.getElementById(C))){
A[B]=C}
}
}
}
return A.length<2?A[0]:A}
;
Fe.Q=function(E,D,B){
if(typeof E!="string"||E.length<=0){
return null}
var J=[],B=(typeof B=="string"&&B.length>0)?B.toLowerCase():null,C=(Fe.G(D)||document);
if(C.getElementsByClassName){
Fe.each(C.getElementsByClassName(E),function(K){
if(B!==null){
if(K.tagName.toLowerCase()==B){
J[J.length]=K}
}
else{
J[J.length]=K}
}
)}
else{
E=E.replace(/\-/g,"\\-");
var A=new RegExp("(^|\\s{
1,}
)"+Fe.trim(E)+"(\\s{
1,}
|$)"),H=(B===null)?(C.all?C.all:C.getElementsByTagName("*")):C.getElementsByTagName(B),F=H.length,I=F;
while(F--){
if(A.test(H[I-F-1].className)){
J[J.length]=H[I-F-1]}
}
}
return J}
;
Fe.hide=function(){
Fe.each(arguments,function(A){
if(A=Fe.G(A)){
A.style.display="none"}
}
)}
;
Fe.show=function(){
Fe.each(arguments,function(A){
if(A=Fe.G(A)){
A.style.display=""}
}
)}
;
Fe.toggle=function(){
Fe.each(arguments,function(A){
if(A=Fe.G(A)){
A.style.display=A.style.display=="none"?"":"none"}
}
)}
;
Fe.addClassName=function(C,D){
if(!(C=Fe.G(C))){
return}
var A=C.className.split(" "),B=Fe.trim;
if(!new RegExp("(^|\\s{
1,}
)"+B(D)+"(\\s{
1,}
|$)").test(C.className)){
C.className=B(A.concat(D).join(" "))}
}
;
Fe.ac=Fe.addClassName;
Fe.removeClassName=function(B,C){
if(!(B=Fe.G(B))){
return}
var A=Fe.trim,D=new RegExp("(^|\\s{
1,}
)"+A(C)+"(\\s{
1,}
|$)","g");
B.className=A(B.className.replace(D,"$2"))}
;
Fe.rc=Fe.removeClassName;
Fe.body=function(){
var A=0,J=0,E=0,C=0,B=0,K=0;
var F=window,D=document,I=D.documentElement;
A=I.clientWidth||D.body.clientWidth;
J=F.innerHeight||I.clientHeight||D.body.clientHeight;
C=D.body.scrollTop||I.scrollTop;
E=D.body.scrollLeft||I.scrollLeft;
B=Math.max(D.body.scrollWidth,I.scrollWidth||0);
K=Math.max(D.body.scrollHeight,I.scrollHeight||0,J);
return{
scrollTop:C,scrollLeft:E,documentWidth:B,documentHeight:K,viewWidth:A,viewHeight:J}
}
;
Fe.on=function(C,B,A){
if(!(C=Fe.G(C))){
return C}
B=B.replace(/^on/,"").toLowerCase();
if(C.attachEvent){
C[B+A]=function(){
A.call(C,window.event)}
;
C.attachEvent("on"+B,C[B+A])}
else{
C.addEventListener(B,A,false)}
return C}
;
Fe.un=function(C,B,A){
if(!(C=Fe.G(C))){
return C}
B=B.replace(/^on/,"").toLowerCase();
if(C.attachEvent){
C.detachEvent("on"+B,C[B+A]);
C[B+A]=null}
else{
C.removeEventListener(B,A,false)}
return C}
;
Fe.css=function(C,H){
if(!C||!H){
return null}
C=typeof C=="string"?document.getElementById(C):C;
var B=!window.opera&&navigator.userAgent.indexOf("MSIE")!=-1;
if(H=="float"){
H=B?"styleFloat":"cssFloat"}
H=H.replace(/(-[a-z])/gi,function(I,J){
return J.charAt(1).toUpperCase()}
);
if("opacity"==H&&B){
var A=C.style.filter;
return A&&A.indexOf("opacity=")>=0?(parseFloat(A.match(/opacity=([^)]*)/)[1])/100)+"":"1"}
var F=null;
if(F=C.style[H]){
return F}
if(C.currentStyle){
return C.currentStyle[H]}
else{
var E=C.nodeType==9?C:C.ownerDocument||C.document;
if(E.defaultView&&E.defaultView.getComputedStyle){
var D=E.defaultView.getComputedStyle(C,"");
if(D){
return D[H]}
}
}
return null}
;
if(!window.console||!console.firebug){
var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];
window.console=(typeof window.loadFirebugConsole=="function")?window.loadFirebugConsole():{
}
;
for(var i=0;
i<names.length;
++i){
window.console[names[i]]=function(){
}
}
}
if(typeof (HTMLElement)!="undefined"&&!window.opera){
HTMLElement.prototype.__defineGetter__("children",function(){
for(var B=[],C=0,E,D=0,A=this.childNodes.length;
D<A;
D++){
E=this.childNodes[D];
if(E.nodeType==1){
B[C++]=E;
if(E.name){
if(!B[E.name]){
B[E.name]=[]}
B[E.name][B[E.name].length]=E}
if(E.id){
B[E.id]=E}
}
}
return B}
)}
if(typeof (HTMLElement)!="undefined"&&!window.opera){
HTMLElement.prototype.__defineGetter__("currentStyle",function(){
return this.ownerDocument.defaultView.getComputedStyle(this,null)}
)}
if(typeof (HTMLElement)!="undefined"&&!window.opera){
HTMLElement.prototype.insertAdjacentHTML=function(A,B){
var C=this.ownerDocument.createRange();
C.setStartBefore(this);
C=C.createContextualFragment(B);
switch(A){
case"beforeBegin":this.parentNode.insertBefore(C,this);
break;
case"afterBegin":this.insertBefore(C,this.firstChild);
break;
case"beforeEnd":this.appendChild(C);
break;
case"afterEnd":if(!this.nextSibling){
this.parentNode.appendChild(C)}
else{
this.parentNode.insertBefore(C,this.nextSibling)}
break}
}
}
if(Fe.isFirefox&&window.Event){
Event.prototype.__defineSetter__("returnValue",function(A){
if(!A){
this.preventDefault()}
return A}
);
Event.prototype.__defineSetter__("cancelBubble",function(A){
if(A){
this.stopPropagation()}
return A}
);
Event.prototype.__defineGetter__("srcElement",function(){
var A=this.target;
while(A.nodeType!=1){
A=A.parentNode}
return A}
);
Event.prototype.__defineGetter__("fromElement",function(){
var A;
if(this.type=="mouseover"){
A=this.relatedTarget}
else{
if(this.type=="mouseout"){
A=this.target}
}
if(!A){
return}
while(A.nodeType!=1){
A=A.parentNode}
return A}
);
Event.prototype.__defineGetter__("toElement",function(){
var A;
if(this.type=="mouseout"){
A=this.relatedTarget}
else{
if(this.type=="mouseover"){
A=this.target}
}
if(!A){
return}
while(A.nodeType!=1){
A=A.parentNode}
return A}
);
Event.prototype.__defineGetter__("offsetX",function(){
return this.layerX}
);
Event.prototype.__defineGetter__("offsetY",function(){
return this.layerY}
)}
if(window.Document){
}
if(window.Node){
Node.prototype.replaceNode=function(A){
this.parentNode.replaceChild(A,this)}
;
Node.prototype.removeNode=function(B){
if(B){
return this.parentNode.removeChild(this)}
else{
var A=document.createRange();
A.selectNodeContents(this);
return this.parentNode.replaceChild(A.extractContents(),this)}
}
;
Node.prototype.swapNode=function(B){
var C=this.nextSibling;
var A=this.parentNode;
node.parentNode.replaceChild(this,B);
A.insertBefore(node,C)}
}
if(window.HTMLElement){
HTMLElement.prototype.__defineGetter__("all",function(){
var A=this.getElementsByTagName("*");
var B=this;
A.tags=function(C){
return B.getElementsByTagName(C)}
;
return A}
);
HTMLElement.prototype.__defineGetter__("parentElement",function(){
if(this.parentNode==this.ownerDocument){
return null}
return this.parentNode}
);
HTMLElement.prototype.__defineGetter__("children",function(){
var C=[],A=0,D;
for(var B=0;
B<this.childNodes.length;
B++){
D=this.childNodes[B];
if(D.nodeType==1){
C[A++]=D;
if(D.name){
if(!C[D.name]){
C[D.name]=[]}
C[D.name][C[D.name].length]=D}
if(D.id){
C[D.id]=D}
}
}
return C}
);
HTMLElement.prototype.__defineGetter__("currentStyle",function(){
return this.ownerDocument.defaultView.getComputedStyle(this,null)}
);
HTMLElement.prototype.__defineSetter__("outerHTML",function(B){
var A=this.ownerDocument.createRange();
A.setStartBefore(this);
var C=A.createContextualFragment(B);
this.parentNode.replaceChild(C,this);
return B}
);
HTMLElement.prototype.__defineGetter__("outerHTML",function(){
var A;
var B=this.attributes;
var D="<"+this.tagName;
for(var C=0;
C<B.length;
C++){
A=B[C];
if(A.specified){
D+=" "+A.name+'="'+A.value+'"'}
}
if(!this.canHaveChildren){
return D+">"}
return D+">"+this.innerHTML+"</"+this.tagName+">"}
);
HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){
switch(this.tagName.toLowerCase()){
case"area":case"base":case"basefont":case"col":case"frame":case"hr":case"img":case"br":case"input":case"isindex":case"link":case"meta":case"param":return false}
return true}
);
HTMLElement.prototype.__defineSetter__("innerText",function(B){
var A=document.createTextNode(B);
this.innerHTML=A;
return A}
);
HTMLElement.prototype.__defineGetter__("innerText",function(){
var A=this.ownerDocument.createRange();
A.selectNodeContents(this);
return A.toString()}
);
HTMLElement.prototype.__defineSetter__("outerText",function(B){
var A=document.createTextNode(B);
this.outerHTML=A;
return A}
);
HTMLElement.prototype.__defineGetter__("outerText",function(){
var A=this.ownerDocument.createRange();
A.selectNodeContents(this);
return A.toString()}
);
HTMLElement.prototype.attachEvent=function(C,B){
var A=C.replace(/on/,"");
B._ieEmuEventHandler=function(D){
window.event=D;
return B()}
;
this.addEventListener(A,B._ieEmuEventHandler,false)}
;
HTMLElement.prototype.detachEvent=function(C,B){
var A=C.replace(/on/,"");
if(typeof (B._ieEmuEventHandler)=="function"){
this.removeEventListener(A,B._ieEmuEventHandler,false)}
else{
this.removeEventListener(A,B,true)}
}
;
HTMLElement.prototype.contains=function(A){
do{
if(A==this){
return true}
}
while(A=A.parentNode);
return false}
;
HTMLElement.prototype.insertAdjacentElement=function(A,B){
switch(A){
case"beforeBegin":this.parentNode.insertBefore(B,this);
break;
case"afterBegin":this.insertBefore(B,this.firstChild);
break;
case"beforeEnd":this.appendChild(B);
break;
case"afterEnd":if(this.nextSibling){
this.parentNode.insertBefore(B,this.nextSibling)}
else{
this.parentNode.appendChild(B)}
break}
}
;
HTMLElement.prototype.insertAdjacentHTML=function(B,D){
var C=this.ownerDocument.createRange();
C.setStartBefore(this);
var A=C.createContextualFragment(D);
this.insertAdjacentElement(B,A)}
;
HTMLElement.prototype.insertAdjacentText=function(B,C){
var A=document.createTextNode(C);
this.insertAdjacentElement(B,A)}
;
HTMLElement.prototype.attachEvent=function(C,B){
var A=C.replace(/on/,"");
B._ieEmuEventHandler=function(D){
window.event=D;
return B()}
;
this.addEventListener(A,B._ieEmuEventHandler,false)}
;
HTMLElement.prototype.detachEvent=function(C,B){
var A=C.replace(/on/,"");
if(typeof (B._ieEmuEventHandler)=="function"){
this.removeEventListener(A,B._ieEmuEventHandler,false)}
else{
this.removeEventListener(A,B,true)}
}
}
var BaikeLogParams={
}
;
function imageReq(A){
var C="iknowlog_"+(new Date()).getTime();
var B=window[C]=new Image();
B.onload=B.onerror=function(){
window[C]=null}
;
B.src=A;
B=null}
function nslog(B,D,A){
var C=(new Date()).getTime();
var E=["http://nsclick.baidu.com/v.gif?pid=103","url="+encodeURIComponent(B),"type="+D,"t="+C];
Fe.each(A,function(H,F){
E.push(F+"="+H)}
);
if(BaikeLogParams){
Fe.each(BaikeLogParams,function(H,F){
E.push(F+"="+H)}
)}
imageReq(E.join("&"))}
var baikeLoginArgs=[];
function userLogin(){
switch(arguments.length){
case 0:relogin();
break;
case 1:baikeLoginArgs=[arguments[0]];
loginflag.setLoginArr("loginSt",0);
loginflag.setLoginArr("loginUrl",arguments[0]);
checkIfLogin();
break;
default:baikeLoginArgs=[arguments[0],arguments[1]];
loginflag.setLoginArr("loginSt",1);
loginflag.setLoginArr("isDetect",arguments[0]);
loginflag.setLoginArr("loginTip",arguments[1]);
checkIfLogin();
break}
nslog(location.href,88,{
name:"login"}
)}
function checkReloginResult(){
afterLogin()}
function afterLogin(){
switch(baikeLoginArgs.length){
case 0:try{
UnloadConfirm.clear()}
catch(A){
}
window.location=location.href.replace(/#.*/
,"");
g_pop.close();
break;
case 1:window.location=baikeLoginArgs[0];
g_pop.close();
break;
default:g_pop.close();
if(loginflag.getLoginArr("isDetect")==3){
Detect.detecting()}
else{
try{
cnEdit()}
catch(A){
submitform()}
}
break}
}
function relogin(A){
g_pop=new Popup({
contentType:1,isReloadOnClose:false,width:408,height:345}
);
g_pop.setContent("title","��¼���ٶȰٿ�");
g_pop.setContent("contentUrl","/page/userlogin.html"+(A?("?fr="+A):""));
g_pop.build();
g_pop.show()}
var userlogin=userlogin||function(){
}
;
userlogin.reg=function(A){
var B="/page/userlogin.html?userreg"+(A?("&fr="+A):"");
g_pop=new Popup({
contentType:1,isReloadOnClose:false,width:408,height:345}
);
g_pop.setContent("title","��¼���ٶȰٿ�");
g_pop.setContent("contentUrl",B);
g_pop.build();
g_pop.show()}
;
var regOkHandler=function(A){
g_pop.replaceIframe("/page/regok.html?un="+encodeURIComponent(A));
g_pop.resize(538,395)}
;
var offlineTimer;
function checkIfLogin(){
var B="http://baike.baidu.com/login?s="+Math.random();
var A=document.createElement("script");
A.setAttribute("type","text/javascript");
A.setAttribute("src",B);
document.getElementsByTagName("head")[0].appendChild(A);
offlineTimer=setTimeout(loginWarn,15000)}
function wiki_relogin(){
clearTimeout(offlineTimer);
if(arguments[0]==1){
if(loginflag.getLoginArr("loginSt")==0){
loginflag.setLoginArr("loginTip",0);
var C=loginflag.getLoginArr("loginUrl");
var E=setParamURL(C);
if(document.images){
var B=new Image();
var D=addURLParam("/js/blank.js","id",E);
B.src=addURLParam(D,"logTp",0)}
relogin(C)}
else{
relogin(loginflag.getLoginArr("isDetect"),loginflag.getLoginArr("loginTip"))}
}
else{
if(loginflag.getLoginArr("loginSt")==0){
window.location=loginflag.getLoginArr("loginUrl")}
else{
if(loginflag.getLoginArr("isDetect")==3){
Detect.detecting()}
else{
try{
cnEdit()}
catch(A){
submitform()}
}
}
}
}
function loginWarn(){
var A='<br><div style="font-size:14px;
font-weight:bold;
text-align:center;
padding:10px 10px">���������������ӣ����½����ύ</div>';
g_pop=new Popup({
contentType:2,isReloadOnClose:false,width:350,height:120}
);
g_pop.setContent("title","��ʾ");
g_pop.setContent("contentHtml",A);
g_pop.build();
g_pop.show()}
function addURLParam(C,B,A){
C+=(C.indexOf("?")==-1?"?":"&");
C+=B+"="+A;
return C}
function setParamURL(B){
if(B.indexOf("id=")!=-1){
var A=(B.match(/id=\d+/).toString().substr(3));
return A}
}
var loginFlag=function(){
}
;
(function loginStatus(){
var A=new Array();
A.loginTip=0;
loginFlag.prototype.setLoginArr=function(B,C){
A[B]=C}
;
loginFlag.prototype.getLoginArr=function(B){
return A[B]}
}
)();
var loginflag=new loginFlag();
function getCookie(C){
var B="(?:;
)?"+C+"=([^;
]*);
?";
var A=new RegExp(B);
if(A.test(document.cookie)){
return decodeURIComponent(RegExp["$1"])}
else{
return null}
}
function setCookie(F,H,B,C,A,E){
var D=F+"="+encodeURIComponent(H);
if(B){
D+=";
expires="+B.toGMTString()}
if(C){
D+=";
path="+C}
if(A){
D+=";
domain="+A}
if(E){
D+=";
secure"}
document.cookie=D}
function setSug(){
g_pop=new Popup({
contentType:1,isReloadOnClose:false,width:300,height:180}
);
g_pop.setContent("title","����");
g_pop.setContent("contentUrl","/page/suggestion.html");
g_pop.build();
g_pop.show()}
setTimeout(function(){
if(G("usrbar")){
var H=G("usrbar").getElementsByTagName("a");
for(var D=0,A=H.length;
D<A;
D++){
var F=H[D].href;
if(F.indexOf("http://passport.baidu.com/center")!=-1){
H[D].onmousedown=function(){
nslog(F,80,{
name:"userId"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/home")!=-1){
H[D].onmousedown=function(){
nslog(F,81,{
name:"myBaike"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/effort")!=-1){
H[D].onmousedown=function(){
nslog(F,82,{
name:"myContri"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/draft")!=-1){
H[D].onmousedown=function(){
nslog(F,83,{
name:"myDraft"}
)}
}
else{
if(F.indexOf("http://z.baidu.com/q?ct=24&cm=16&tn=ikusercenter#uscore")!=-1||F.indexOf("http://zhidao.baidu.com/q?ct=24&cm=16&tn=ikusercenter#uscore")!=-1){
H[D].onmousedown=function(){
nslog(F,84,{
name:"myIknow"}
)}
}
else{
if(F.indexOf("http://msg.baidu.com/")!=-1){
H[D].onmousedown=function(){
nslog(F,85,{
name:"myMsg"}
)}
}
else{
if(F.indexOf("http://hi.baidu.com/sys/checkuser/")!=-1&&F.indexOf("/3")!=-1){
H[D].onmousedown=function(){
nslog(F,86,{
name:"mySpace"}
)}
}
else{
if(F.indexOf("http://www.baidu.com")!=-1){
H[D].onmousedown=function(){
nslog(F,87,{
name:"baiduIndex"}
)}
}
else{
if(F.indexOf("baidu.com/?logout&u=")!=-1){
H[D].onmousedown=function(){
nslog(F,89,{
name:"logOut"}
)}
}
}
}
}
}
}
}
}
}
}
}
if(G("nav_extra")){
var E=G("nav_extra").getElementsByTagName("a");
for(var C=0,B=E.length;
C<B;
C++){
var F=E[C].href;
if(F.indexOf("http://baike.baidu.com/uc/home")!=-1){
E[C].onmousedown=function(){
nslog(F,81,{
name:"myBaike"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/effort")!=-1){
E[C].onmousedown=function(){
nslog(F,82,{
name:"myContri"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/draft")!=-1){
E[C].onmousedown=function(){
nslog(F,83,{
name:"myDraft"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/task")!=-1){
E[C].onmousedown=function(){
nslog(F,258,{
name:"myTask"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/recommend")!=-1){
E[C].onmousedown=function(){
nslog(F,259,{
name:"myRecommend"}
)}
}
}
}
}
}
}
}
}
,1000);
var G=baidu.G;
String.prototype.byteLength=function(){
return this.replace(/[^\u0000-\u007f]/g,"\u0061\u0061").length}
;
String.prototype.subByte=function(E,D){
if(this.byteLength()<=E){
return this}
for(var B=Math.floor((E=E-2)/2),A=this.length;
B<A;
B++){
var C=this.substring(0,B);
if(C.byteLength()>=E){
return C+(D!=undefined?D:"...")}
}
return this}
;
baidu.proxy=function(C,A){
var B=Array.prototype.slice.call(arguments,1);
return function(){
C.apply(null,B)}
}
;
if(!window.console||!console.firebug){
var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];
window.console=(typeof window.loadFirebugConsole=="function")?window.loadFirebugConsole():{
}
;
for(var i=0;
i<names.length;
++i){
window.console[names[i]]=function(){
}
}
}
function nslog(B,D,A){
var C=(new Date()).getTime();
var E=["http://nsclick.baidu.com/v.gif?pid="+nslog.pid,"url="+encodeURIComponent(B),"type="+D,"t="+C];
for(k in A){
E.push(k+"="+A[k])}
for(k in nslog.log_params){
E.push(k+"="+nslog.log_params[k])}
nslog.req(E.join("&"))}
nslog.pid=103;
nslog.log_params={
}
;
nslog.set=function(A,B){
nslog.log_params[A]=B}
;
nslog.sid=((new Date()).getTime()+"_"+Math.round(Math.random()*2147483637));
nslog.stat=function(A){
nslog.req("/js/blank.js?func="+A+"&sid="+nslog.sid+"&t="+(new Date()).getTime())}
;
nslog.req=function(A){
var C="iknowlog_"+(new Date()).getTime();
var B=window[C]=new Image();
B.onload=B.onerror=function(){
window[C]=null}
;
B.src=A;
B=null}
;
function baidumessage(){
if(baidu.G("mnum")){
baidu.sio.callByBrowser("http://msg.baidu.com/ms?ct=18&cm=3&tn=bmSelfUsrStat&mpn=13227114&un="+baidu.G("login-user-name").innerHTML,function(){
if(redmsg){
redmsg=redmsg.replace(/\u6211\u7684/g,"");
redmsg=redmsg.replace(/\/\d+\)/,")");
if(/>0<\/span>/g.test(redmsg)||/\(0\)/g.test(redmsg)){
redmsg=redmsg.replace(/\([^\)]+\)/g,"")}
baidu.G("mnum").innerHTML="<span class='usrbar-split'>|</span>"+redmsg}
}
)}
}
var lemma=lemma||{
}
;
lemma.imageResize=function(B,H,F,C){
if(B.width<=H&&B.height<=F){
return}
if(B.width>0&&B.height>0){
var A=B.width;
var E=B.height;
var D=Math.min(H/A,F/E);
B.style.height="";
B.style.width="";
B.height=Math.ceil(E*D);
B.width=Math.ceil(A*D);
if(C){
B.style.marginTop=((F-B.height)/2)+"px"}
}
else{
B.style.height="";
B.style.width="";
B.style.width=H;
B.style.height=F}
}
;
lemma.adjustImage=function(B,D,E,A,C){
lemma.imageResize(B,E,A,C);
var F=baidu.G(D);
setTimeout(function(){
if(F){
if(F.innerHTML.length<=0){
F.parentNode.removeChild(F)}
else{
F.style.width=B.width+"px"}
}
}
,40)}
;
lemma.cutText=function(B,I,C,J,D){
if(J){
if(!baidu.browser.firefox||baidu.browser.firefox<1){
return}
}
var A=baidu.G(B).getElementsByTagName(I);
if(D&&D.className){
var H=[];
baidu.each(A,function(L,K){
if(L.className==D.className){
H.push(L)}
}
);
A=H}
for(var E=A.length-1;
E>=0;
E--){
if(A[E].scrollWidth>C){
A[E].innerHTML+="..."}
var F=A[E].innerHTML;
while(A[E].scrollWidth>C){
F=F.substr(0,F.length-4)+"...";
A[E].innerHTML=F}
}
}
;
function addURLParam(C,B,A){
C+=(C.indexOf("?")==-1?"?":"&");
C+=B+"="+A;
return C}
function setParamURL(B){
if(B.indexOf("id=")!=-1){
var A=(B.match(/id=\d+/).toString().substr(3));
return A}
}
function getCookie(C){
var B="(?:;
)?"+C+"=([^;
]*);
?";
var A=new RegExp(B);
if(A.test(document.cookie)){
return decodeURIComponent(RegExp["$1"])}
else{
return null}
}
function setCookie(F,H,B,C,A,E){
var D=F+"="+encodeURIComponent(H);
if(B){
D+=";
expires="+B.toGMTString()}
if(C){
D+=";
path="+C}
if(A){
D+=";
domain="+A}
if(E){
D+=";
secure"}
document.cookie=D}
function setSug(){
pop.show("����",{
url:"/page/suggestion.html",width:300,height:150}
)}
setTimeout(function(){
if(baidu.G("usrbar")){
var H=baidu.G("usrbar").getElementsByTagName("a");
for(var D=0,A=H.length;
D<A;
D++){
var F=H[D].href;
if(F.indexOf("http://passport.baidu.com/center")!=-1){
H[D].onmousedown=function(){
nslog(F,80,{
name:"userId"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/draft")!=-1){
H[D].onmousedown=function(){
nslog(F,81,{
name:"myBaike"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/effort")!=-1){
H[D].onmousedown=function(){
nslog(F,82,{
name:"myContri"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/draft")!=-1){
H[D].onmousedown=function(){
nslog(F,83,{
name:"myDraft"}
)}
}
else{
if(F.indexOf("http://z.baidu.com/q?ct=24&cm=16&tn=ikusercenter#uscore")!=-1||F.indexOf("http://zhidao.baidu.com/q?ct=24&cm=16&tn=ikusercenter#uscore")!=-1){
H[D].onmousedown=function(){
nslog(F,84,{
name:"myIknow"}
)}
}
else{
if(F.indexOf("http://msg.baidu.com/")!=-1){
H[D].onmousedown=function(){
nslog(F,85,{
name:"myMsg"}
)}
}
else{
if(F.indexOf("http://hi.baidu.com/sys/checkuser/")!=-1&&F.indexOf("/3")!=-1){
H[D].onmousedown=function(){
nslog(F,86,{
name:"mySpace"}
)}
}
else{
if(F.indexOf("http://www.baidu.com")!=-1){
H[D].onmousedown=function(){
nslog(F,87,{
name:"baiduIndex"}
)}
}
else{
if(F.indexOf("baidu.com/?logout&u=")!=-1){
H[D].onmousedown=function(){
nslog(F,89,{
name:"logOut"}
)}
}
}
}
}
}
}
}
}
}
}
}
if(baidu.G("nav_extra")){
var E=baidu.G("nav_extra").getElementsByTagName("a");
for(var C=0,B=E.length;
C<B;
C++){
var F=E[C].href;
if(F.indexOf("http://baike.baidu.com/uc/draft")!=-1){
E[C].onmousedown=function(){
nslog(F,81,{
name:"myBaike"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/effort")!=-1){
E[C].onmousedown=function(){
nslog(F,82,{
name:"myContri"}
)}
}
else{
if(F.indexOf("http://baike.baidu.com/uc/draft")!=-1){
E[C].onmousedown=function(){
nslog(F,83,{
name:"myDraft"}
)}
}
}
}
}
}
}
,1000);
function imageResize(B,H,F,C){
if(B.width<=H&&B.height<=F){
return}
if(B.width>0&&B.height>0){
var A=B.width;
var E=B.height;
var D=Math.min(H/A,F/E);
B.style.height="";
B.style.width="";
B.height=Math.ceil(E*D);
B.width=Math.ceil(A*D);
if(C){
B.style.marginTop=((F-B.height)/2)+"px"}
}
else{
B.style.height="";
B.style.width="";
B.style.width=H;
B.style.height=F}
}
function picLoaded(B,A){
if(B.height>A){
var D=A/B.height;
var C=B.width;
B.width=C*D;
B.height=A}
if(B.width>0){
B.parentNode.parentNode.style.width=(B.width+6)+"px"}
}
function formatonlinpic(E,D,C){
var F=document.getElementsByName(E);
for(var A=0;
A<F.length;
A++){
if(F[A].width>0&&F[A].height>0){
var B=(D/F[A].width<C/F[A].height)?D/F[A].width:C/F[A].height;
if(B<=1){
F[A].width=F[A].width*B}
}
}
}
function formatPic(A){
for(var B in A){
var J=A[B].width;
var K=A[B].height;
var H=A[B].valign;
var C=document.getElementsByName(B);
for(var D=0;
D<C.length;
D++){
var I=C[D].width;
var E=C[D].height;
if(I>0&&E>0){
var F=Math.min(J/I,K/E);
if(F<=1){
C[D].width=I*F;
C[D].height=E*F}
if(H==1){
C[D].style.marginTop=(K-C[D].height)/2+"px"}
}
}
}
}
function imageFullSize(A){
A.style.height="auto";
A.style.width="auto"}
lemma.catalog=(function(){
var A={
}
;
A.init=function(){
this.holder1=document.getElementById("holder1");
this.holder2=document.getElementById("holder2");
this.temp=null;
this.data=null;
this.mT=null;
this.fadeT=null;
this.mItems=this.holder1.getElementsByTagName("DD");
this.mItemNum=this.holder1.getElementsByTagName("DD").length;
this.mSubItems=null;
this.mSubItemNum=0;
this.mSub=this.holder1.getElementsByTagName("OL");
this.mSubNum=this.mSub.length;
this.mShowNum=8;
this.h=0;
this.dataH=0;
this.fade=0}
;
A.start=function(){
if(!baidu.G("catalog")){
return}
A.init();
if(A.mItemNum<=A.mShowNum&&A.mSubNum==0){
return}
var B="";
var E="";
for(var D=0;
D<A.mSubNum;
D++){
A.mSub[D].style.display="inline"}
var C=A.holder1.offsetWidth;
for(var D=0;
D<A.mSubNum;
D++){
A.mSub[D].style.display="none"}
if(A.mItemNum>A.mShowNum){
for(var D=0;
D<A.mShowNum;
D++){
B+="<dd>"+A.mItems[D].innerHTML+"</dd>"}
E="<dd id='temp' class='temp'><ul id='data' class='data'>";
for(var D=A.mShowNum;
D<A.mItemNum;
D++){
E+="<li>"+A.mItems[D].innerHTML+"</li>"}
E+="</ul></dd>";
A.holder2.innerHTML=B+E;
for(var D=A.mShowNum;
D<A.mItemNum;
D++){
A.mItems[D].style.display="none"}
A.temp=document.getElementById("temp");
A.data=document.getElementById("data");
A.holder2.style.display="block";
A.temp.style.height=0+"px";
A.dataH=A.data.offsetHeight}
else{
A.holder2.innerHTML=A.holder1.innerHTML}
A.holder1.style.width=C+"px";
A.holder2.style.width=C+"px";
A.holder1.style.visibility="hidden";
A.holder2.style.display="block";
A.holder2.className="arr";
A.mSubItems=A.holder2.getElementsByTagName("OL");
A.mSubItemNum=A.mSubItems.length;
A.holder2.onmouseover=function(){
clearTimeout(A.mT);
A.mT=setTimeout(A.maxM,100)}
;
A.holder2.onmouseout=function(){
clearTimeout(A.mT);
if(A.mSubNum>0){
A.mT=setTimeout(A.hideSecondTitle,400)}
else{
A.mT=setTimeout(A.minM,100)}
}
}
;
A.maxM=function(){
if(A.h<A.dataH){
A.h+=10;
A.temp.style.height=A.h+"px";
A.data.style.marginTop=(A.h-A.dataH)+"px";
A.holder2.className="";
A.mT=setTimeout(A.maxM,10)}
else{
A.showSecondTitle()}
}
;
A.minM=function(){
if(A.h>0){
A.h-=10;
A.temp.style.height=A.h+"px";
A.data.style.marginTop=(A.h-A.dataH)+"px";
A.mT=setTimeout(A.minM,10)}
else{
A.holder2.className="arr"}
}
;
A.fadeIn=function(){
clearTimeout(A.fadeT);
if(A.fade>=100){
return}
A.fade+=5;
for(var B=0;
B<A.mSubItemNum;
B++){
A.mSubItems[B].style.filter="Alpha(Opacity="+A.fade+")";
A.mSubItems[B].style.opacity=A.fade/100}
A.fadeT=setTimeout(A.fadeIn,20)}
;
A.fadeOut=function(){
clearTimeout(A.fadeT);
if(A.fade<=15){
for(var B=0;
B<A.mSubItemNum;
B++){
A.mSubItems[B].style.display="none"}
if(A.mItemNum>A.mShowNum){
A.h=A.data.offsetHeight;
A.temp.style.height=A.h+"px"}
A.mT=setTimeout(A.minM,20);
return}
A.fade-=5;
for(var B=0;
B<A.mSubItemNum;
B++){
A.mSubItems[B].style.filter="Alpha(Opacity="+A.fade+")";
A.mSubItems[B].style.opacity=A.fade/100}
A.fadeT=setTimeout(A.fadeOut,20)}
;
A.showSecondTitle=function(){
for(var B=0;
B<A.mSubItemNum;
B++){
A.mSubItems[B].style.display="block"}
if(A.mItemNum>A.mShowNum){
A.h=A.data.offsetHeight;
A.temp.style.height=A.h+"px"}
else{
A.holder2.className=""}
A.fadeT=setTimeout(A.fadeIn,10)}
;
A.hideSecondTitle=function(){
A.fadeT=setTimeout(A.fadeOut,10)}
;
A.showCatalog=function(){
var B=A.holder1.style.display=="none";
A.holder1.style.display=B?"block":"none";
if(A.mItemNum<=A.mShowNum&&A.mSubNum==0){
A.holder2.style.display="none"}
else{
A.holder2.style.display=B?"block":"none"}
document.getElementById("dir_alt").innerHTML=B?"\u9690\u85cf":"\u663E\u793A"}
;
return{
start:A.start,showCatalog:A.showCatalog}
}
)();
var autoScroll=(function(){
var C;
var F;
var A;
function E(H){
var J=H||window.event;
var I=J.target||J.srcElement;
if(I.id=="hotWordRefresh"){
return}
F=setInterval(D,40)}
function D(){
C=document.documentElement.scrollTop||document.body.scrollTop;
C++;
window.scroll(0,C);
A=document.documentElement.scrollTop||document.body.scrollTop;
if(C!=A){
B()}
}
function B(){
clearInterval(F)}
return{
start:E,stop:B}
}
)();
lemma.imageTitleInit=function(D){
var C=D.getElementsByTagName("h3")[0];
var B=D.getElementsByTagName("img")[0];
if(!!C){
var A=C.innerHTML;
if(/^\s*$/.test(A)){
D.removeChild(C)}
else{
D.style.paddingBottom="3px";
C.innerHTML=baidu.string.wbr(A)}
}
D.style.width=B.offsetWidth+"px";
D.style.visibility="visible"}
;
lemma.contentImageInit=function(){
baidu.each(baidu.Q("text_pic",baidu.G("lemmaContent")),function(A){
lemma.imageTitleInit(A)}
)}
;
lemma.editRelated=function(){
baidu.sio.callByBrowser("/js/Dialog/Dialog.js",function(){
var A="/api/editcheck?lemmaId="+baikeViewInfo.id;
baidu.ajax.get(A,function(D,C){
if(C=="12"){
Detect.content='<center><h2>�Բ�������ʱû��Ȩ�ޱ༭�ô�����</h2></center><p>���ã��ô��������ѽϷḻ���ֽ��ٿƵȼ��ﵽ<b>�ļ�</b>����ͨ���ʴﵽ<b>85%</b>�Ŀ��ѿ��ű༭��</p><p>����ͨ��Ŭ���ﵽ����Ҫ�Ϳ��Բ���༭�ô����ˡ�</p><p>�������Ϊ�ô��������һ�����ƣ����Ե�<a href="http://tousu.baidu.com/baike/add" target="_blank">Ͷ������</a>������</p>';
var B=formatDetect_privcheck({
title:"�༭��ʾ",width:"402px",height:"181px",buttonbar:true,buttonAccept:true,buttonCancel:false,contentType:"HTMLUrl",locked:true}
)}
else{
var E="/relatedEdit/?id="+baikeViewInfo.id+"&title="+G("titleVal").value;
g_pop=new Popup({
contentType:1,isReloadOnClose:false,width:536,height:550}
);
g_pop.setContent("title","������ش���");
g_pop.setContent("contentUrl",E);
g_pop.build();
g_pop.show()}
}
)}
)}
;
lemma.editLemma=function(D,A,B){
Detect.url=D+"id="+A+(B?"&dl="+B:"");
if(location.href.indexOf("fr=")!=-1){
var E=location.search.split("&");
var C="";
baidu.each(E,function(F,H){
if(F.indexOf("fr=")!=-1){
C=F}
}
);
Detect.url+="&"+C}
Detect.id=A;
userlogin.check(Detect.detecting,false,"edit")}
;
editLemmaPara=lemma.editLemma;
lemma.vote=function(){
var A="/view/getLemmaCountAsc/lemmaid="+baikeViewInfo.id+"&random="+Math.random();
baidu.sio.callByBrowser(A)}
;
var Detect={
detecting:function(){
handle_doDetect()}
,url:"",id:"",uptime:"",upnum:"",upst:"",content:"",latestid:""}
;
function formatDetect(B){
var A=Fe.Dialog.open("/page/detect.html",B);
return A}
Detect.callback=function(A){
if(A[1]>=A[6]){
if(A[6]){
var B;
if(baidu.G("BkLogUser")){
B="func=editdeny&username="+baidu.G("BkLogUser").innerHTML+"&lid="+baikeViewInfo.id}
else{
B="func=editdeny&lid="+baikeViewInfo.id}
nslog.stat(B);
Detect.content="�ܱ�Ǹ���ô������ж���汾�����ύ�У�����ǰ����<br>���ô�������<br><br>�ٿƽ�������Щʱ���ٳ��Ա༭�ô��������Ա༭����<br>������";
var C=formatDetect({
title:"�༭��ʾ",width:"388px",height:"190px",buttonbar:true,buttonAccept:false,buttonCancel:true,contentType:"HTMLUrl",locked:true,buttonCancelValue:"����"}
)}
else{
if(A[5]==1){
Detect.content='����ǰ�ı༭ʱ����ٿ�<a href="http://www.baidu.com/search/baike_help.html#n22" target="_blank">����༭ʱ��</a>��<br><br>Ϊ��֤���ı༭�ɹ����ύ������ʱ������Ч���ٿƽ�<br>����ѡ������ʱ����б༭����<br><br>��ȻҪ�����༭��';
var C=formatDetect({
title:"�༭��ʾ",width:"388px",height:"190px",buttonbar:true,buttonAccept:true,buttonCancel:true,contentType:"HTMLUrl",locked:true}
);
C.onaccept=function(){
window.location=Detect.url}
}
else{
window.location=Detect.url}
}
}
else{
if((A[2]==1)||(A[2]==2)){
Detect.content="�ô�����ǰ���������汾���ڵȴ���ˡ�<br><br>Ϊ�˱������ı༭�ܵõ���ʱ��ˣ��������Ժ��ٱ༭<br>����������<br><br>��ȻҪ������";
var C=formatDetect({
title:"�༭��ʾ",width:"388px",height:"190px",buttonbar:true,buttonAccept:true,buttonCancel:true,contentType:"HTMLUrl",locked:true}
);
C.onaccept=function(){
window.location=Detect.url}
}
else{
if(A[5]==1){
Detect.content='����ǰ�ı༭ʱ����ٿ�<a href="http://www.baidu.com/search/baike_help.html#n22" target="_blank">����༭ʱ��</a>��<br><br>Ϊ��֤���ı༭�ɹ����ύ������ʱ������Ч���ٿƽ�<br>����ѡ������ʱ����б༭����<br><br>��ȻҪ�����༭��';
var C=formatDetect({
title:"�༭��ʾ",width:"388px",height:"190px",buttonbar:true,buttonAccept:true,buttonCancel:true,contentType:"HTMLUrl",locked:true}
);
C.onaccept=function(){
window.location=Detect.url}
}
else{
window.location=Detect.url}
}
}
}
;
Detect.doDetect=function(){
var _str="tp=0&r="+Math.random()+"&lemmaid="+Detect.id+"&lemmaVersionId=0";
var _url="/getConflictInfo/?"+_str;
baidu.ajax.get(_url,function(xhr){
Detect.callback(eval(xhr.responseText))}
)}
;
function formatDetect_privcheck(B){
var A=Fe.Dialog.open("/page/privcheck.html",B);
return A}
function handle_doDetect(){
baidu.sio.callByBrowser("/js/Dialog/Dialog.js",function(){
var A="/api/editcheck?lemmaId="+baikeViewInfo.id;
baidu.ajax.get(A,function(D,C){
if(C=="12"){
Detect.content='<center><h2>�Բ�������ʱû��Ȩ�ޱ༭�ô�����</h2></center><p>���ã��ô��������ѽϷḻ���ֽ��ٿƵȼ��ﵽ<b>�ļ�</b>����ͨ���ʴﵽ<b>85%</b>�Ŀ��ѿ��ű༭��</p><p>����ͨ��Ŭ���ﵽ����Ҫ�Ϳ��Բ���༭�ô����ˡ�</p><p>�������Ϊ�ô��������һ�����ƣ����Ե�<a href="http://tousu.baidu.com/baike/add" target="_blank">Ͷ������</a>������</p>';
var B=formatDetect_privcheck({
title:"�༭��ʾ",width:"402px",height:"181px",buttonbar:true,buttonAccept:true,buttonCancel:false,contentType:"HTMLUrl",locked:true}
)}
else{
Detect.doDetect()}
}
)}
)}
function gotoRef(B){
if(!B){
return false}
var D=B.innerHTML.replace(/\[/g,"").replace(/\]/g,"");
var D=parseInt(D);
if(D>=0){
var A=baidu.G("refIndex_"+D);
if(A&&A.parentNode){
var C=baidu.dom.getPosition(A.parentNode).top-0;
if(C>0){
window.scrollTo(0,C)}
}
}
}
lemma.showMoreRelated=function(){
var B=baidu.G("word_more");
var A=baidu.G("word_more_con");
if(A.style.display=="none"){
B.className="word_more2";
A.style.display=""}
else{
B.className="word_more1";
A.style.display="none"}
}
;
lemma.relatedInit=function(){
if(!baidu.G("word_more")){
return false}
var H=baidu.G("word_more_con").getElementsByTagName("a");
var C=baidu.G("oneLineSpan");
var B=baidu.G("oneLineDiv");
var A=baidu.G("word_more");
var F=H.length;
for(var D=0;
D<F;
D++){
var E=H[0];
C.appendChild(E);
if(C.offsetWidth>(B.offsetWidth-A.offsetWidth)){
if(D<(F-1)){
baidu.G("word_more_con").insertBefore(E,H[0]);
A.style.visibility="visible"}
else{
if(D==(F-1)){
baidu.G("word_more_con").appendChild(E);
A.style.visibility="visible"}
}
B.style.visibility="visible";
return}
}
B.style.visibility="visible"}
;
lemma.coEditorInit=function(){
var A=baidu.G("co-editors");
if(!A){
return}
if(A.offsetHeight>25){
baidu.show("more-coeditor");
var B=A.getElementsByTagName("span");
while(A.offsetHeight>25&&B.length>0){
A.removeChild(B[B.length-1])}
}
}
;
lemma.getDays=function(C){
if(!C){
return""}
var A=C.match(/(\d{
2,4}
)-(\d{
1,2}
)-(\d{
1,2}
)/);
A[2]=parseInt(A[2],10)-1;
var F=new Date(A[1],A[2],A[3]);
var B=new Date();
var D=new Date(B.getFullYear(),B.getMonth(),B.getDate()-1);
var E=parseInt((F-D)/(1000*3600*24));
switch(E){
case 1:return"����";
case 0:return"����";
case -1:return"2��ǰ";
case -2:return"3��ǰ"}
return C}
;
var pop={
onOk:function(){
}
,onclosed:function(){
}
,onshow:function(){
}
,create:function(){
if(!baidu.G("pop-main")){
var B=document.createElement("div");
B.id="pop-shadow";
var C=document.createElement("div");
C.id="pop-main";
C.style.width="500px";
var A=document.createElement("iframe");
A.id="pop-shadow-iframe";
var D=[,'<div class="p-bg">','<div class="p-top">','<div class="p-title"><div id="pop-close"></div><p id="pop-title">��Ϣ��ʾ</p></div>','<div class="p-r1"></div><div class="p-r2"></div>',"</div>",'<div class="p-body"><div class="p-body-inner">','<iframe id="pop-iframe-content" name="pop-iframe-content" width="100%" frameborder="0" scrolling="no" src="about:blank"></iframe>','<div id="pop-text-content"></div>',"</div></div>",'<div class="p-bottom"><div class="p-r3"></div><div class="p-r4"></div><div class="clear"></div></div>','</div><div id="pop-shadow-bg"></div>'];
C.innerHTML=D.join("");
document.body.insertBefore(A,document.body.firstChild);
document.body.insertBefore(C,document.body.firstChild);
document.body.insertBefore(B,document.body.firstChild)}
}
,resize:function(B,A,L){
var D=baidu.page;
var P=D.getScrollTop();
var M=D.getWidth()||500;
var E=D.getHeight()||500;
var O=baidu.G("pop-shadow");
var C=baidu.G("pop-shadow-bg");
var J=baidu.G("pop-main");
var I=baidu.G("pop-shadow-iframe");
var N=A||parseInt(J.style.width,10)||500;
var F=L||J.offsetHeight||parseInt(J.style.height,10)||500;
O.style.width=M+"px";
O.style.height=E+"px";
O.style.left=O.style.top="0px";
I.style.width=(M-20)+"px";
I.style.height=(E-20)+"px";
I.style.top=I.style.left="5px";
var K=(D.getViewWidth()-N)/2;
var H=(D.getViewHeight()-F)/2+P;
if(K<1){
K=P}
if(H<1){
H="20"}
J.style.left=K+"px";
J.style.top=H+"px";
J.style.width=N+"px";
C.style.height=F+"px";
if(L&&baidu.G("pop-iframe-content").style.display=="block"){
baidu.G("pop-iframe-content").style.height=L+"px"}
}
,hide:function(){
pop.onclosed();
var A=function(E){
E=baidu.G(E);
if(E){
baidu.hide(E)}
}
;
try{
A("pop-main");
A("pop-shadow");
A("pop-shadow-iframe");
var D=baidu.G("pop-iframe-content");
try{
D.src="about:blank"}
catch(C){
try{
D.location="about:blank"}
catch(C){
}
}
}
catch(B){
}
baidu.un(window,"resize",pop.resize);
baidu.un(document,"onkeydown",pop.keyListener)}
,keyListener:function(B){
B=window.event||B;
var A=B.which||B.keyCode;
if(27==A){
pop.hide()}
}
,config:function(H,A){
pop.create();
if(H){
baidu.G("pop-title").innerHTML=H}
pop.onclosed=A.onclosed||function(){
}
;
pop.onshow=A.onshow||function(){
}
;
var I=baidu.G("pop-iframe-content");
var C=baidu.G("pop-text-content");
if(A.url){
if(A.url!=true){
C.innerHTML="";
baidu.hide(C);
I.style.display="block";
try{
I.src=A.url}
catch(E){
try{
document.frames["pop-iframe-content"].location=A.url}
catch(E){
}
}
}
if(A.scrollX){
I.style.overflowX=A.scrollX}
if(A.scrollY){
I.style.overflowY=A.scrollY}
if(A.scroll){
I.style.overflow=A.scroll}
}
else{
if(A.info){
baidu.hide(I);
C.style.display="block";
C.innerHTML=A.info}
}
var B=A.width||450;
var F=A.height||400;
var D=baidu.G("pop-main");
D.style.width=B+"px";
if(A.url&&I.style.display=="block"){
I.style.height=F+"px";
I.style.width=(B-30)+"px"}
}
,show:function(B,A){
pop.create();
pop.config(B,A);
baidu.G("pop-close").onclick=pop.hide;
baidu.G("pop-main").style.display="block";
baidu.G("pop-shadow").style.display="block";
baidu.G("pop-shadow-iframe").style.display="block";
baidu.G("pop-title").onselectstart=function(){
return false}
;
pop.resize();
baidu.on(window,"resize",pop.resize);
baidu.on(document,"onkeydown",pop.keyListener)}
}
;
function userlogin(B,A){
userlogin.onLoginSuccess=B||userlogin.defalutLoginSuccess;
userLogin()}
userlogin.defalutLoginSuccess=userlogin.onLoginSuccess=function(){
window.location.href=window.location.href.replace(/#.*$/g,"")}
;
userlogin.onLoginFailed=function(){
window.location="http://passport.baidu.com/?login&tpl=wk&u="+escape("http://baike.baidu.com/")}
;
userlogin.check=function(D,A,C){
function B(F,H,E){
if(baidu.trim(F.responseText)=="0"){
if(E){
E()}
else{
userlogin(H,C)}
return false}
if(H){
H()}
return true}
baidu.ajax.get("/api/login/?t="+(new Date()).getTime(),function(E){
B(E,D,A)}
)}
;
userlogin.userbarinit=function(){
var A=baidu.G("logout");
if(A&&(A.className!="goto-index")){
A.href="https://passport.baidu.com/?logout&u="+escape(location.href)}
}
;
userlogin.api=(function(){
var loginConfig={
immediate:true,jumpUrl:"http://baike.baidu.com/page/logincallback.html?fr=loginapi",labelName:{
password:"��\u3000�룺"}
,onSuccess:function(){
window.location=location.href.replace(/#.*/
,"")}
,onSystemError:function(){
window.location=["http://passport.baidu.com/?login","tpl=wk",("u="+escape("http://baike.baidu.com/"))].join("&")}
,container_id:"user-login-container"}
;
var loginParams={
}
;
function getPassportConfig(){
var loginUrl=["http://passport.baidu.com/api/?login","tpl=wk","callback=userlogin.api.init",("time="+new Date().getTime())].join("&");
baidu.sio.callByServer(loginUrl)}
function setConfig(conf){
baidu.object.extend(loginConfig,conf)}
function configInit(conf){
loginParams=eval(conf);
if(loginParams.error_no==1){
}
else{
baidu.sio.callByBrowser(loginParams.jslink,buildLoginPage)}
}
function buildLoginPage(){
bdPass.LoginTemplate.render(loginParams,loginConfig.container_id,loginConfig)}
return{
get:getPassportConfig,set:setConfig,init:configInit,render:buildLoginPage}
}
)();
baidu.dom.ready(userlogin.userbarinit);
function ascUpdateData(A){
if(A.length==1){
if(A[0]>=0){
baidu.G("vote_num").innerHTML=A[0];
baidu.G("vote_txt").innerHTML="�������ۣ�лл��"}
else{
if(A[0]==-1){
baidu.G("vote_txt").innerHTML="�������ۣ�лл��"}
}
}
}
lemma.getDynamicData=function(){
baidu.sio.callByBrowser("/template/baikeDynamicData.js?random="+Math.random())}
;
function ctrlBKDynamic(){
if(typeof bkDynamic!="undefined"){
var A=bkDynamic[0];
baidu.G("profileTitle").innerHTML=A;
if(!!bkDynamic[1][0]){
baidu.G("task").innerHTML="<dt><strong>"+bkDynamic[1][0]+'</strong>��<a href="'+bkDynamic[1][1][1]+'" target="_blank">'+bkDynamic[1][1][0]+'</a></dt> <dd><a href="'+bkDynamic[1][1][1]+'" target="_blank"><img src="'+bkDynamic[1][1][2]+'" width="160" height="81"></a></dd>';
baidu.show("task")}
if(!!bkDynamic[2][0]){
baidu.G("notice").innerHTML="<dt><strong>"+bkDynamic[2][0]+"</strong>��</dt>"+bkDynamic[2][1];
baidu.show("task")}
baidu.show("bkDynamic");
baidu.each(baidu.G("bkDynamic").getElementsByTagName("a"),function(C,B){
baidu.on(C,"click",function(){
nslog(this.href,235,{
index:B}
)}
)}
)}
}
function getUserInfoAsc(){
var A="/api/personalmesg?date="+new Date().getTime();
baidu.ajax.get(A,function(B){
showUserInfo(B)}
)}
function showUserInfo(xhr){
var json=eval("("+xhr.responseText+")");
baidu.G("userPic").src=json.base.avatar;
var unLen=24;
if(json.base.odp){
unLen-=4;
baidu.G("kedoutuanPic").style.display="inline"}
if(json.base.admin){
unLen-=6;
baidu.G("masterPic").style.display="inline"}
var highVersionLink=baidu.G("highVersionLink");
baidu.G("highVersionNum").innerHTML=json.base.hqVerNum;
var goodVersionLink=baidu.G("goodVersionLink");
baidu.G("goodVersionNum").innerHTML=json.base.goodVerNum;
if(json.base.hqVerNum>0){
highVersionLink.href="/uc/effort/#8"}
if(json.base.goodVerNum>0){
goodVersionLink.href="/uc/effort/#7"}
var userTitleLink=baidu.G("userTitleLink");
userTitleLink.innerHTML=json.base.username.subByte(unLen);
baidu.G("userTitlePic").className="usertitle level"+json.base.level;
baidu.G("userProcess").style.width=json.base.scorept+"%";
if(json.hotword&&json.hotword.suc){
words=json.hotword.data.words;
showHotwords();
baidu.G("hotWord").style.display="block"}
var effortObj={
notpassed:["δͨ���汾","/uc/effort/#3"],HQVersion:["�������汾","/uc/effort/#8"],goodVersion:["���ʰ汾","/uc/effort/#7"],passVersion:["��ͨ���汾","/uc/effort"]}
;
if(json.effort&&json.effort.suc){
var data=json.effort.data;
for(var i in data){
var flag=true;
break}
if(flag){
var effArr=[];
for(var i in data){
var len=32-effortObj[i][0].byteLength();
effArr.push("<li>��");
effArr.push('<a class="ef-type" href="');
effArr.push(effortObj[i][1]);
effArr.push('" target="_blank" onclick="nslog(this.href,242);
">');
effArr.push(effortObj[i][0]);
effArr.push("</a><span>��</span>");
effArr.push('<a href="http://baike.baidu.com/history/id=');
effArr.push(data[i].versionid);
effArr.push('" target="_blank">');
effArr.push(data[i].title.subByte(len));
effArr.push("</a>");
effArr.push("</li>")}
baidu.G("efforts").innerHTML=effArr.join("");
baidu.G("effort").style.display="block";
nslog(location.href,244);
baidu.each(baidu.G("effort").getElementsByTagName("a"),function(ele){
baidu.on(ele,"mousedown",function(){
nslog(this.href,243)}
)}
)}
}
baidu.G("userInfoDiv").style.display="block";
var userTip=baidu.G("userTip");
var hotHelpTip=baidu.G("hotHelpTip");
var startPos=58;
var endPos=215;
baidu.G("userTipArrow").style.left=Math.round(startPos+(endPos-startPos)*json.base.scorept/100)-4+"px";
var userProcessBack=baidu.G("userProcessBack");
baidu.on(userProcessBack,"mouseover",showTip(baidu.G("userTip")));
baidu.on(userProcessBack,"mouseout",hideTip(baidu.G("userTip")));
baidu.G("userLevel").innerHTML=json.base.level;
baidu.G("totalscore").innerHTML=json.base.totalscore;
baidu.G("scorediff").innerHTML=json.base.scorediff;
baidu.G("nextlevel").innerHTML=json.base.nextlevel;
var hotHelpE=baidu.G("hotHelp");
baidu.on(hotHelpE,"mouseover",showTip(hotHelpTip));
baidu.on(hotHelpE,"mouseout",hideTip(hotHelpTip))}
function showHotwords(){
var C=words.length||0;
var M=4;
var F=[];
while(F.length!=4){
var D=Math.round(Math.random()*(C-1));
var L=false;
for(var A=0;
A<F.length;
A++){
if(F[A]==D){
L=true;
break}
}
if(L){
continue}
F.push(D);
if(F.length==words.length){
break}
}
var E="";
var K=[];
for(var A=0;
A<4&&A<F.length;
A++){
var J=baidu.string.decodeHTML(words[F[A]].title);
var I=baidu.string.decodeHTML(words[F[A]].perfectpoints);
var B=baidu.string.decodeHTML(words[F[A]].reason);
var H=J.subByte(10);
K.push("<li>");
K.push('��<a onclick="nslog(this.href,226);
" target="_blank" href="');
K.push(words[F[A]].link+'"');
K.push(' onmouseout="hideCompleteTip();
"');
K.push(' onmouseover="showCompleteTip('+A+",'"+baidu.string.encodeHTML(J).replace(/'/g,"´
")+"','"+baidu.string.encodeHTML(I).replace(/'/g,"´
")+"');
\">");
K.push(baidu.string.encodeHTML(H));
K.push("</a>");
K.push("<span");
K.push(' onmouseout="hideHotReasonTip();
"');
K.push(' onmouseover="showHotReasonTip('+A+",'"+baidu.string.encodeHTML(B).replace(/'/g,"´
")+"');
\"");
K.push(">��");
K.push(baidu.string.encodeHTML(B.subByte(32-H.byteLength())));
K.push("</span>");
K.push("</li>")}
baidu.G("hotWords").innerHTML=K.join("")}
function showTip(A){
return function(){
if(timeout){
clearTimeout(timeout);
baidu.G("completeTip").style.display="none"}
A.style.display="block"}
}
function hideTip(A){
return function(){
A.style.display="none"}
}
function hideHotReasonTip(){
baidu.G("hotReasonTip").style.display="none"}
var timeout;
function hideCompleteTip(){
timeout=setTimeout(function(){
baidu.G("completeTip").style.display="none"}
,1000)}
function showHotReasonTip(B,C){
C=baidu.string.encodeHTML(C);
if(timeout){
clearTimeout(timeout);
baidu.G("completeTip").style.display="none"}
var A=baidu.G("hotReasonTip");
baidu.G("hotReasonTipMain").innerHTML="<p>"+C+"</p>";
A.style.top=54+B*20+"px";
A.style.display="block"}
function showCompleteTip(D,E,B){
E=baidu.string.encodeHTML(E);
B=baidu.string.encodeHTML(B);
if(timeout){
clearTimeout(timeout)}
var C=baidu.G("completeTip");
baidu.G("completeTipMain").innerHTML="<p>"+E+"</p><p><span>���Ƶ㣺</span>"+B+"</p>";
C.style.display="block";
var A=C.scrollHeight;
C.style.top=54+D*20-A-21+"px"}
baidu.dom.ready(baidumessage);
baidu.dom.ready(function(){
if(baidu.G("search")){
baidu.sio.callByBrowser("/js/sug.js")}
}
);
function userbarEvent(){
var E,D,B;
function A(I,H){
I.style.display=B?"none":"block";
I.style.left=H+"px"}
function F(H){
B&&userbarHover(H)}
function C(){
E=null;
D=null;
baidu.un(window,"unload",C)}
baidu.on(window,"resize",F);
baidu.on(document,"click",F);
baidu.on(window,"unload",C);
return function(I){
(I||window.event).cancelBubble=true;
E=E||baidu.G("usrbar");
D=D||baidu.G("nav_extra");
var J=baidu.G("my_home"),K=E.scrollHeight,H=J.offsetLeft;
H=H-6;
A(D,H);
baidu.G("usrbar").scrollWidth;
B=!B}
}
baidu.dom.ready(function(){
window.userbarHover=userbarEvent();
var A=baidu.G("my_home_container");
var B=baidu.G("nav_extra");
if(A){
baidu.on(A,"mouseover",userbarHover)}
if(B){
baidu.on(B,"mouseout",function(E){
var D=baidu.event.getPageX(E);
var H=baidu.event.getPageY(E);
var F=baidu.dom.getPosition(B);
var C=baidu.q("body",B,"div");
var C=C&&C[0];
if(C){
if(D<F.left+3||D>=F.left+parseInt(baidu.getStyle(B,"width"),10)-3||H<F.top+3||H>=baidu.dom.getPosition(C).top+C.offsetHeight-3){
if(B.style.display=="block"){
userbarHover(E)}
}
}
}
)}
}
);
var g_pop=pop;
g_pop.close=pop.hide;
CSS代码(css.css):
/* CSS Document */
body,h1,h2,h3,h4,h5,h6,p,ul,ol,li,form,img,dl,dt,dd,table,th,td,blockquote,fieldset,div,strong,label,em{margin:0;padding:0;border:0;}
p{line-height:24px;}
ul,ol,li{list-style:none;}
input,button{margin:0;font-size:12px;vertical-align:middle;}
body{font-size:12px;font-family:Arial,Helvetica,sans-serif;margin:0 auto;}
table{border-collapse:collapse;border-spacing:0;}
a{color:#3366cc;}
a:hover{color:#ef9b11;}
.text_dir{BORDER-RIGHT:#dedfe1 1px solid;PADDING-RIGHT:0px;BORDER-TOP:#dedfe1 1px solid;DISPLAY:inline;PADDING-LEFT:0px;BACKGROUND:#fff;PADDING-BOTTOM:0px;BORDER-LEFT:#dedfe1 1px solid;PADDING-TOP:0px;BORDER-BOTTOM:#dedfe1 1px solid;POSITION:relative;left:35%;;margin:20px auto;}
.text_dir P{PADDING-RIGHT:15px;PADDING-LEFT:15px;FONT-WEIGHT:bold;PADDING-BOTTOM:0px;MARGIN:12px 0px 4px;LINE-HEIGHT:30px;PADDING-TOP:0px}
.text_dir P SPAN{FONT-WEIGHT:normal;FONT-SIZE:12px;MARGIN-LEFT:5px;COLOR:#36c}
.text_dir DL{PADDING-RIGHT:20px;PADDING-LEFT:15px;BACKGROUND:#fff;PADDING-BOTTOM:20px;PADDING-TOP:0px}
.text_dir DD{PADDING-LEFT:12px;BACKGROUND:url(../images/bgs3.gif) no-repeat 2px -327px;LINE-HEIGHT:20px;POSITION:relative}
.text_dir OL{PADDING-RIGHT:0px;DISPLAY:none;PADDING-LEFT:0px;FILTER:Alpha(Opacity=10);PADDING-BOTTOM:0px;MARGIN:0px;WIDTH:100%;TEXT-INDENT:20px;PADDING-TOP:0px;LIST-STYLE-TYPE:none;opacity:.1}
.text_dir DL.arr{BACKGROUND:url(../images/word_arr.gif) #fff no-repeat right bottom}
.text_dir #holder2{BORDER-RIGHT:#dedfe1 1px solid;BORDER-TOP:#dedfe1 1px;DISPLAY:none;LEFT:-1px;BORDER-LEFT:#dedfe1 1px solid;BORDER-BOTTOM:#dedfe1 1px solid;POSITION:absolute;TOP:47px}
.text_dir .temp{PADDING-RIGHT:0px;PADDING-LEFT:0px;PADDING-BOTTOM:0px;OVERFLOW:hidden;PADDING-TOP:0px}
.text_dir .data LI{PADDING-LEFT:12px;BACKGROUND:url(../images/bgs3.gif) #fff no-repeat 2px -327px;ZOOM:1}
.text_dir .data LI LI{PADDING-RIGHT:0px;PADDING-LEFT:0px;BACKGROUND:none transparent scroll repeat 0% 0%;PADDING-BOTTOM:0px;PADDING-TOP:0px}