window.onerror=new Function("return true;");
var newDate=new Date();
newDate=""+newDate.getYear()+"-"+[newDate.getMonth()+1]+"-"+newDate.getDate()+"";

var IE_all_cache = new Object();
function IE_getElementById(id){if (IE_all_cache[id] == null){IE_all_cache[id] = document.all[id];}return IE_all_cache[id];}
if(document.all){if(!document.getElementById){document.getElementById = IE_getElementById;}}

function getCookie(s){var arr=document.cookie.match(new RegExp("(^| )"+s+"=([^;]*)(;|$)"));	if(arr!=null){return unescape(arr[2]);}else{return "";}}

function writeCookie(name, value) {
	var argv = writeCookie.arguments;
	var argc = writeCookie.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var expiresTime = new Date();
	if (expires!=null) expiresTime.setTime((new Date()).getTime() + (1000*3600*24*expires));
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
	((expires == null) ? "" : ("; expires=" + expiresTime.toGMTString())) +
	((path == null) ? "" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}

function HTMLEncode(s){
	s = s.replace(/&/g, "&amp;") ;
	s = s.replace(/"/g, "&quot;") ;
	s = s.replace(/</g, "&lt;") ;
	s = s.replace(/>/g, "&gt;") ;
	s = s.replace(/'/g, "&#39;") ;
	return s ;
}

function checkclick(msg){if(confirm(msg)){event.returnValue=true;}else{event.returnValue=false;}}
var showpost_i=0;
function ShowPost(id,username,content,posttime,honor,userface,sex,birthday,experience,membercode,faction,consort,money,postcount,regtime,userlife,usermail,userhome,sign)
{
//content=HTMLEncode(content);
document.write("<br style='line-height:15%;'><table style='table-layout:fixed;' cellpadding='6' width='96%' align='center' border='0' cellspacing='1' class='tableborder'>");
showpost_i++;
if(showpost_i>2){showpost_i=1;}
if (showpost_i==1) document.write("<tr class='tablecontent1'><td width='156' align='center' valign='top'>");
else document.write("<tr class='tablecontent2'><td width='156' align='center' valign='top'>");
document.write("<table border=0 width='90%'><tr><td><font style=font-size:10pt><b>"+username+"</b></font><br>"+honor+"</td><td align=right valign=top>");

if (""+sex+""!=''){document.write("<img src='images/"+sex+".gif'>　")}
document.write(astro(""+birthday+""));
document.write("</td></tr></table>");
if (getCookie('showface')!='0'){
document.write("<img src='"+userface+"' onload='javascript:if(this.width>120)this.width=120;if(this.height>120)this.height=120;'>")
}

document.write("<br><br><table border=0 width='90%'><tr><td>"+level(experience,membercode,username,moderated)+levelimage+"<br>等　　级:"+levelname+"<br>");
if (""+faction+"" !="") {document.write("门　　派:"+faction+"<br>");}
if (""+consort+"" !="") {document.write("配　　偶:"+consort+"<br>");}
document.write("经 验 值:"+experience+"<br>");
document.write("社区金币:"+money+"<br>");
document.write("总发贴数:"+postcount+"<br>");
document.write("注册时间:"+regtime.split(" ")[0]+"<br>");
document.write("体 力 值:<img border=0 src=images/bar/0.gif width='"+userlife/2+"' height=9 alt='"+userlife+"'><br>");
if(onlinelist.indexOf("|"+username+"|") == -1 ){document.write("在线状态:<img border=0 src=images/offline.gif alt='离线'><br>");}else{document.write("在线状态:<img border=0 src=images/online.gif alt='在线'><br>");}
document.write("</td></tr></table></td><td height=100%>");
document.write("<table cellSpacing=0 cellPadding=0 width=100% border=0 height=100%><tr><td colspan=3 width=85%><a href='Profile.asp?username="+username+"'><img alt='查看"+username+"的个人资料' src=images/Profile.gif border=0></a> <a style=cursor:hand onclick=\"javascript:open('friend.asp?menu=post&incept="+username+"','','width=320,height=170')\"><img src=images/pm.gif border=0 alt='发送短讯息给"+username+"'></a> <a href='friend.asp?menu=add&username="+username+"'><img alt='把"+username+"加入好友' src=images/friend.gif border=0></a> <a href='searchtopic.asp?menu=5&username="+username+"'><img alt='搜索"+username+"发表过的所有主题' src=images/find.gif border=0></a> <a href=mailto:"+usermail+"><img alt='发送电邮给"+username+"' src=images/email.gif border=0></a> ");

if (userhome!="" && userhome!="http://"){
document.write("<a target='_blank' href="+userhome+"><img alt='访问"+userhome+"的主页' src='images/homepage.gif' border=0></a>");
}
document.write(" <a href=javascript:copyText(document.all.contarea"+id+")><img alt=复制这个帖子 src=images/copy.gif border=0></a> <a href='retopic.asp?id="+topicid+"&retopicid="+id+"&quote=1&topic="+topic+"'><img alt=引用回复这个帖子 src=images/reply.gif border=0></a></td><td align=right>No.<font color=red><b>" + whichRec + "</b></font>&nbsp;</td></tr><tr valign=top><td colspan='4'><hr width='100%' color='#777777' size='1'></td></tr>");

document.write("<tr valign='top'><td colspan='4' height='100%' style='word-break:break-all;word-wrap:break-word ;'>");

if(badlist.indexOf(username) == -1 ){document.write(ubbcode("<span id=contarea"+id+">"+content+"</span>"));}
else{document.write("<span id=contarea"+id+">==============================<br>　　　<font color=RED>该用户帖子已被过滤　　　</font><br>==============================</span>")}
document.write("</td></tr><tr vAlign=top><td colSpan=4 align=right>")
if(getCookie('sign')!='0' && sign!=""){document.write("——————————<br><div style='OVERFLOW:auto' id=div"+id+">"+ubbcode(sign)+"</div>");}
document.write("</td></tr><tr valign=top><td colSpan=4><hr width=100% color='#777777' size=1></td></tr><tr vAlign=top><td width=30%><a href='edittopic.asp?id="+topicid+"&retopicid="+id+"'><img src=images/edit.gif border=0></a> <a href=manage.asp?menu=deltopic&id="+topicid+"&retopicid="+id+"><img src=images/del.gif border=0></a></td><td valign=bottom><img src=images/posttime.gif> 发表时间："+posttime+"　</td><td colSpan=2 width=40% valign=bottom><img src=images/ip.gif> IP：<a href=manage.asp?menu=lookip&id="+topicid+"&retopicid="+id+">已记录</a></td></tr></table></td></tr>");
document.write("</table>");
if(getCookie('sign')!='0' && sign!=""){if(eval("div"+id+".scrollHeight")>150){eval("div"+id+".style.height=150")}}
}

function showtopicindex(id){
	if (typeof(id)=="undefined") return;
	showmenu(event,'<div class="menuitems"><a href=?forumid='+ id +'&TimeLimit=1>查看一天内的主题</a></div><div class=menuitems><a href=?forumid='+ id +'&TimeLimit=3>查看三天内的主题</a></div><div class=menuitems><a href=?forumid='+ id +'&TimeLimit=7>查看一星期内的主题</a></div><div class=menuitems><a href=?forumid='+ id +'&TimeLimit=14>查看两星期内的主题</a></div><div class=menuitems><a href=?forumid='+ id +'&TimeLimit=30>查看一个月内的主题</a></div><div class=menuitems><a href=?forumid='+ id +'&TimeLimit=90>查看三个月内的主题</a></div><div class=menuitems><a href=?forumid='+ id +'&TimeLimit=180>查看六个月内的主题</a></div>');
}
function showTopicIcon(){
	document.write ('<table cellspacing="10" cellpadding="4" border="0" align="center"><tr><td nowrap><img alt="开放话题(有回复)" src="images/f_new.gif" border="0"> <img alt="开放话题(无回复)" src="images/f_norm.gif" border="0"> 开放话题(有/无回复) </td><td nowrap><img alt="" src="images/f_hot.gif" border="0"> 热门主题 </td><td nowrap><img alt="" src="images/f_locked.gif" border="0"> 关闭主题 </td><td nowrap><img src="images/topicgood.gif"> 精华主题 </td><td nowrap><img alt="" src="images/f_poll.gif" border="0"> 投票主题 </td><td nowrap><img alt="总置顶主题" src="images/top.gif" border="0"> <img alt="置顶主题" src="images/f_top.gif" border="0"> 置顶主题 </td><td nowrap><img src="images/my.gif" title="自己的主题"> 自己的主题 </td></tr></table>')
}
function showForumIcon(skins){
	if (typeof(skins)=="undefined") return
	document.write ('<div align="center"><img src="images/skins/'+ skins +'/board0.gif" alt="禁止浏览">&nbsp;关闭论坛&nbsp;&nbsp;<img src="images/skins/'+ skins +'/board1.gif" alt="任何人均可浏览">&nbsp;正规论坛&nbsp;&nbsp;<img src="images/skins/'+ skins +'/board2.gif" alt="游客禁止浏览">&nbsp;会员论坛&nbsp;&nbsp;<img src="images/skins/'+ skins +'/board3.gif" alt="需要授权才能浏览">&nbsp;授权论坛<br></div>')
}

function ShowForum(ID,topic,newtopic,username,posttime,Views,icon,toptopic,locktopic,pollresult,goodtopic,replies,lastname,lasttime){
	if(lasttime.indexOf(newDate) == 0){
		lasttime = lasttime.replace(newDate,"今天");
	}
	topic = topic.replace(key_word,"<font color=red>"+key_word+"<\/font>");
	if (toptopic == 2){
		reimage="<img src='images/top.gif' border='0'>"
	}
	else if (toptopic == 1) {
		reimage="<img src='images/f_top.gif' border='0'>"
	}
	else if (locktopic== 1) {
		reimage="<img src='images/f_locked.gif' border=0>"
	}
	else if (pollresult!= '') {
		reimage="<img src='images/f_poll.gif' border=0>"
	}
	else if ((replies>15) || (Views>150)) {
		reimage="<img src='images/f_hot.gif' border=0>"
	}
	else if (replies>0) {
		reimage="<img src='images/f_new.gif' border=0>"
	}
	else{
		reimage="<img src='images/f_norm.gif' border=0>"
	}
	if (goodtopic== 1) {
		reimage2="<img src='images/topicgood.gif'>"
	}
	else if (username == cookieusername) {
		reimage2="<img src='images/my.gif'>"
	}
	else{
		reimage2=""
	}
	if (replies>0) {
		reimage3=replies
	}
	else{
		reimage3="-"
	}

	if (icon>0) {icon="<img src='images/brow/" + icon + ".gif'>"}
	document.write("<tr height='25'><td align='center' class='tablecontent1'><a target='_blank' href='listtopic.asp?id="+ID+"'>"+reimage+"</a></td>");
	document.write("<td class='tablecontent2' align='center'>"+reimage2+"</td>");
	document.write("<td class='tablecontent1' onMouseOver=\"this.className='tablecontent2'\" onMouseOut=\"this.className='tablecontent1'\"><img loaded='no' src='images/plus.gif' id='followImg"+ID+"' style=cursor:hand; onclick=loadThreadFollow("+ID+")>"+icon+"<a href=listtopic.asp?id="+ID+">"+topic+"</a>");

	if ((parseInt(replies)+1) > 15) {
		var topicpage="";
		var tol=(parseInt(replies)+1)/15+1;
		for (var i=1; i < tol; i++){
			if(i<4 || i>=tol-2){
				topicpage=topicpage+"<a href='listtopic.asp?id="+ID+"&page="+ i +"'>"+ i +"</a> ";
			}
			if (i >= tol-3  && i<tol-2 && i>3){
				topicpage=topicpage+" ... ";
			}
		}
		document.write("(<img src='images/multipage.gif'>"+topicpage+")");
	}
	document.write(" "+newtopic+"</td><td align=middle class='tablecontent2'><a href=Profile.asp?username="+username+">"+username+"</a><br>"+posttime+"</td><td align=center class='tablecontent1'>"+reimage3+"</td><td align=middle class='tablecontent2'>"+Views+"</td><td class='tablecontent1' align='right' style='padding-right:10px;'>"+lasttime+"<br>By <a href=Profile.asp?username="+lastname+">"+lastname+"</a></td></tr>");
	document.write("<tr height=25 style='display:none;' id=follow"+ID+"><td class='tablecontent1'>　</td><td class='tablecontent2'>　</td><td id='followTd"+ID+"' align=left class='tablecontent1' colspan=5>　Loading...</td></tr>");
}

function showtabletop(){
	document.write ('<br><script language="JavaScript">Outertabletop();</script><table width="96%" align="center" border="0" class="tableborder" cellspacing="1" cellpadding="0">');
}

function showtablebottom(){
	document.write ('</table><script language="JavaScript">Outertablebottom();</SCRIPT>');
}

function showtablehead(id,forumname,introduce,forumstyle){
	if (forumstyle==1){
		document.write ('<tr class="tabletitle" id="TableTitleLink"><td colspan="2" height="25" title=' + introduce + '><span style="padding-left:4px;">')
		document.write ('<a href="cookies.asp?menu=liststyle&formid=' + id + '&listvalue=0"><img src="images/formplus.gif" border="0" alt="切换到简洁模式" /></a> ')
	}
	else{
		document.write ('<tr class="tabletitle" id="TableTitleLink"><td colspan="3" height="25" title=' + introduce + '><span style="padding-left:4px;">');
		document.write ('<a href="cookies.asp?menu=liststyle&formid=' + id + '&listvalue=1"><img src="images/formminus.gif" border="0" alt="切换到列表模式" /></a> ');
	}
	document.write ('<a href="listbbs.asp?forumid=' + id + '"><b>' + forumname + '</b></a></span></td></tr>');
}
function ShowList(pass,id,bbsname,icon,intro,moderated,today,toltopic,tolrestore,lasttime,lastname,lasttopic,password)
{
	if(pass >2) password=1
	document.write("<tr><td width='5%' align='center' bgcolor='#ffffff'>");
	if(password==1){document.write("<img src='images/skins/" + getCookie('skins') + "/board3.gif'>");}
	else{document.write("<img src='images/skins/" + getCookie('skins') + "/board" + pass + ".gif'>");}
	document.write("</td><td bgcolor='#ffffff'>");
	document.write("<table border='0' width='100%' cellspacing='0' cellpadding='3'><tr><td valign='top'>『 <a href='listbbs.asp?forumid=" + id + "'>" + bbsname + "</a> 』</td><td rowspan='2' align='center' width='80'>");
	if (icon!=''){
		document.write("<img src='"+icon+"' onload='javascript:if(this.width>100)this.width=100;if(this.height>60)this.height=60;'>");
	}
	document.write("</td>");
	/*if(password==1){
		document.write("<td rowspan='2' width='35%' align='center'>私密论坛");
	}
	else{*/
		document.write("<td rowspan='2' width='35%'>最后发表:"+lasttopic+"<br>作者:<a href='profile.asp?username="+lastname+"'>"+lastname+"</a><br>时间:"+lasttime+"");
	/*}*/
	if (intro!="")intro="-" + intro;
	document.write("</td></tr><tr><td>"+intro+"</td></tr><tr class='tablecontent2'><td> 版主：");
	var list = moderated.split ('|'); 
	for(var i=0;i<list.length;i++){
		if (list[i] !=''){
			document.write("<a href=profile.asp?username="+list[i]+">"+list[i]+"</a> ");
		}
	}
	document.write("</td><td></td><td><table border='0' width='100%' cellspacing='0'><tr><td width='33%'>今日贴:<font color='red'>"+today+"</font></td><td width='33%'>主题贴:"+toltopic+"</td><td width='33%'>总贴数:"+tolrestore+"</td></tr></table></td></tr></table></td></tr>");
}

var showforum_i=0;
function SmallShowList(id,bbsname,intro,moderated,today,toltopic,tolrestore){
	intro = intro.replace(/<br>/ig,"\n");
	showforum_i++;
	if (showforum_i==1) {document.write("<tr bgcolor='#FFFFFF'>");}
	document.write("<td width='33%'><table border='0' width='100%' cellspacing='0' cellpadding='6'><tr><td colspan='3' title='" + intro + "'>『 <a href='listbbs.asp?forumid=" + id + "'>" + bbsname + "</a> 』</td></tr><tr><td>今日贴: <font color='red'>" + today + "</font></td><td>主题贴: " + toltopic + "</td><td>总贴数: " + tolrestore + "</td></tr><tr class='tablecontent2'><td colspan='3'>版主：");
	var list= moderated.split ('|'); 
	if (list.length!=0){document.write("<a href='profile.asp?username="+list[0]+"'>"+list[0]+"</a>");}
	if (list.length>1){document.write(" <font color='gray'>...</font>");}
	document.write("</td></tr></table></td>");
	if (showforum_i==3){
		document.write("</tr>");
		showforum_i=0;
	}
}

function MakeupSmallList(){
	if(showforum_i!=0){
		for(var jj=showforum_i;jj<3;jj++){
			document.write("<td width='33%'>&nbsp;</td>");
		}
		document.write("</tr>");
		showforum_i=0;
	}
}

/*
**************************************************************************************
' Projectname: DisplayPageCount
' Filename: DisplayPageCount
' File version: v1.0
' Author : LittleYu.COM
' Start date: 2000-5-28
' LastEdit date : 2006-1-1
' Purpose :  
' Include file : no
' Input parameters :
'		CurrentPage-----------
'		TotalPage-------------
'		StrUrl--------
**************************************************************************************
*/
function DisplayPageCount(CurrentPage,TotalPage,StrUrl){
	var i ;
	var strHref ;
	if (parseInt(TotalPage)<1) return;
	if (typeof(StrUrl)=="undefined" || StrUrl=="")
		strHref="?Page=" ;
	else if (StrUrl.indexOf("?")<0)
		strHref="?" + StrUrl + "&Page=" ;
	else
		strHref = StrUrl + "&Page=" ;
	if (CurrentPage<1) CurrentPage=1;
	if (CurrentPage>TotalPage) CurrentPage=TotalPage;
	if (CurrentPage > 1){
		document.write ("<a href='" + strHref + "1'><font face='webdings' title='首页'>9</font></a>&nbsp;");
		document.write ("<a href='" + strHref + (TotalPage-1) +"'><font face='webdings' title='上页'>7</font></a>&nbsp;");
	}
	else{
		document.write ("<font face='webdings' title='首页'>9</font>&nbsp;") ;
		document.write ("<font face='webdings' title='上页'>7</font>&nbsp;") ;
	}

	if (TotalPage <= 15){
		for (i=1; i<=TotalPage; i++){
			if (i!=CurrentPage) document.write ("<a href='" + strHref + i + "'>"+i+"</a>&nbsp;")
			else document.write ("["+i+"]&nbsp;") ;
		}
	}
	else{
		if (CurrentPage<9){
			for (i=1; i<=15; i++){
			if (i!=CurrentPage) document.write ("<a href='"+strHref+i+"'>"+i+"</a>&nbsp;");
			else document.write ("["+i+"]&nbsp;");
			}
			document.write ("... ");
		}
		if (CurrentPage>TotalPage-8){
			document.write ("... ");
			for (i=TotalPage-15;i<=TotalPage;i++){
			if (i!=CurrentPage) document.write ("<a href='"+strHref+i+"'>"+i+"</a>&nbsp;");
			else document.write ("["+i+"]&nbsp;");
			}
		}

		if (CurrentPage-7>0 && CurrentPage+7<TotalPage && CurrentPage>8 && CurrentPage<TotalPage-7){
			document.write ("... ");
			for (i=CurrentPage-7;i<=CurrentPage+7;i++){
			if (i!=CurrentPage) document.write ("<a href='"+strHref+i+"'>"+i+"</a>&nbsp;");
			else document.write ("["+i+"]&nbsp;");
			}
			document.write ("... ");
		}
	}
	if (CurrentPage<TotalPage){
		document.write ("<a href='"+ strHref + (CurrentPage+1) +"'><font face='webdings' title='下页'>8</font></a>");
		document.write ("<a href='"+ strHref + (TotalPage) +"'><font face='webdings' title='未页'>:</font></a>");
	}
	if (CurrentPage==TotalPage){
		document.write ("<font face='webdings' title='下页'>8</font>");
		document.write ("<font face='webdings' title='未页'>:</font>");
	}
	if (TotalPage>0) document.write ("&nbsp;第<font color='Red'>"+ CurrentPage+"</font>页/共"+TotalPage+"页");
	document.write ('<input style="border:1px solid #808080;font-size:9pt;width:25px;" type="text"  id="GotoPages" name="GotoPages" size="1" value="">');
	document.write ('<input style="border:1px solid #808080;font-size:9pt;" type="button" value="Go" onclick="gotoPage(\''+strHref+'\');">');
}
function gotoPage(u){var p;if(document.getElementById('GotoPages')){p=document.getElementById('GotoPages').value;if (isNaN(p)){ return;}if(p==""){return;}}else{p="1";}document.location.href=u+p;}

var menuOffX=0;		//菜单距连接文字最左端距离
var menuOffY=15;	//菜单距连接文字顶端距离

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
function showmenu(e,vmenu,mod){
	which=vmenu
	menuobj=document.getElementById("popmenu")
	menuobj.thestyle=menuobj.style
	menuobj.innerHTML=which
	menuobj.contentwidth=menuobj.offsetWidth
	eventX=e.clientX
	eventY=e.clientY
	var rightedge=document.body.clientWidth-eventX
	var bottomedge=document.body.clientHeight-eventY

	if (rightedge<menuobj.contentwidth)
		menuobj.thestyle.left=document.body.scrollLeft+eventX-menuobj.contentwidth+menuOffX
	else
		menuobj.thestyle.left=ie4? ie_x(event.srcElement)+menuOffX : ns6? window.pageXOffset+eventX : eventX
	
	if (bottomedge<menuobj.contentheight&&mod!=0)
		menuobj.thestyle.top=document.body.scrollTop+eventY-menuobj.contentheight-event.offsetY+menuOffY-23
	else
		menuobj.thestyle.top=ie4? ie_y(event.srcElement)+menuOffY : ns6? window.pageYOffset+eventY+10 : eventY

	menuobj.thestyle.visibility="visible"
}

function ie_y(e){var t=e.offsetTop; while(e=e.offsetParent){t+=e.offsetTop;}return t;}  
function ie_x(e){var l=e.offsetLeft;while(e=e.offsetParent){l+=e.offsetLeft;}return l;}

function highlightmenu(e,state){
	if (document.all)
		source_el=event.srcElement
		while(source_el.id!="popmenu"){
			source_el=document.getElementById? source_el.parentNode : source_el.parentElement
			if (source_el.className=="menuitems"){
				source_el.id=(state=="on")? "mouseoverstyle" : ""
		}
	}
}

function hidemenu(){if (window.menuobj)menuobj.thestyle.visibility="hidden";}
function dynamichide(e){if ((ie4||ns6)&&!menuobj.contains(e.toElement))hidemenu()}
document.onclick=hidemenu;
document.write("<div class='menuskin' id='popmenu' name='popmenu' onmouseover=highlightmenu(event,'on') onmouseout=highlightmenu(event,'off');dynamichide(event)></div>");

// add area script
function focusEdit(editBox){
	if ( editBox.value == editBox.helptext ){
		editBox.value = '';
		editBox.className = 'editbox';
	}
	return true;
}
function blurEdit(editBox){
if ( editBox.value.length == 0) {
		editBox.className = 'editbox Graytitle';
		editBox.value = editBox.helptext;
	}
}
function ValidateTextboxAdd(box, button){
	var buttonCtrl = document.getElementById( button );
	if ( buttonCtrl != null ) {
		if (box.value == "" || box.value == box.helptext){
			buttonCtrl.disabled = true;
		}
		else{
			buttonCtrl.disabled = false;
		}
	}
}
// add area script end

function loadtree(ino,bbsname){document.frames["hiddenframe"].location.replace("forumtree.asp?id="+ino+"");}
function loadThreadFollow(ino,online){
	var targetImg =eval("document.getElementById('followImg" + ino + "')");
	var targetDiv =eval("document.getElementById('follow" + ino + "')");
	if (targetDiv.style.display!='block'){
		if(targetImg.loaded=="no"){
			document.frames["hiddenframe"].location.replace("loading.asp?id="+ino+"&forumid="+online+"");
		}
		targetDiv.style.display="block";
		targetImg.src="images/minus.gif";
	}
	else{
		targetDiv.style.display="none";
		targetImg.src="images/plus.gif";
	}
}

function browerversion(info){
	var pattern = /(Netscape|Opera|NetCaptor|MSN|MSIE|MyIE|Galeon|Konqueror|Firefox|Mozilla)[\s\/]{0,1}\d{0,}\.{0,1}\d*\.{0,1}\d*\.{0,1}\d*/ig;
	var RegResult=info.match(pattern);
	var result=RegResult?RegResult[RegResult.length-1]:"Other Brower";
	result=result.replace("MSIE","Microsoft Internet Explorer");
	return result;
}
function osversion(info){
	var pattern = /(Windows|Mac_|Mac |unix|Linux|SunOS|BSD)[^;\(\)]*/ig;
	var RegResult=info.match(pattern);
	var result=RegResult?RegResult[RegResult.length-1]:"Other OS";
	result=result.replace("NT 5.0","2000");
	result=result.replace("NT 5.1","XP");
	result=result.replace("NT 6.0"," Vista");
	result=result.replace("NT 6.1"," 7");
	return result;
}

function CheckLogin(w){
	if (w.username.value==""){
		alert("请输入用户名");
		w.username.focus();
		return false;
	}
	if (w.userpass.value==""){
		alert("请输入密码");
		w.userpass.focus();
		return false;
	}
	return true;
}

//document.write("<iframe height='0' width='0' name='hiddenframe'></iframe>")

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
//    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    if (obj.style) { obj=obj.style; v=(v=='show')?'':(v=='hide')?'none':v; }
//    obj.visibility=v; }
    obj.display=v; }
}

