var BaseCookie={GetRootDomain:function(domain){var domainsplite=domain.split(".");if(domainsplite.length>2){return domainsplite[domainsplite.length-2]+"."+domainsplite[domainsplite.length-1];}else{return domain;}},ClearCookie:function(name){this.SetCookie(name," ",-3600);},SetCookie:function(name,value,expires){var expDate=new Date();expDate.setTime(expDate.getTime()+expires*1000);var domainString=this.GetRootDomain(document.domain);var expString=";expires="+expDate.toGMTString();var pathString=";path=/";var domainString=";domain="+this.GetRootDomain(document.domain);document.cookie=name+"="+encodeURIComponent(value)+expString+pathString+domainString;},GetCookie:function(name){var result=null;var myCookie=document.cookie+";";var searchName=name+"=";var startOfCookie=myCookie.indexOf(searchName);var endOfCookie;if(startOfCookie!=-1){startOfCookie+=searchName.length;endOfCookie=myCookie.indexOf(";",startOfCookie);result=myCookie.substring(startOfCookie,endOfCookie);try{result=decodeURI(result);}catch(e){result=unescape(result);}}return result;},TxBBS_GetDomain:function(domain){return this.GetRootDomain(domain);},TxBBS_SetCookie:function(name,value,expires,path,domain){var expString=((expires==null)?(""):(";expires="+expires.toGMTString()));var pathString=((path==null)?(""):(";path="+path));var domainString=((domain==null)?(""):(";domain="+domain));document.cookie=name+"="+escape(value)+expString+pathString+domainString;},TxBBS_GetCookie:function(name){return this.GetCookie(name);},TxBBS_GetParm:function(name,str){var result=null;var myStr=str+"&";var searchName=name+"=";var startOfStr=myStr.indexOf(searchName);var endOfStr;if(startOfStr!=-1){startOfStr+=searchName.length;endOfStr=myStr.indexOf("&",startOfStr);result=myStr.substring(startOfStr,endOfStr);}return result;},TxBBS_SetParm:function(val,name,str){var result="";var myStr=str+"&";var searchName=name+"=";var startOfStr=myStr.indexOf(searchName);var endOfStr;if(startOfStr!=-1){startOfStr+=searchName.length;endOfStr=myStr.indexOf("&",startOfStr);var perstr=myStr.substring(0,startOfStr);var nextstr=myStr.substring(endOfStr,myStr.length-1);result=perstr+val+nextstr;}else{if(str=="")result=str+name+"="+val;else result=str+"&"+name+"="+val;}return result;},TxBBS_ConfigCookieName:"Permission",TxBBS_CurrentUserName:function(){var str=this.TxBBS_GetCookie(this.TxBBS_ConfigCookieName);if(str!=null){var username=decodeURI(this.TxBBS_GetParm("UserName",str));return(username!=null)?username:"未登录";}else{return "未登录";}},TxBBS_LoadConfig:function(){var indivstr=this.TxBBS_GetCookie(this.TxBBS_ConfigCookieName);if(indivstr!=null){nowPageStyle=this.TxBBS_GetParm("PageStyle",indivstr);nowOpenType=this.TxBBS_GetParm("OpenType",indivstr);nowPostStyle=this.TxBBS_GetParm("PostStyle",indivstr);}},TxBBS_SaveConfig:function(pageStyle,openType,postStyle){var indivstr=this.TxBBS_GetCookie(this.TxBBS_ConfigCookieName);if(indivstr==null)indivstr="";indivstr=this.TxBBS_SetParm(pageStyle,"PageStyle",indivstr);indivstr=this.TxBBS_SetParm(openType,"OpenType",indivstr);indivstr=this.TxBBS_SetParm(postStyle,"PostStyle",indivstr);var expDate=new Date();expDate.setTime(expDate.getTime()+3600*24*365*1000);this.TxBBS_SetCookie(this.TxBBS_ConfigCookieName,indivstr,expDate,"/",this.TxBBS_GetDomain(document.domain));},TxBBS_CurrentUserID:function(){var str=this.TxBBS_GetCookie(this.TxBBS_ConfigCookieName);if(str!=null){var userid=this.TxBBS_GetParm("UserID",str);return(userid!=null)?userid:0;}else{return 0;}},TxBBS_IsHeader:function(){var str=this.TxBBS_GetCookie(this.TxBBS_ConfigCookieName);if(str!=null)return this.TxBBS_GetParm("IsHeader",str)=="True";else return false;}}
$=function(ItemId){return document.getElementById(ItemId);};String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");};WebCookie=function(){this.domain=null;this.path='/'};WebCookie.prototype={SetCookie:function(sName,sValue,expires){if (sValue==null)return;sValue=escape(sValue);var expDate = new Date();expDate.setTime(expDate.getTime()+expires*1000);var sCookie=sName+"="+encodeURIComponent(sValue);sCookie+=";expires="+expDate.toGMTString();if (this.path)sCookie+=";path="+this.path;if (this.domain)sCookie+=";domain="+this.domain;document.cookie = sCookie;},GetCookie:function(sName){var sRE = "(?:; )?"+sName+"=([^;]*);?";var oRE = new RegExp(sRE);if (oRE.test(document.cookie+';')){return unescape(decodeURIComponent(RegExp["$1"]));}return null;},deleteCookie:function(sName){var sCookie=sName+"=;expires="+(new Date(0)).toGMTString();if (this.path)sCookie+=";path="+this.path;if (this.domain)sCookie+=";domain="+this.domain;document.cookie = sCookie;}};function Ajax(){var m_xmlReq=false;if(window.XMLHttpRequest){m_xmlReq=new XMLHttpRequest();}else if(window.ActiveXObject){try {m_xmlReq=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{m_xmlReq=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){}}}this.send=function(Url,send_data,CallBack){if(!m_xmlReq) return;method="POST";m_xmlReq.open(method,Url,true);if(method=='POST') m_xmlReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');m_xmlReq.onreadystatechange=function(){if(m_xmlReq.readyState==4){if(m_xmlReq.status==200)CallBack(true,m_xmlReq.responseText);else CallBack(false);}};m_xmlReq.send(send_data.toString());}}var AjaxObject=new Ajax();document.write("<div id='TxTopDiv' style='z-Index:1000;position:absolute;top:expression(document.body.clientHeight/2-TxTopDiv.offsetHeight/2);left:expression(document.body.clientWidth/2-TxTopDiv.offsetWidth/2);behavior:url(#default#userdata);display:none;'></div>");document.write("<div id='__$mask$container' style='z-index:999;background:#cccccc;filter:Alpha(opacity=50);position:absolute;width:100%;height:100%;left:0;top:0;display:none;'></div>");var UserData={ThisObj:function(){return $("TxTopDiv");},Load:function(name){var obj=this.ThisObj();if(obj==null)return null;try{obj.load("TxMsg");return obj.getAttribute(name);}catch(e){var myCookie=new WebCookie();return myCookie.GetCookie(name);}},Save:function(name,value,expires){var obj=this.ThisObj();if(obj==null)return null;if(typeof(expires)=='number'){var d=new Date();d.setTime(d.getTime()+expires*1000);obj.expires=d.toUTCString();}obj.setAttribute(name,value);try{obj.Save("TxMsg");}catch(e){var myCookie=new WebCookie();myCookie.SetCookie(name,value,expires);}},Clear:function(){var obj=this.ThisObj();if(obj==null)return null;try{obj.load("TxMsg");obj.expires = new Date(315532799000).toUTCString();obj.Save("TxMsg");}catch(e){}}};var xmlns1999=false;try{xmlns1999=(document.getElementsByTagName("html")[0].xmlns.toLowerCase()=='http://www.w3.org/1999/xhtml')?true:false;}catch(e){}function getScroll(){var t,l,dde=document.documentElement,db=document.body;if(dde && (dde.scrollTop || dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}return {top:t,left:l};}TxOverlay=function(){this.DomObj=null;};TxOverlay.prototype={Show:function(){this.DomObj=$("__$mask$container");if(this.DomObj==null) return;this.DomObj.style.display="";this.DomObj.style.height=document.body.scrollHeight+"px";},Hide:function(){this.DomObj=$("__$mask$container");if(this.DomObj==null)return;this.DomObj.style.display='none';},Close:function(){this.DomObj=$("__$mask$container");if(this.DomObj==null)return;this.DomObj.style.display='none';CollectGarbage();}};TopPanel=function(){this.onOk=null;this.onCancel=null;this.onClose=null;this.Obj=$("TxTopDiv");};TopPanel.prototype={IsNumber:function(value){if(value==null || value=="") return false;return !isNaN(value);},CallBack:function(BackInfo){switch(BackInfo){case 1:if(this.onOk != null && typeof(this.onOk)=='function'){this.Close();this.onOk();}else{this.Close();}break;case 2:if(typeof(this.onCancel)=='function') {this.Close();this.onCancel();}break;default:this.Close();}},Process:function(Title){this.Obj=$("TxTopDiv");this.Obj.style.zIndex=1000;this.Obj.innerHTML="<div><center>";if(typeof(Title)=="string") this.Obj.innerHTML+= Title+"<br>";this.Obj.innerHTML+= "<img src='http://js.itiexue.net/com/tiexue/images/loading.gif' />";this.Obj.innerHTML+= "</center></div>";this.Obj.style.display="";this.FixCenter();},Alert:function(Title,Content,DlgWidth,fCallBack){this.onClose=this.onCancel=this.onOk=null;if(typeof(fCallBack)=='function')this.onClose=fCallBack;if(typeof(DlgWidth)=='undefined')DlgWidth=300;this.Obj=$("TxTopDiv");this.Obj.style.zIndex=1000;this.Obj.innerHTML=this.GetDlgInfo(false,Title,Content);this.Obj.style.display="";this.Obj.style.width=DlgWidth+"px";drag("TxTopDiv","DropEventObj",true);this.FixCenter();},Confirm:function(Title,Content,DlgWidth,fOkBack,fCancelBack){this.onOk=this.onCancel=this.onClose=null;if(typeof(fOkBack)=='function') this.onOk=fOkBack;if(typeof(fCancelBack)=='function') this.onClose=this.onCancel=fCancelBack;if(typeof(DlgWidth)=='undefined') DlgWidth =300;this.Obj=$("TxTopDiv");this.Obj.style.zIndex=1000;this.Obj.innerHTML=this.GetDlgInfo(true,Title,Content);this.Obj.style.display="";this.Obj.style.width=DlgWidth+"px";drag("TxTopDiv","DropEventObj",true);this.FixCenter();},CustomDlg:function(html,IsFixCenter,DragObjID,Left,Top,Width,Height){this.Obj=$("TxTopDiv");with(this.Obj){innerHTML=html;style.zIndex=1000;style.display="";if(this.IsNumber(Left))style.left=Left+"px";if(this.IsNumber(Top))style.top=Top+"px";if(this.IsNumber(Width))style.width=Width+"px";if(this.IsNumber(Height))style.height=Height+"px";}if(IsFixCenter)this.FixCenter();if(typeof(DragObjID)=='string')this.initDrag(DragObjID);},Close:function(){this.Obj=$("TxTopDiv");if(this.Obj==null)return;if(this.Obj.innerHTML=="")return;if(this.orig_scroll!=null)window.onscroll=this.orig_scroll;this.Obj.innerHTML="";this.Obj.style.display="none";if(typeof(this.onClose)=='function') this.onClose();},FixCenter:function(DragID){if(typeof DragID=='undefined')DragID="TxTopDiv";this.Obj=$(DragID);if(this.Obj==null)return;var viewpos=getScroll();if(xmlns1999){this.Obj.style.left=viewpos.left+(document.documentElement.clientWidth-this.Obj.offsetWidth)/2+"px";this.Obj.style.top=viewpos.top+(document.documentElement.clientHeight-this.Obj.offsetHeight)/2+"px";}else{this.Obj.style.left=viewpos.left+(document.body.clientWidth-this.Obj.offsetWidth)/2+"px";this.Obj.style.top=viewpos.top+(document.body.clientHeight-this.Obj.offsetHeight)/2+"px";}},ResetPanelObj:function(){if(this.Obj== null){this.Obj=$("TxTopDiv");}if(this.Obj.children.length>0){var firstChild=this.Obj.children[0];if(firstChild.getAttribute("id")=="TxTablePanel"){var parentObj1=$("TxTablePanelParent");parentObj1.innerHTML="";parentObj1.appendChild(firstChild);}else if(firstChild.getAttribute("id")=="processAlert"){var parentObj1=$("processAlertParent");parentObj1.innerHTML="";parentObj1.appendChild(firstChild);}}},GetDlgInfo:function(OkCancelInfo,Title,Content){var temp='<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">';temp+='<tr><td class="tb_lefttop"></td><td id="DropEventObj" class="tb_dlgdrop">'+Title+'</td><td class="tb_righttop"><div class="tb_closeck" style="cursor:hand" onclick="TxTopPanel.CallBack(0)"/></td></tr>';temp+= '<tr>';temp+= '<td class="tb_leftcenter"></td>';temp+= '<td class="tb_dlgcon">';temp+= this.GetDlgData(OkCancelInfo,Content);temp+= '</td>';temp+= '<td class="tb_rightcenter"></td>';temp+="</tr>";temp+='<tr><td class="tb_lbottom"></td><td class="tb_cbottom"></td><td class="tb_rbottom"></td></tr>';temp+='</table>';return temp;},GetDlgData:function(OkCancelInfo,msgInfo){var temp="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";temp+= '<tr><td class="tb_msg">'+msgInfo+'</td></tr>';temp+= "</table>";temp+= "<table  border='0' cellspacing='0' cellpadding='0' align='center'>";temp+= "<tr>";temp+= '<td class="tb_ok" onclick="TxTopPanel.CallBack(1)"></td>';if(OkCancelInfo)temp+= '<td>&nbsp;</td><td class="tb_cancel" onclick="TxTopPanel.CallBack(2)"></td>';temp+= "</tr>";temp+='</table>';return temp;}};function drag(DragObj,EventObj,fixedcenter){if(typeof DragObj=="string")DragObj=$(DragObj);if(typeof EventObj=="string") EventObj=$(EventObj);EventObj.onmousedown=function(a){if(!a)a=window.event;var d=document;var x=a.clientX-DragObj.offsetLeft;var y=a.clientY-DragObj.offsetTop;if(DragObj.setCapture)DragObj.setCapture();else if(window.captureEvents)window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);d.onmousemove=function(a){if(!a)a=window.event;var viewpos=getScroll();var left=0;if(!document.all && document.getElementById){left=a.clientX+document.body.scrollLeft-x;if(left>viewpos.left+10){if(left < document.documentElement.clientWidth-DragObj.offsetWidth+viewpos.left-10){DragObj.style.left=left;DragObj.orig_x=parseInt(DragObj.style.left)-document.body.scrollLeft;}}}else{if(xmlns1999){if(a.clientX-x<= document.documentElement.scrollLeft+10)left=document.documentElement.scrollLeft+10;else if(a.clientX-x >= document.documentElement.clientWidth-DragObj.offsetWidth+document.documentElement.scrollLeft-10) left=(document.documentElement.clientWidth-DragObj.offsetWidth+document.documentElement.scrollLeft-10);else left=a.clientX-x;}else{if(a.clientX-x<= document.body.scrollLeft+10)left=document.body.scrollLeft+10;else if(a.clientX-x >= document.body.clientWidth-DragObj.offsetWidth+document.body.scrollLeft-10)left=(document.body.clientWidth-DragObj.offsetWidth+document.body.scrollLeft-10);
else left=a.clientX-x;}DragObj.style.left=left+"px";}var top=a.clientY-y;if(top>viewpos.top+5){if(xmlns1999){if(top < document.documentElement.clientHeight-DragObj.offsetHeight+viewpos.top-5) DragObj.style.top=top+"px";}else{if(top < document.body.clientHeight-DragObj.offsetHeight+viewpos.top-5) DragObj.style.top=top+"px";}}};d.onmouseup=function(){if(DragObj.releaseCapture)DragObj.releaseCapture();else if(window.captureEvents)window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);d.onmousemove=null;d.onmouseup=null;}}
if(fixedcenter){var orig_scroll=null;if(window.onscroll) orig_scroll=window.onscroll;window.onscroll=function(){if(orig_scroll!=null) orig_scroll();var viewpos=getScroll();if(xmlns1999){DragObj.style.left=viewpos.left+(document.documentElement.clientWidth -DragObj.offsetWidth)/2+"px";DragObj.style.top=viewpos.top+(document.documentElement.clientHeight-DragObj.offsetHeight)/2+"px";}else{DragObj.style.left=viewpos.left+(document.body.clientWidth -DragObj.offsetWidth)/2+"px";DragObj.style.top=viewpos.top+(document.body.clientHeight-DragObj.offsetHeight)/2+"px";}}}}
var TxTopPanel=new TopPanel();var layObj=null;
function TxAlert(Msg,width,islay){if(typeof(width)=='undifined' || width==null)width=225;if(layObj==null) layObj=new TxOverlay();if(islay)layObj.Show();TxTopPanel.Alert('提示',Msg,225,function(){layObj.Close();});}
function TxConfirm(Msg,callBack,callBackCance,width,islay){if(typeof(width)=='undifined' || width==null)width=225;if(layObj==null) layObj=new TxOverlay();if(islay==true)layObj.Show();TxTopPanel.Confirm('提示确认',Msg,225,function(){layObj.Close();if(typeof(callBack)=='function')callBack();},function(){layObj.Close();if(typeof(callBackCance)=='function')callBackCance();});}
function TxProcessShow(Title,islay){if(layObj==null) layObj=new TxOverlay();if(islay==true)layObj.Show();TxTopPanel.Process(Title);}
function TxProcessHide(){TxTopPanel.Close();if(layObj != null)layObj.Close();}
function CustomDlg(CustomDivID){this.DragObjID='DragObjID';this.CustomObj=null;this.CustomDivID=CustomDivID;if(typeof CustomDivID=='string')this.CustomObj=$(CustomDivID);else{this.CustomObj=CustomDivID;this.CustomDivID=this.CustomObj.getAttribute("id");}this.moveObj=null;this.orig_scroll=null;this.DraggableFlag=true;
var arr=navigator.appVersion.split("MSIE");if(arr.length==2){var version=parseFloat(arr[1]);if(version<7)this.DraggableFlag=false;}}CustomDlg.prototype={Show:function(html,IsFixCenter){with(this.CustomObj){innerHTML=html;style.display="";if(IsFixCenter) TxTopPanel.FixCenter(this.CustomDivID);if(this.DraggableFlag) drag(this.CustomDivID,this.DragObjID,true);}},
Close:function(){if(this.CustomObj.innerHTML=="")return;if(this.orig_scroll!=null)window.onscroll=this.orig_scroll;this.CustomObj.innerHTML="";this.CustomObj.style.display="none";this.moveObj=null;CollectGarbage();},
YUIShow:function(Subject,Content,Width){if(typeof(Width)=='undefined') Width='430px';var temp="<div style='visibility:visible;' class='tb_dd_demo'>";temp+="<div style='width:"+Width+";'>";temp+="<div id='"+this.DragObjID+"' class='tb_hd'";if(this.DraggableFlag) temp+=" style='cursor: move'";temp+='><div class="tb_container_close" id="YUICloseBt"></div>';temp+="	<div class='tl'></div>";temp+="	<div class='tb_tm'>"+Subject+"</div>";
temp+="	<div class='tr'></div>";temp+="</div>";temp+="	<div class='tb_bd'>";temp+=Content;temp+="</div>";temp+="</div>";temp+="</div>";this.Show(temp,true);temp=null;var o=this;$("YUICloseBt").onclick=function(){o.Close();}}}
function TxTB_getRandom(){return Math.round(Math.random()*100000);}function TxSetInnerHtml(AdID,infoHtml){var obj = $(AdID);if (obj != null){if (infoHtml==null){obj.style.display = 'none';}else{obj.innerHTML = infoHtml;return true;}}return false;}function DateToStr(CurTime){return CurTime.getFullYear()+'-'+(CurTime.getMonth()+1)+'-'+CurTime.getDate()+' '+CurTime.getHours()+':'+CurTime.getMinutes()+':'+CurTime.getSeconds();}
function StrToDate(CompareTime){var reg=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;var r=CompareTime.match(reg);if(r==null)return new Date('1980','0','1','0','0','0');else return new Date(r[1], r[3]-1,r[4],r[5],r[6],r[7]);}
function getIEPosX(elt) { return getIEPos(elt,"Left"); }function getIEPosY(elt) { return getIEPos(elt,"Top");}function getIEPos(elt,which){var iPos=0;while (elt!=null){iPos+=elt["offset"+which];elt=elt.offsetParent;}return iPos;}
var TxCallList=new Array();function TxAddCallFun(CallBack){TxCallList[TxCallList.length]=CallBack;}function TxCallFun(){for (var i=0;i<TxCallList.length;i++)TxCallList[i]();}
function AddOnLoad(CallFun){var oldOnLoad=window.onload;if(typeof window.onload != 'function'){window.onload=CallFun;}else{window.onload=function(){oldOnLoad();CallFun();}}}

var CDomain=BaseCookie.GetRootDomain(document.domain);var FriendConfig={GoodFriendUrl:"http://i."+CDomain+"/js/InfoBar.aspx?FunName=GetMyFriend&num=10",AddDelFriendUrl:"http://i."+CDomain+"/AddDeleteFriend.aspx?UserID=",AddMyFriendUrl:"http://i."+CDomain+"/AddFriendByName.aspx",JudgeFriendUrl:"http://i."+CDomain+"/JudgeFriend.aspx?UserID=",OverTime:43200,RefreshDataTime:10};
var MsgConfig={NewInfoUrl:"http://msg."+CDomain+"/Out/ToolBar.aspx",ReadNewMsgUrl:"http://msg."+CDomain+"/Out/ReadNote.aspx",SendMsgUrl:"http://msg."+CDomain+"/Out/SendMsg.aspx",ValidateUrl:"http://msg."+CDomain+"/Dlg/Validate.aspx",RefreshMsgTimeLength:1,RefreshDataTime:10};
var GroupConfig={MyGroupUrl:"http://i."+CDomain+"/js/InfoBar.aspx?FunName=GetMyGroup&num=10",AddGroupUrl:"http://group."+CDomain+"/XmlHttp/g_addmemberByGroupName.aspx",AddGroupUrlByID:"http://group."+CDomain+"/XmlHttp/g_addmemberByGroupID.aspx"};
try{document.domain=CDomain;}catch(e){}
document.write("<div id='TxCustomDiv' style='z-Index:998;position:absolute;display:none;'></div>");
document.write("<script language=\"javascript\" id=\"TxMsgJs\"></script><script language=\"javascript\" id=\"TxGroupJs\"></script><script language=\"javascript\" id=\"TxFriendJs\"></script>");
var TxCustomDlg=null;var FriendInfo=null;GoodFriend=function(){this.IsGetting=false;this.CacheData="";this.CallBack=null;this.oIntervalCache=null;this.GetMyFriends();}
TxGetMyFriends=function(){if(FriendInfo!=null)FriendInfo.GetMyFriends();};
Tx_GetMyFriendFun=function(value){UserData.Save("TxFriends",(value=="")?"null":value,FriendConfig.OverTime*60);if(FriendInfo==null)return;FriendInfo.CacheData=value;FriendInfo.IsGetting=false;	if(FriendInfo.CallBack!=null){if(typeof FriendInfo.CallBack=='function')FriendInfo.CallBack(value);}}
GoodFriend.prototype={RunTimer:function(AutoDetect,callBackFun){this.CallBack=callBackFun;if(AutoDetect){if(this.oIntervalCache==null){this.oIntervalCache=window.setInterval("TxGetMyFriends()",FriendConfig.RefreshDataTime*1000);}}else{if(this.oIntervalCache!=null){window.clearInterval(this.oIntervalCache);this.oIntervalCache=null;}}},SendSubmit:function(){var obj=$("TxAddUserName");var UserName=obj.value;if(UserName==""){TxAlert('好友名不能为空');return;}this.AddMyFriend(UserName);},OpenAddDlg:function(UserName,CallBack){this.CallBack=CallBack;if(TxCustomDlg==null)TxCustomDlg=new CustomDlg("TxCustomDiv");var SendHtmlData='<table cellSpacing="0" cellPadding="0" height="100%" border="0" align="center">';SendHtmlData+='<tr><td colspan="3"></td></tr>';SendHtmlData+='<tr>';SendHtmlData+='	<td colspan="2" noWrap>添加登录名：<input id="TxAddUserName" class="inp" style="WIDTH:110px;HEIGHT: 15px" maxLength="80" NAME="TxAddUserName"></td>';SendHtmlData+='</tr>';SendHtmlData+='<tr>';SendHtmlData+='	<td vAlign="middle" align="center" colSpan="3" height="40px">';SendHtmlData+='		<INPUT id="AddFriendBt" type="button" value="添加" onClick="FriendInfo.SendSubmit();">&nbsp;';SendHtmlData+='		<INPUT id="CancelAddBt" type="button" value="取消" onClick="TxCustomDlg.Close()">&nbsp;';SendHtmlData+='	</td>';SendHtmlData+='</tr>';SendHtmlData+='</table>';TxCustomDlg.YUIShow("添加好友",SendHtmlData,'225px');},AddMyFriend:function(UserName){var sUrl="agent.aspx?desturl="+encodeURIComponent(FriendConfig.AddMyFriendUrl);var postData="UserName="+encodeURIComponent(UserName);AjaxObject.send(sUrl,postData,function(succeed,responseText){TxProcessHide();TxCustomDlg.Close();if(succeed){if(FriendInfo.CallBack!=null)FriendInfo.CallBack(responseText);else TxAlert(responseText);}else TxAlert("添加好友失败");});TxProcessShow("正在加好友,请等待...",true);},AddDelMyFriend:function(UserID,CallBack,UserName){var sUrl="agent.aspx?desturl="+encodeURIComponent(FriendConfig.JudgeFriendUrl+UserID+"&rd="+Math.random());AjaxObject.send(sUrl,"",function(succeed,responseText){TxProcessHide();if(TxCustomDlg!=null)TxCustomDlg.Close();if(succeed){var msg="";if(responseText!=""){var temp=responseText.split('|');var isFailure=false;if(temp[1]==1){msg="已经是好友，确定删除好友"+UserName+"？";}else if(temp[1]==0){msg="确定添加"+UserName+"为好友？";}else{msg=temp[2];isFailure=true;}}else{msg="服务器错误,请重试!";isFailure=true;}if(!isFailure){function ClickOK(){var sUrl="agent.aspx?desturl="+encodeURIComponent(FriendConfig.AddDelFriendUrl+UserID+"&rd="+Math.random());AjaxObject.send(sUrl,"",function(succeed,responseText){TxProcessHide();if(succeed){if(CallBack!=null)CallBack(responseText,UserID);else TxAlert(responseText);}else{TxAlert("服务器错误,请重试!");}});TxProcessShow("正在操作,请等待...",true);}TxConfirm(msg,ClickOK);}else TxAlert(msg);}else TxAlert("发送短信失败");});TxProcessShow("正在操作,请等待...",true);},GetMyFriendsFromServer:function(){var TxTB_UserID=BaseCookie.TxBBS_CurrentUserID();if(TxTB_UserID==0)return;var objJs=$("TxFriendJs");if(objJs!=null){if(this.IsGetting)return;var Url=FriendConfig.GoodFriendUrl;$("TxFriendJs").src=FriendConfig.GoodFriendUrl+'&tmp='+TxTB_getRandom();this.IsGetting=true;}},GetMyFriends:function(){var TxTB_UserID=BaseCookie.TxBBS_CurrentUserID();if(TxTB_UserID==0)return;var temp=UserData.Load("TxFriends");if(temp==null){this.GetMyFriendsFromServer();return this.CacheData;}if(temp=="null")temp="";this.CacheData=temp;return this.CacheData;},ClearCookie:function(){UserData.Clear();this.CacheData="";}}
var cswmTI="";var RollPlace=0;function ClearPanel(){var obj=$("PopupPanel");if(obj!=null)obj.outerHTML="";}function HideMenu(){cswmTI=setTimeout("ClearPanel()",700);}function StopHideMenu(){clearTimeout(cswmTI);}
function SetFriendFaceMenu(isShow,objID){var obj=$(objID);if(isShow){obj.className="area2_hy_4";obj.style.display='';}else{obj.style.display='none';}}
OnClickEvent=function(thisObj,uID,uName){if(document.all){if(document.readyState != "complete") return;}var userID=uID;var userName=uName;var obj=$("PopupPanel");if(obj==null){obj=document.createElement("div");obj.className="menu";obj.id="PopupPanel";obj.onclick=function(){this.outerHTML="";};obj.onmouseout=function(){HideMenu();};obj.onmouseover=function(){StopHideMenu();};obj.onblur=function(){this.outerHTML="";};document.body.appendChild(obj);}var temp='<A class="menuItem" href="javascript:FriendInfo.AddDelMyFriend('+userID+',AddDelFriendCallBack,\''+ userName +'\')">删除好友</A>';temp+="<A class='menuItem' href='javascript:DlgInfo.CreateInfo(\""+userName+"\")'>发送短信</A>";
temp+='<A class="menuItem" href="http://'+ userID+'.i.tiexue.net" target="_blank">个人中心</A>';temp+='<A class="menuItem" href="http://'+ userID+'.i.tiexue.net/blog/" target="_blank">博客</A>';obj.innerHTML=temp;
var top=getIEPosY(thisObj);var left=getIEPosX(thisObj);obj.style.left=left-80+"px";obj.style.top=top+98-RollPlace+"px";obj.style.visibility="visible";HideMenu();};
function AddDelFriendCallBack(value,uId){if(value.indexOf('成功删除')==0 && uId != null && uId != "" && $("Friend"+uId) != null && $("Friend"+uId) != undefined){$("Friend"+uId).outerHTML="";FriendInfo.ClearCookie();FriendInfo.GetMyFriendsFromServer();}TxAlert(value);}
OnClickEventHome=function(thisObj,uID,uName){if(document.all){if(document.readyState!="complete")return;}var userID=uID;var userName=uName;var obj=$("PopupPanel");if(obj==null){obj=document.createElement("div");obj.className="menu";obj.id="PopupPanel";obj.onclick=function(){this.outerHTML="";};obj.onmouseout=function(){HideMenu();};obj.onmouseover=function(){StopHideMenu();};obj.onblur=function(){this.outerHTML="";};document.body.appendChild(obj);}var temp='<A class="menuItem" style="white-space:nowrap;" href="javascript:void(0)" onclick="FriendInfo.AddDelMyFriend('+userID+',AddDelFriendCallBack,\''+ userName +'\')">添加(删除)好友</A>';temp+="<A class='menuItem' href='javascript:void(0)' onclick='DlgInfo.CreateInfo(\""+userName+"\")'>发送短信</A>";temp+='<A class="menuItem" href="http://'+ userID+'.i.tiexue.net" target="_blank">个人中心</A>';temp+='<A class="menuItem" href="http://'+ userID+'.i.tiexue.net/blog/" target="_blank">博客</A>';obj.innerHTML=temp;var top=getIEPosY(thisObj);var left=getIEPosX(thisObj);obj.style.left=left-60+"px";obj.style.top=top+50+"px";obj.style.visibility="visible";HideMenu();};

var DlgInfo=null;MsgDlgInfo=function(AutoDetect,callBackFun){this.CallBack=callBackFun;this.oIntervalCache=null;this.NewInfoCount=0;this.UpdateInfo=true;this.Tx_GetMsgCount_Cache();if(FriendInfo==null)FriendInfo=new GoodFriend()};function Tx_NewMsgFeedback(Count){BaseCookie.SetCookie("TxMsgNew",Count,3600*24);BaseCookie.SetCookie("TxMsgAvail","1",MsgConfig.RefreshMsgTimeLength*60);if(DlgInfo==null)return;DlgInfo.NewInfoCount=Count;if(typeof DlgInfo.CallBack=='function'){DlgInfo.CallBack(Count)}}
MsgDlgInfo.prototype={RunTimer:function(AutoDetect){if(AutoDetect){if(this.oIntervalCache==null){DlgInfo.Tx_GetMsgCount_Cache();this.oIntervalCache=window.setInterval("DlgInfo.Tx_GetMsgCount_Cache()",MsgConfig.RefreshDataTime * 1000);}}else{if(this.oIntervalCache!=null){window.clearInterval(this.oIntervalCache);this.oIntervalCache=null;}}},

ReadOneInfo:function(){var temp=BaseCookie.GetCookie("TxMsgNew");if(temp==null){BaseCookie.SetCookie("TxMsgNew","0",3600*24);this.Tx_GetMsgCount_Server();return;}if(temp=="")temp="0";this.NewInfoCount=parseInt(temp);if(this.NewInfoCount>0) this.NewInfoCount--;BaseCookie.SetCookie("TxMsgNew",this.NewInfoCount,3600*24);if(typeof this.CallBack=='function'){this.CallBack(this.NewInfoCount);}},
ClearCookie:function(){this.NewInfoCount=0;BaseCookie.ClearCookie("TxMsgNew");BaseCookie.ClearCookie("TxMsgAvail");},InitPanel:function(){},GetJsObj:function(JsName){var objJs=$(JsName);if(objJs==null){var IsFinish=true;if(document.all){if(document.readyState!="complete") IsFinish=false;}if(!IsFinish) return null;var objJs=document.createElement("script");objJs.setAttribute("id",JsName);objJs.setAttribute("language","javascript");try{document.body.appendChild(objJs);}catch(e){return;}}return objJs;},
Tx_GetMsgCount_Server:function(){if(document.readyState!="complete")return false;var objJs=this.GetJsObj("TxMsgJs");if(objJs==null)return false;var TxTB_UserID=BaseCookie.TxBBS_CurrentUserID();if(TxTB_UserID==0) return;var Url=MsgConfig.NewInfoUrl+"?tmp="+Math.round(Math.random()*10000);objJs.src=Url;return true;},
Tx_GetMsgCount_Cache:function(){var temp=BaseCookie.GetCookie("TxMsgAvail");if(temp==null){if(this.Tx_GetMsgCount_Server())BaseCookie.SetCookie("TxMsgAvail","0",MsgConfig.RefreshMsgTimeLength*60);return;}var temp=BaseCookie.GetCookie("TxMsgNew");if(temp==null){BaseCookie.SetCookie("TxMsgNew","0",3600*24);this.Tx_GetMsgCount_Server();return;}if(temp=="")temp="0";var Count=parseInt(temp);var NeedUpdate=(this.NewInfoCount != Count || this.UpdateInfo);this.NewInfoCount=Count;if(NeedUpdate){this.UpdateInfo=true;try{this.CallBack(Count);this.UpdateInfo=false;}catch(e){}}},GetNewInfo:function(){this.Tx_GetMsgCount_Server();},NewInfoSum:function(){return this.NewInfoCount;},CreateInfo:function(UserName,Title,Content){if(TxCustomDlg==null) TxCustomDlg=new CustomDlg("TxCustomDiv");var inputBoxHeight=20;if(xmlns1999) inputBoxHeight=15;var temp='<form id="thisForm" name="thisForm" method="post" action="return false"><table cellSpacing="0" cellPadding="0" width="97%" height="100%" border="0" align="center"><tr><td noWrap width="52">收件人：</td>';temp+='<td noWrap width="214"><input id="UserList" name="UserList" title="收件人" value="'+((UserName!=null)?UserName:'')+'" onKeyUp="SendTo_onkeyup()" style="width:210px;height:'+inputBoxHeight+'px" maxLength="60" size="100" class="inputInfo"/></td><td><select onChange="return SelGoodFriend()" ID="SelUser" NAME="SelUser" class="inputInfo"><option value="-1" selected>--选好友--</option></select></td>';temp+='</tr><tr><td colspan="3"></td></tr><tr><td noWrap>主题：</td>';temp+='	<td colspan="2" noWrap align="left"><input id="Title" name="Title" value="'+((Title!=null)?Title:'')+'" style="width:210px;height:'+inputBoxHeight+'px" maxLength="80" class="inputInfo"></td></tr>';temp+='<tr><td align="center" colspan="3"><textarea title="键入短信文本内容" style="WIDTH:97%;height:180px;" name="msgContent" rows="12" cols="60" ID="msgContent">'+((Content!=null)?Content:'')+'</textarea></td></tr>';temp+='<tr>';temp+='	<td colspan="3" align="left"><input type="checkbox" value="on" ID="ToSendedCheck" NAME="ToSendedCheck">将发送短信保存到“已发送的”中&nbsp;</td>';temp+='</tr>';temp+='<tr><td height="12" colspan="3" valign="bottom" align="left">';inputBoxHeight=22;if(xmlns1999) inputBoxHeight=17;temp+='	验证码:<INPUT id="ValidateCode" style="width:72px;height:'+inputBoxHeight+'px" NAME="ValidateCode" class="inputInfo"> <img id="MsgCodeImage" alt="" src="" align="absMiddle" border="0">&nbsp;';temp+='		<input type="button" value="刷新验证码" onClick="RefreshMsgCode()" ID="RefreshCodeBt" class="inputInfo" style="cursor:hand">';temp+='</td>';temp+='</tr>';temp+='<tr><td colSpan="3" align="left"><b>说明</b>：&nbsp;&nbsp;标题最多<b>50</b>个字符，内容最多<b>500</b>个字符</td></tr>';temp+='<tr><td vAlign="middle" align="center" colSpan="3">';temp+='		<input id="SendMsgBt" type="button" value="发送短信" onClick="SendSubmit(null);" class="inputInfo" style="cursor:hand">&nbsp;';temp+='<input id="SaveMsgBt" type="button" value="保存短信" onClick="SendSubmit(-1);" class="inputInfo" style="cursor:hand">&nbsp;</td>';temp+='</tr>';temp+='</table>';temp+='</form>';TxCustomDlg.YUIShow("发送短信",temp);RefreshMsgCode();var temp=FriendInfo.GetMyFriends();if(temp!="")Tx_FillFriendData(temp);temp=null;},ReadNoteDlg:function(MsgID){if(TxCustomDlg==null) TxCustomDlg=new CustomDlg("TxCustomDiv");var temp=MsgConfig.ReadNewMsgUrl;if(typeof(MsgID)!='undefined')	temp=MsgConfig.ReadNewMsgUrl+"?MsgID="+MsgID;TxProcessShow("正在读取,请等待...");temp="<iframe src=\""+temp+"\" scrolling=\"no\" width=\"100%\" height=\"330px\" frameborder=\"0\" onload=\"TxProcessHide()\"></iframe>";TxCustomDlg.YUIShow("读短信",temp);},
ReadNewMsg:function(){if(TxCustomDlg==null) TxCustomDlg=new CustomDlg("TxCustomDiv");if(this.NewInfoCount==0){TxAlert('没有新的短信消息！');return;}this.ReadNoteDlg();},
ReadMsg:function(MsgID){if(TxCustomDlg==null)TxCustomDlg=new CustomDlg("TxCustomDiv");this.ReadNoteDlg(MsgID);},CloseWindow:function(){if(TxCustomDlg!=null) TxCustomDlg.Close();}};function TxMsgCloseWindow(){DlgInfo.CloseWindow();}function RefreshMsgCode(){$("MsgCodeImage").src=MsgConfig.ValidateUrl+'?tmp='+Math.random();}function Tx_FillFriendData(value){var FriendID,Friend;if(value!=""){var tempArr;var arr=value.split(";");try{with(thisForm){while(SelUser.options.length>0) SelUser.remove(0);SelUser.options.add(new Option("--选择好友--",-1));for (var i=0;i<arr.length;i++){tempArr=arr[i].split(",");FriendID=tempArr[0];Friend=tempArr[1];SelUser.options.add(new Option(Friend,FriendID));}}}catch(e){}}}function SelGoodFriend(){with(thisForm){if(SelUser.selectedIndex==0){if(SelUser.options[SelUser.selectedIndex].value==-1)return;}FriendName=SelUser.options[SelUser.selectedIndex].text;if(UserList.value=="")UserList.value=FriendName;else{if(UserList.value.indexOf(FriendName)==-1)UserList.value+=","+FriendName;}}}
function SendTo_onkeyup(){with(thisForm){var indata=UserList.value;if(indata==""){if(event.keyCode ==13 && SelUser.selectedIndex!=0){UserList.value=SelUser.options[SelUser.selectedIndex].text;}return;}for(i=0;i<SelUser.length;i++){temp=SelUser.options[i].text;if(temp==indata){SelUser.options[i].selected=true;break;}if(temp.indexOf(indata)!=-1){SelUser.options[i].selected=true;}}}}
function SendSubmit(MsgID){with(thisForm){if(UserList.value==""){TxAlert('收件人不能为空值!');return;}if(Title.value==""){TxAlert('标题不能为空值!');return;}if(msgContent.value==""){TxAlert('正文不能为空值');return;}if(ValidateCode.value==""){TxAlert("验证码不能为空值");return;}SendMsgExecute(MsgID,UserList.value,Title.value,msgContent.value,ValidateCode.value,ToSendedCheck.checked);}}
function SendMsgExecute(MsgID,UserList,Title,Content,ValidateCode,ToSended){var sUrl="agent.aspx?desturl="+encodeURIComponent(MsgConfig.SendMsgUrl);var postData="UserList="+encodeURIComponent(UserList);if(MsgID!=null) postData+="&MsgID="+MsgID;postData+="&ToSendedCheck="+ToSended;postData+="&Title="+encodeURIComponent(Title);postData+="&Content="+encodeURIComponent(Content);postData+="&ValidateCode="+ValidateCode;AjaxObject.send(sUrl,postData,function(succeed,responseText){TxProcessHide();TxCustomDlg.Close();if(succeed){if(responseText!="true"){TxAlert(responseText);}else{TxAlert('短信发送成功！');}}else TxAlert("发送短信失败");});TxProcessShow("发送中,请等待...",true);}
function OpenSendDlg(UserName,Title,Content){DlgInfo.CloseWindow();DlgInfo.CreateInfo(UserName,Title,Content);}var MyGroupInfo=null;MyGroupClass=function(){this.CacheData=null;this.CallBack=null;this.GetMyGroups();};TxGetMyGroups=function(){if(MyGroupInfo!=null){MyGroupInfo.GetMyGroups();}}
Tx_GetMyGroupFun=function(value){UserData.Save("TxGroups",(value=="")?"null":value,FriendConfig.OverTime*60);if(MyGroupInfo!=null){MyGroupInfo.CacheData=value;if(MyGroupInfo.CallBack!=null)MyGroupInfo.CallBack(value);}}
MyGroupClass.prototype={OpenAddDlg:function(UserName,CallBack){this.CallBack=CallBack;if(TxCustomDlg==null)TxCustomDlg=new CustomDlg("TxCustomDiv");var SendHtmlData='<table cellSpacing="0" cellPadding="0" width="97%" height="100%" border="0" align="center">';SendHtmlData+='<tr><td colspan="3"></td></tr>';SendHtmlData+='<tr><td noWrap>添加公社：</td><td colspan="2" noWrap><input id="TxAddGroupName" class="inp" maxLength="80"></td></tr>';SendHtmlData+='<tr>';SendHtmlData+=' <td vAlign="middle" align="center" colSpan="3" height="40px"><INPUT id="AddGroupBt" type="button" value="添加" onClick="MyGroupInfo.SendSubmit();"> <INPUT id="CancelAddBt" type="button" value="取消" onClick="TxCustomDlg.Close()"> </td>';SendHtmlData+='</tr>';SendHtmlData+='</table>';TxCustomDlg.YUIShow("<font size ='2'>我的公社--添加操作</font>",SendHtmlData,'225px')},SendSubmit:function(){var GroupName=$("TxAddGroupName").value;if(GroupName==""){TxAlert('公社名为空！');return}this.AddMyGroup(GroupName)},AddMyGroup:function(GroupName){var sUrl="agent.aspx?desturl="+encodeURIComponent(GroupConfig.AddGroupUrl);var postData="GroupName="+encodeURIComponent(GroupName);AjaxObject.send(sUrl,postData,function(succeed,responseText){TxProcessHide();TxCustomDlg.Close();if(succeed){if(MyGroupInfo.CallBack!=null)MyGroupInfo.CallBack(responseText);else TxAlert(responseText)}else TxAlert("加入公社失败")});TxProcessShow("正在加入公社,请等待...",true)},AddMyGroupByID:function(GroupID){if(TxCustomDlg==null)TxCustomDlg=new CustomDlg("TxCustomDiv");var sUrl="agent.aspx?desturl="+encodeURIComponent(GroupConfig.AddGroupUrlByID);var postData="GroupID="+encodeURIComponent(GroupID);AjaxObject.send(sUrl,postData,function(succeed,responseText){TxProcessHide();TxCustomDlg.Close();if(succeed){if(MyGroupInfo.CallBack!=null)MyGroupInfo.CallBack(responseText);else TxAlert(responseText)}else TxAlert("加入公社失败")});TxProcessShow("正在加入公社,请等待...",true)},GetMyGroupsFromServer:function(){var TxTB_UserID=BaseCookie.TxBBS_CurrentUserID();if(TxTB_UserID==0)return;var objJs=$("TxGroupJs");if(objJs!=null){if(objJs.src==''){UserData.Save("TxGroups","null",FriendConfig.OverTime*60);var Url=GroupConfig.MyGroupUrl;Url+="&tmp="+Math.round(Math.random()*10000);objJs.src=Url}}},GetMyGroups:function(){var temp=UserData.Load("TxGroups");if(temp==null){this.GetMyGroupsFromServer();return this.CacheData}if(temp=="null")temp="";this.CacheData=temp;return this.CacheData},ClearCookie:function(){UserData.Clear();this.CacheData=""}}

var Config={
	ReadPagePath:"http://msg."+CDomain+"/Out/ReadNote.aspx",
	EditInfo:"http://msg."+CDomain+"/Out/EditNote.htm",
	GroupRootPath:"http://group.tiexue.net/",
	HelpPath:"http://help.tiexue.net/",
	TxRegPath:"http://reg.tiexue.net/js/loginbar.aspx",
	//TxComLoginPath:"http://reg.tiexue.com/CrossDomainLogin.aspx",
	TxJpLoginPath:"http://reg.junph.com/CrossDomainLogin.aspx",
	TxCarLoginPath:"http://reg.qichelian.com/CrossDomainLogin.aspx"
}
var TxChildMenu=new Object();TxChildMenu.navigation=new Array();TxChildMenu.group=new Array();TxChildMenu.friend=new Array();TxChildMenu.finance=new Array();TxChildMenu.setting=new Array();
TxChildMenu.navigation[0]= "铁血军事,http://mil.tiexue.net/,_self,images/toolbar/mil.gif";TxChildMenu.navigation[1]= "社区论坛,http://bbs.tiexue.net/,_self,images/toolbar/bbs.gif";TxChildMenu.navigation[2]= "铁血读书,http://bbs.tiexue.net/,_self,images/toolbar/book.gif";TxChildMenu.navigation[3]= "铁血图鉴,http://pic.tiexue.net/,_self,images/toolbar/pic.gif";TxChildMenu.navigation[4]= "辩论平台,http://argue.tiexue.net/,_self,images/toolbar/argue.gif";TxChildMenu.navigation[5]= "铁血公社,http://group.tiexue.net/,_self,images/toolbar/blog.gif";TxChildMenu.navigation[6]= "短信中心,http://msg.tiexue.net/,_blank,images/toolbar/message.gif";TxChildMenu.navigation[7]= "休闲小游戏,http://game.tiexue.net/,_blank,images/toolbar/game.gif";
TxChildMenu.finance[0]= "银行账户,http://i.tiexue.net/BankDefault.aspx,_self,images/toolbar/bank.gif";TxChildMenu.finance[1]= "购买金币,http://pay.tiexue.net,_blank,images/toolbar/gold.gif";TxChildMenu.finance[2]= "劳动力市场,http://market.tiexue.net,_blank,images/toolbar/market.gif";
TxChildMenu.setting[0]= "个人信息,http://i.tiexue.net/BasicData.aspx,_self,images/toolbar/info.gif";TxChildMenu.setting[1]= "修改头像,http://i.tiexue.net/UserAvatarNativeNew.aspx,_self,images/toolbar/face.gif";TxChildMenu.setting[2]= "修改密码,http://i.tiexue.net/ModPassword.aspx,_self,images/toolbar/pwd.gif";TxChildMenu.setting[3]= "修改信箱,http://i.tiexue.net/ModEmail.aspx,_self,images/toolbar/mail.gif";TxChildMenu.setting[4]= "找回密码,http://reg.tiexue.net/FindPassWord.aspx,_self,images/toolbar/mail.gif";
document.write("<script language=\"javascript\" id=\"TxNoteJs\"></script>");

var Tx_GroupList,Tx_FriendList;
var TxTB_UserID=0;
var TxTB_UserName="";
try{TxTB_UserID=BaseCookie.TxBBS_CurrentUserID();TxTB_UserName=BaseCookie.TxBBS_CurrentUserName();}catch(e){}

var Tx_NewMsgCount=0;
function TxTB_ReadNoteInfo(){if(Tx_NewMsgCount < 1)return;if(DlgInfo==null) TxToolbarLoad();DlgInfo.ReadNewMsg();}function TxTB_EditNewNote(UserName){if(DlgInfo==null) TxToolbarLoad();DlgInfo.CreateInfo(UserName);}
function TxTB_UserLogin(){
	if (_UserName.value.length < 1){
		alert("用户ID不能为空");_UserName.focus();return;
	}else if(_Password.value.length<1){
		alert("密码不能为空"); _Password.focus();return;
	}
	var temp="FunName=Login&LoginName="+escape(_UserName.value)+"&Password="+_Password.value+"&ExpDT="+ExpDT.value;
	if ($("ValidateCodeInfo").style.display=='')temp+='&ValidateCode='+_ValidateCode.value;else temp+='&tmp='+TxTB_getRandom();

	$("TxMsgJs").src=Config.TxRegPath+"?"+temp;
}

function TxTB_OtherLogin(){
	var temp="FunName=Login&LoginName="+escape(_UserName.value)+"&Password="+_Password.value+"&ExpDT="+ExpDT.value+'&tmp='+TxTB_getRandom();
	$("TxMsgJs").src=Config.TxJpLoginPath+"?"+temp;	//TxFriendJs
	//$("TxNoteJs").src=Config.TxComLoginPath+"?"+temp;
	$("TxGroupJs").src = Config.TxCarLoginPath + "?" + temp;
}

function RefreshValidCode(){
	var url = 'http://reg.'+CDomain+'/Validate.aspx?UserName='+escape(_UserName.value)+'&tmp='+TxTB_getRandom();
	$("ValidateCodeImg").src=url;
}

function Tx_LoginFun(value){
	if(value!=""){
		var arr=value.split("|");
		if(arr.length>1){
			if(arr[0]=="true"){
				TxTB_UserID=BaseCookie.TxBBS_CurrentUserID();
				TxTB_UserName=BaseCookie.TxBBS_CurrentUserName();
				Tx_clearMenu();
				ResetUserLoginStatus();
				TxTB_RefreshMenu();
				
				window.setTimeout("TxTB_OtherLogin()",3000);
			}else{
				if (arr[1].indexOf('验证码')!=-1){
					$("ValidateCodeInfo").style.display='';
					RefreshValidCode();
					alert('此账号已经发生多次无效登录，必须输入验证码');
				}else alert(arr[1]);
			}
		}else alert("响应格式错");
	}
}
function TxTB_UserLogout(){
$("TxNoteJs").src=Config.TxRegPath+"?FunName=Logout&t="+TxTB_getRandom();
//$("TxMsgJs").src=Config.TxComLoginPath+"?FunName=Logout&t="+TxTB_getRandom();
$("TxFriendJs").src=Config.TxJpLoginPath+"?FunName=Logout&t="+TxTB_getRandom();
$("TxGroupJs").src = Config.TxCarLoginPath + "?FunName=Logout&t=" + TxTB_getRandom();
}
function Tx_LogoutFinish(value){TxTB_UserID=0;ResetUserLoginStatus();TxTB_RefreshMenu();TxMsgJs.src="";Tx_clearMenu();}
function ResetUserLoginStatus(){
if(TxTB_UserID==0){$("TxLogin").style.display="";$("TxUserInfo").style.display="none";$("UserCenterBt").style.display='none';}else{$("TxLogin").style.display="none";$("TxUserInfo").style.display="";$("UserCenterBt").style.display='';$("UserNameInfo").innerHTML=TxTB_UserName;Tx_GetMyNoteCount();}}
function TxTB_RefreshMenu(){if(TxTB_UserID==0){MyBlogTD.style.display="none";TxChildMenu.group=new Array();TxChildMenu.group[0]="登录后使用,,_self,images/toolbar/group.gif";TxChildMenu.group[1]="匿名浏览,"+Config.GroupRootPath+",_self,images/toolbar/group.gif";TxChildMenu.friend=new Array();TxChildMenu.friend[0]="请登录后使用,,_self,images/toolbar/user.gif";fnStopInterval();}else{TxChildMenu.group=new Array();TxChildMenu.friend=new Array();myFriendTD.style.display="";TxChildMenu.friend[0]="好友管理,http://"+TxTB_UserID+".i.tiexue.net/friends_1.html,_blank,images/toolbar/user.gif";TxChildMenu.friend[1]="-1,,,";MyBlogTD.style.display="";Tx_LoadCache();fnStartInterval();}}
function TxTB_MenuItemLoad(funName){Tx_ClearMenuItem();var arr=null;switch (funName){case "navigation":arr=TxChildMenu.navigation;break;case "group":arr=TxChildMenu.group;break;case "friend":arr=TxChildMenu.friend;break;case "finance":arr=TxChildMenu.finance;break;case "setting":arr=TxChildMenu.setting;break;default:}var tempArr;if(arr!=null){if(arr.length==0) return false;for (var i=0;i<arr.length;i++){tempArr=arr[i].split(",");if(tempArr[0]=="-1")AddmenuItemSplitLine();else{if(funName=="friend"){if(i>1)Tx_AddMenuItem(funName,tempArr[3],tempArr[0],tempArr[1],tempArr[2],new Function("TxTB_EditNewNote(\""+tempArr[0]+"\")"));else Tx_AddMenuItem(funName,tempArr[3],tempArr[0],tempArr[1],tempArr[2]);}else Tx_AddMenuItem(funName,tempArr[3],tempArr[0],tempArr[1],tempArr[2]);}}}else return false;return true;}
function Tx_GetMyGroupCallBack(value){var GroupID,GroupName,DomainName;if(value!="" && value!=null){var tempArr;Tx_GroupList=value;TxChildMenu.group=new Array();var arr=value.split(";");for (var i=0;i<arr.length;i++){tempArr=arr[i].split(",");GroupID=tempArr[0];GroupName=tempArr[1];DomainName=tempArr[2];TxChildMenu.group[TxChildMenu.group.length]=GroupName+","+Config.GroupRootPath+DomainName+"/,_self,images/toolbar/group.gif";}}else{TxChildMenu.group[0]="没有加入公社,,_self,images/toolbar/group.gif";TxChildMenu.group[1]="-1,,,";TxChildMenu.group[2]="匿名浏览,"+Config.GroupRootPath+",_self,images/toolbar/group.gif";}}
function TxGetMyFriendCallBack(value){if(value!="" && value!=null){TxChildMenu.friend=new Array();TxChildMenu.friend[0]="好友管理,http://"+TxTB_UserID+".i.tiexue.net/friends_1.html,_blank,images/toolbar/user.gif";TxChildMenu.friend[1]="-1,,,";var tempArr;var arr=value.split(";");for (var i=0;i<arr.length;i++){tempArr=arr[i].split(",");FriendID=tempArr[0];Friend=tempArr[1];Domain=tempArr[2];if(Domain!="")TxChildMenu.friend[TxChildMenu.friend.length]=Friend+",http://"+Domain+".i.tiexue.net/blog/,_blank,http://www.itiexue.net/images/toolbar/note.gif,"+Friend;else TxChildMenu.friend[TxChildMenu.friend.length]=Friend+",,_self,http://www.itiexue.net/images/toolbar/note.gif,"+Friend;}}}
function Tx_ToMyBlog(){if(TxTB_UserID==0)return;location="http://"+TxTB_UserID+".i.tiexue.net/blog/";}function Tx_ToMyCenter(){if(TxTB_UserID!=0) window.open("http://"+TxTB_UserID+".i.tiexue.net");}function Tx_ToHelp(){location=Config.HelpPath;}
function TxToolbarLoad(){if(TxTB_UserID==0){TxTB_UserID=BaseCookie.TxBBS_CurrentUserID();TxTB_UserName=BaseCookie.TxBBS_CurrentUserName();if(TxTB_UserID!=0){ResetUserLoginStatus();TxTB_RefreshMenu();}}if(TxTB_UserID==0)return;if(FriendInfo==null){FriendInfo=new GoodFriend();FriendInfo.CallBack=TxGetMyFriendCallBack;}if(DlgInfo==null){DlgInfo=new MsgDlgInfo(true,Tx_NewMsgFeedback_1);DlgInfo.InitPanel();}if(MyGroupInfo==null){MyGroupInfo=new MyGroupClass();MyGroupInfo.CallBack=Tx_GetMyGroupCallBack;}}
function WinLoad(){TxToolbarLoad();}if(window.addEventListener){window.addEventListener('load',WinLoad,false);}else{window.attachEvent('onload',WinLoad);}
function Tx_LoadCache(){TxTB_UserID=BaseCookie.TxBBS_CurrentUserID();if(TxTB_UserID==0){Tx_GetMyGroupCallBack("");TxGetMyFriendCallBack("");return;}
Tx_FriendList=FriendInfo.GetMyFriends();TxGetMyFriendCallBack(Tx_FriendList);Tx_GroupList=MyGroupInfo.GetMyGroups();Tx_GetMyGroupCallBack(Tx_GroupList);}
function Tx_clearMenu(){UserData.Clear();BaseCookie.ClearCookie("TxMsgAvail");BaseCookie.ClearCookie("TxMsgNew");Tx_FriendList=Tx_GroupList="";}

var oInterval=null;
function fnStartInterval(){if(oInterval==null){oInterval=window.setInterval("Tx_GetMyNoteCount()",20000);}}
function fnStopInterval(){if(oInterval!=null){window.clearInterval(oInterval);oInterval=oInterval1=null;}}

function Tx_GetMyNoteCount(){if(DlgInfo==null) TxToolbarLoad();TxTB_UserID=BaseCookie.TxBBS_CurrentUserID();TxTB_UserName=BaseCookie.TxBBS_CurrentUserName();if(TxTB_UserID!=0){DlgInfo.Tx_GetMsgCount_Cache();Tx_NewMsgFeedback_1(DlgInfo.NewInfoCount);}}
function Tx_NewMsgFeedback_1(value){Tx_NewMsgCount=value;Tx_NodeDataFill(value);var obj=$("msgDiv");if(obj!=null)obj.parentNode.removeChild(obj);}
function Tx_NodeDataFill(value){if(value==0) value="";if(value!=""){TxSetInnerHtml("Message","<FONT COLOR=red><span onclick='TxTB_ReadNoteInfo()' style='cursor:hand'>"+value+"条新消息</span></FONT>&nbsp;");}else TxSetInnerHtml("Message","<span style=\"cursor:hand\" onclick=\"TxTB_EditNewNote('')\"><FONT COLOR=blue>新短信</FONT></span>");}
function Tx_MouseOver(src,BackColor){if(!src.contains(event.fromElement)){src.bgColor=BackColor;src.style.bordercolor="#000000";}}
function Tx_MouseOut(src, BackColor){if(!src.contains(event.toElement)){src.bgColor=BackColor;src.style.bordercolor="#000000";}}
function getReal(el){temp=el;while ((temp!=null)&&(temp.tagName!="BODY")){if(temp.tagName=="TD")return temp;temp=temp.parentElement;}return el;}

var cswmTI="";
function Tx_ClearStatus(){ClearToolbarStatus(menutable);ie5menu.style.visibility="hidden";}
function Tx_HideMenu(){cswmTI=setTimeout("Tx_ClearStatus();",250);}
function Tx_StopHideMenu(){clearTimeout(cswmTI);}
function Tx_GetTableItem(obj){var obj1=obj;while(obj1.tagName!="TABLE" && obj1.tagName!="BODY")obj1=obj1.parentElement;if(obj1.tagName != "TABLE") return null;return obj1;}
function Tx_ClearMenuItem(){while (MenuItem.rows.length!=0)MenuItem.deleteRow(0);}
function Tx_AddMenuItem(funName,ImgSrc,DispInfo,Href,Target,OnItemClick){
	var obj=MenuItem;var oTR=obj.insertRow();oTR.borderColor="#f1f1f1";var oTD=oTR.insertCell(0);var tableobj=document.createElement("table");
	tableobj.height="22px";tableobj.cellSpacing=0;tableobj.cellPadding=0;tableobj.className="TxMainMenu";
	if(Href!=""){tableobj.onmouseout=new Function("this.className='TxMainMenu'");tableobj.onmouseover=new Function("this.className='TxMainMenu1'");}oTD.appendChild(tableobj);
	oTR=tableobj.insertRow();oTR.bgColor="#f1f1f1";oTR.borderColor="#b6bdd2";
	if(Href!=""){oTR.onmouseout=new Function("Tx_MouseOut(this,'#f1f1f1')");oTR.onmouseover=new Function("Tx_MouseOver(this,'#B6BDD2')");}
	if(typeof(OnItemClick)!='undefined'){
		oTD=oTR.insertCell(0);oTD.width="20px";oTD.align="center";
		oTD.innerHTML="<img border='0' src='"+ImgSrc+"' title='发送短信' style='cursor:hand'>";
		oTD.onclick=OnItemClick;
		oTD=oTR.insertCell(1);
		oTD.nowrap="";
		if(Href!=""){oTD.style.cursor="hand";oTD.title='访问Blog';oTD.onclick=function(){if(Target=="_self")location.href=Href;else window.open(Href);}}
		oTD.innerHTML="<nobr>&nbsp;"+ DispInfo+"&nbsp;</nobr>";
	}else{
		oTD=oTR.insertCell(0);
		oTD.nowrap="";
		if(Href!="")temp="<a class='mainbar' href=\""+Href+"\" target=\""+Target+"\" class='a_link'>"+DispInfo+"</a>";else temp=DispInfo;
		oTD.innerHTML="<nobr>&nbsp;"+temp+"&nbsp;</nobr>";
	}
}

function AddmenuItemSplitLine(){var obj=MenuItem;var oTR=obj.insertRow();var oTD=oTR.insertCell(0);oTD.height="3";oTD.className="TDSplit";oTD.innerHTML="<table height=1 border=0 cellpadding=0 cellspacing=0><tr><td></td></tr></table>";}
function ClearToolbarStatus(obj){if(obj.rows.length<1) return;row=obj.rows[0];for (i=0;i<row.cells.length;i++){row.cells[i].className="toolbar";}}
function Tx_menu_down(obj){var obj1=Tx_GetTableItem(obj);if(obj1==null) return;ClearToolbarStatus(obj1);obj.className="toolbar1";if(!TxTB_MenuItemLoad(obj.funName)){ie5menu.style.visibility="hidden";return;}ie5menu.style.left=parseInt(obj.offsetLeft)+parseInt(obj1.offsetLeft);ie5menu.style.top=getIEPosY(obj1)+parseInt(obj1.offsetTop)+parseInt(obj1.offsetHeight);obj1=obj1.parentElement;while (obj1.tagName!="BODY"){ie5menu.style.left=parseInt(ie5menu.style.left)+parseInt(obj1.offsetLeft);obj1=obj1.parentElement;}ie5menu.style.visibility="visible";}
function Tx_menu_out(obj){if(ie5menu.style.visibility=="hidden")obj.className="toolbar";else Tx_HideMenu();}
function Tx_menu_over(obj){Tx_StopHideMenu();toEl=getReal(window.event.toElement);fromEl=getReal(window.event.fromElement);if(toEl==fromEl) return;if(ie5menu.style.visibility=="hidden"){obj.className="toolbar0";return;}Tx_menu_down(obj);}

var firstLoad=true;
function Tx_HideGame(){cswmTI=setTimeout("Tx_ClearGame();",250);}
function Tx_ClearGame(){var obj=$("TxTopDiv");obj.innerHTML='';obj.style.display='none';obj.onmouseover=onmouseout="";firstLoad=true;}
function Tx_gameClick(obj){
	var o=$("TxTopDiv");
	if(o==null)return;
	if(o.style.display=='')return;

	if(firstLoad){o.onmouseover=function(){window.clearInterval(cswmTI);};o.onmouseout=Tx_HideGame;}
	o.style.zIndex=1000;
	var temp='<div style="BACKGROUND-COLOR: #f1f1f1;BORDER: #999999 1px solid;padding:5px">';
	temp+= '<a href="http://x.tiexue.net/Monitor/Monitor.aspx?PlaceID=71"><font color="blue">3服 帝国崛起</font> <font color="red">（新）</font></a><br>';
	temp+= '<a href="http://x.tiexue.net/Monitor/Monitor.aspx?PlaceID=73"><font color="blue">2服 笑看风云</font></a>　';
	temp+= '<a href="http://srv1.wm.tiexue.com/"><font color="blue">1服 指点江山</font></a><br>';
	temp+= '<a href="http://wm.tiexue.com">[游戏官网]</a> <a href="http://wm.tiexue.com/bbs">[玩家论坛]</a><br>';
	temp+= '</div>';
	o.innerHTML=temp;

	firstLoad=false;

	o.style.display='';o.style.top=getIEPosY(obj)+20;o.style.left=getIEPosX(obj)-5;
}

function getIEVersonNumber(){var ua=navigator.userAgent;var msieOffset=ua.indexOf("MSIE ");if(msieOffset < 0)return 0;return parseFloat(ua.substring(msieOffset+5, ua.indexOf(";", msieOffset)));}

function Tx_MainBarInit(TopBarID,BarWidth){
	var isIE5Min=(getIEVersonNumber() >= 5);
	if(!isIE5Min)return;

	if(BarWidth==0) BarWidth=720;
	var sHtml='<span class="DSMenuBox" onMouseOut="Tx_HideMenu()">';
	sHtml+='<div id="ie5menu" onMouseOver="Tx_StopHideMenu()"><table id="MenuItem" border="0" bgcolor="#f9f8f7" bordercolor="#000000" cellpadding="0" cellspacing="0"></table></div>';
	sHtml+='</span>';
	sHtml+='<table class="tb_bg" cellSpacing="0" cellPadding="0" align="center" width="'+BarWidth+'">';	// id="TxTB_MainTable"
	sHtml+='<tr>';
	sHtml+='<td style="padding-left:4px;padding-top:1px">';
	sHtml+='<div id="TxLogin">';
	sHtml+='<div class="TxTB_LoginInput" style=" float:left">';
	sHtml+='用户名：<input id="_UserName" name="_UserName" type="text" class="inp" style="WIDTH:60px"';
	sHtml+='	onMouseOver="this.style.borderColor=\'#ff0000\'" onMouseOut="this.style.borderColor=\'#DBDBDB\'">';
	sHtml+='	密码：<input id="_Password" name="_Password" type="password" class="inp" style="WIDTH:60px" onKeyDown="if(window.event.keyCode==13) TxTB_UserLogin()"';
	sHtml+='	onMouseOver="this.style.borderColor=\'#ff0000\'" onMouseOut="this.style.borderColor=\'#DBDBDB\'">';
	sHtml+='</div>';
	sHtml+='<div class="tb_savetime"><select id="ExpDT" name="ExpDT" style="height:19px"><option value="1">1天</option><option value="7">1周</option><option value="30">1月</option><option value="365" selected>1年</option></select></div>';
	
	sHtml+='<div id="ValidateCodeInfo" style="float:left;display:none">';
	sHtml+='验证码：<input id="_ValidateCode" type="text" class="inp" style="width:30px;margin-top:2px"><img id="ValidateCodeImg" onclick="RefreshValidCode()" style="cursor:pointer;height:18px;vertical-align:top;margin:2px 5px 0px 3px">';
	sHtml+='</div>';
	
	sHtml+='<ul class="tb_unlog">';
	sHtml+='<li class="tb_login" onClick="TxTB_UserLogin()"></li>';	//登录
	sHtml+='<li class="tb_jryouke" onClick="top.location.href=\'http://bbs.tiexue.net/\'"></li>';	//游客
	sHtml+='<li class="tb_reg" onClick="top.location.href=\'http://reg.tiexue.net/register.aspx\'"></li>';	//注册
	sHtml+='<li class="tb_jrgame" onclick="Tx_gameClick(this)" onmouseover="Tx_gameClick(this)" onmouseout="Tx_HideGame()"></li>';
	sHtml+='</ul>';
	sHtml+='</div>';

	sHtml+='<ul id="TxUserInfo">';
	sHtml+='<li>欢迎您：<font style="COLOR:#ff0000"><span id="UserNameInfo"></span></font></li>';
	sHtml+='<li><span id="Message"></span>';
	sHtml+='<li class="tb_jrshequ" onClick="top.location.href=\'http://bbs.tiexue.net\'"></li>';	//进入社区
	sHtml+='<li class="tb_jrgame" onclick="Tx_gameClick(this)" onmouseover="Tx_gameClick(this)" onmouseout="Tx_HideGame()"></li>';	//进入游戏
	sHtml+='<li class="tb_jrgeren" onclick="Tx_ToMyCenter()" id="UserCenterBt"></li>';	//个人中心
	sHtml+='<li class="tb_exit" onclick="TxTB_UserLogout()"></li>';	//退出
	sHtml+='</ul>';
	sHtml+='</td>';
	sHtml+='<td align="right"><div class="index09_19"></div></td>';
	sHtml+='<td width="260px" valign="top">';
	sHtml+='<div style="height:22px;padding-left:12px; padding-top:3px;">';
	sHtml+='<table id="menutable" align="center" height="18" cellSpacing="0" cellPadding="0" width="100%" border="0">';
	sHtml+='<tr>';
	sHtml+='<td width="40" id="MyBlogTD" align="center" class="toolbar" onmouseover="this.className=\'toolbar0\'" onmouseout="this.className=\'toolbar\'" onmousedown="this.className=\'toolbar1\'"	onmouseup="this.className=\'toolbar0\';Tx_ToMyBlog();" nowrap>博客</td>';
	sHtml+='<td width="40" id="myGroupTD" align="center" funName="group" class="toolbar" onmouseover="Tx_menu_over(this)" onmouseout="Tx_menu_out(this)" onmousedown="Tx_menu_down(this)" nowrap>公社</td>';
	sHtml+='<td width="40" id="myFriendTD" align="center" funName="friend" class="toolbar" onmouseover="Tx_menu_over(this)" onmouseout="Tx_menu_out(this)" onmousedown="Tx_menu_down(this)" nowrap>好友</td>';
	sHtml+='<td width="40" align="center" funName="finance" class="toolbar" onmouseover="Tx_menu_over(this)" onmouseout="Tx_menu_out(this)" onmousedown="Tx_menu_down(this)" nowrap>经济</td>';
	sHtml+='<td width="40" align="center" funName="setting" class="toolbar" onmouseover="Tx_menu_over(this)" onmouseout="Tx_menu_out(this)" onmousedown="Tx_menu_down(this)" nowrap>设置</td>';
	sHtml+='<td width="40" align="center" class="toolbar" onmouseover="this.className=\'toolbar0\'" onmouseout="this.className=\'toolbar\'" onmousedown="this.className=\'toolbar1\'" ';
	sHtml+='	onmouseup="this.className=\'toolbar0\';Tx_ToHelp();" nowrap>帮助</td>';
	sHtml+='<td width="30" class="toolbar">&nbsp;</td>';
	sHtml+='</tr>';
	sHtml+='</table>';
	sHtml+='</div>';
	sHtml+='</td></tr></table>';
	if(TopBarID != null)$(TopBarID).innerHTML=sHtml;else document.write(sHtml);sHtml=null;

	ResetUserLoginStatus();
	TxTB_RefreshMenu();
}

//www首页专用脚本信息
function TabPanelonChange(TabName,CurPanel){
	var obj=$(TabName);
	if(obj!=null){
		var objs=null;
		var o=obj.rows[0].cells[0].childNodes[0];
		if(o.tagName=="TABLE"){
			objs=o.rows[0].cells;
			for (var i=0;i<objs.length;i++){
				o=objs[i];
				if(i==CurPanel){
					if(obj.className==TabName)return;
					o.className=TabName;
				}else{
					o.className=TabName+"_1";
				}
			}
		}
		objs=obj.rows[1].cells[0].childNodes;
		for (var i=0;i<objs.length;i++){
			obj=objs[i];
			if(obj.tagName!="DIV")continue;
			if(i==CurPanel){
				obj.style.display="";
			}else{
				obj.style.display="none";
			}
		}
	}
}

function RefreshPic(obj){
	switch(obj){
	case 1:
		$("navImg1").src="http://www.itiexue.net/images/v1/index09_7.gif";break;
	case 2:
		$("navImg2").src="http://www.itiexue.net/images/v1/index09_8.gif";break;
	case 3:
		$("navImg3").src="http://www.itiexue.net/images/v1/index09_9.gif";break;
	case 4:
		$("navImg4").src="http://www.itiexue.net/images/v1/index09_10.gif";break;
	case 5:
		$("navImg5").src="http://www.itiexue.net/images/v1/index09_11.gif";break;
	case 6:
		$("navImg6").src="http://www.itiexue.net/images/v1/index09_12.gif";break;
	case 7:
		$("navImg7").src="http://www.itiexue.net/images/v1/index09_14.gif";break;
	case 8:
		$("navImg8").src="http://www.itiexue.net/images/v1/index09_0430_1.gif";break;
	}
}

//滚动图
function PlayTran(){ 
	if(document.all){
		var obj=$('ScrollImg');
		if(obj!=null){try{obj.filters.revealTrans.Transition=10;obj.filters.revealTrans.apply();obj.filters.revealTrans.play();}catch(e){}}
	}
}
function ScrollPicShow(index,isContinue){
	if(isPause && isContinue){
		window.setTimeout("ScrollPicShow("+index+",true)",10000);
		return;
	}
	ScrollButton(index);
	var simg=$("ScrollImg");
	var stxt=$("ScrollTxt");
	var surl=$("ScrollUrl");
	var stxturl=$("ScrollTxtUrl");
	PlayTran();
	try{
	simg.src=scrollImg[index][2];
	stxturl.title=simg.title=surl.title=stxt.innerText=scrollImg[index][1];
	stxturl.href=surl.href=scrollImg[index][0];
	}catch(e){}

	//按钮显示
	//定时滚动下一张
	if(index >= scrollImg.length-1 || index>=5)index=0;else index++;

	if(isContinue)window.setTimeout("ScrollPicShow("+index+",true)",5000);
}
function ScrollButton(index){
	var buttonName="ScrollDiv";
	for(var i=0;i<6;i++){
		var sbut=$(buttonName+i);
		if(i==index)sbut.className="ScrollButton1";else sbut.className="ScrollButton0";
	}
}

function PauseScroll(index){
	isPause=true;
	ScrollPicShow(index,false);
	window.setTimeout("isPause=false",5000);
}

//记录来源URL
document.write("<script language=\"javascript\" id=\"TxJunpinReferer\"></script>");
function TxReferer(){
    var Junph = BaseCookie.GetCookie("IsJunpinReferer");
    if(Junph=="1")
    {
        return;
    }
	var reurl = document.referrer;
    if(reurl=="")
    {
        reurl="http://www.tiexue.net";
    }
    

   $("TxJunpinReferer").src="http://www.junph.com/script/setRefererCookie.aspx?url="+escape(reurl);
}

AddOnLoad(TxReferer);
function RefererSuccess()
{
    BaseCookie.SetCookie("IsJunpinReferer", "1", 2592000);
}