var i=0;
var ii=1;

newDate=new Date()
newDate=""+newDate.getYear()+"-"+[newDate.getMonth()+1]+"-"+newDate.getDate()+""

//读取COOKIE
function getCookie (CookieName) { 
var CookieString = document.cookie; 
var CookieSet = CookieString.split (';'); 
var SetSize = CookieSet.length; 
var CookiePieces 
var ReturnValue = ""; 
var x = 0; 
for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) { 
CookiePieces = CookieSet[x].split ('='); 

if (CookiePieces[0].substring (0,1) == ' ') { 
CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length); 
}

if (CookiePieces[0] == CookieName) {
ReturnValue = CookiePieces[1];
var value =ReturnValue
}


}
return value;
}


//跳出确认
function checkclick(msg){if(confirm(msg)){event.returnValue=true;}else{event.returnValue=false;}}


function Showstar(msg)
	{
	document.write(""+msg+"");
	}
//显示帖子
function ShowPost(id,username,auth,content,posttime,honor,userface,facetp,facewd,facehg,sex,birthday,experience,membercode,faction,consort,money,postcount,regtime,userlife,usermail,userhome,sign,forumid,landtime,realname,affi,bkg)
	{
    //document.write("<bgsound src=images/manage/switch.wav>");
	document.write("<table class=sboder cellspacing=1 cellpadding=0 width=97% align=center border=0>");
	document.write("<tr><td valign=top align=left>");
	document.write("<table style=BORDER-COLLAPSE: cellspacing=0 cellpadding=3 width=100% border=0 height=1%>");
	ii++
	if(ii==3)
		{
		ii=1
		}
	if (auth>'0')
		{
		authx="<img border=0 src=images/mbauth.gif>"
		authy="<img border=0 src=images/brow/auth0"+auth+".gif>"
		}
	else
		{
		authx=""
		authy=""
		}

	document.write("<tr class=docttxt"+ii+"><td valign=top width=160 rowspan=4 height=250>");
	//document.write("<p style=\"word-spacing: 0; text-indent: 0; line-height: 200%; margin: 0\">");
	document.write("<table cellspacing=0 cellpadding=0 width=90% align=center border=0><tr><td>");
	//document.write("<table border=0 cellspacing=0 width=95% style='FILTER:glow(color=a4b6d7)'><tr><td><font style=font-size:9pt><b>"+realname+"</b></font><br><font style=font-size:9pt color=ff6767>"+honor+"</font></td><td align=right valign=top width=40>");
	document.write("<table border=0 cellspacing=0 width=95%><tr><td><table style='FILTER:glow(color=a4b6d7)'><caption><b><font color=333333 style=font-size:10pt>"+realname+"</font></b>"+authx+"</caption></table><font style=font-size:9pt color=ff6767>"+honor+"</font></td><td align=right valign=top width=40>");
	if(onlinelist.indexOf("|"+username+"|") == -1 )
		{
		os="off"+sex
		if (sex="male")
			{
			}
		else
			{
			if (sex="female")
				{
				}
			else
				{
				}
			}
		}
	else
		{
		os="on"+sex
		if (sex="male")
			{
			}
		else
			{
			if (sex="female")
				{
				}
			else
				{
				}
			}
		}
	document.write("<a style=cursor:hand title='发送短讯息给"+username+"' onclick=\"javascript:open('friend.asp?menu=post&incept="+username+"','','width=320,height=170')\"><img src=images/"+os+".gif></a>");
	document.write(astro(""+birthday+""));
	document.write("</td></tr></table>");
	if (getCookie('showface')!='0')
		{
		document.write("<table width=90% border=0><tr><td align=middle>");

		if (facetp==0)
			{
			document.write("<a href='Profile.asp?username="+username+"' title='查看"+username+"的个人资料'>");
			document.write("<img src='"+userface+"' border=0 width="+facewd+" height="+facehg+"></a>");
			document.write("</a>");
			}
		else
			{
			imm=userface
			uuu="Profile.asp?username="+username+""
			ttt="查看"+username+"的个人资料"
			ll = Shadow (facetp,imm,uuu,0,ttt,facewd,facehg)		
			}
		document.write("</td></tr></table>");
		}
	document.write("<br>");
	if (membercode=='5')
		{
		document.write("<img border=0 src=images/brow/mc05.gif>　<font color=2222dd>仙庄庄主</font><br>");
		}
	if (membercode=='4')
		{
		document.write("<img border=0 src=images/brow/mc04.gif>　<font color=004eff>仙 管 员</font><br>");
		}
	if (membercode=='3')
		{
		document.write("<img border=0 src=images/brow/mc03.gif>　<font color=004eff>仙庄嘉宾</font><br>");
		}
	if(moderated.indexOf("|"+username+"|") != -1 && moderated!="")
		{
		document.write("<img border=0 src=images/brow/mc02.gif>　<font color=009dff>此版版主</font><br>");
		}
	document.write("<br>"+level(experience,membercode,username,moderated)+levelimage+"<br><br>等　　级："+levelname+" "+authy+"<br>");
	if (""+faction+"" !="") 
		{
		document.write("帮　　派：<a style=cursor:hand onclick=\"javascript:open('faction.asp?menu=look&faction="+faction+"','','toolbar=no')\">"+faction+"</a><br>");
		}
	if (""+consort+"" !="") 
		{
		document.write("爱　　侣："+consort+"<br>");
		}
	document.write("经 验 值："+experience+"<br>");
	document.write("仙庄金币："+money+"<br>");
	document.write("总发贴数："+postcount+"<br>");
	document.write("注册时间："+regtime+"<br>");
	document.write("上次登陆："+landtime+"<br><br>");
	document.write("</td></tr></table></td><td valign=bottom align=middle rowspan=4><table height=100% class=sboder cellspacing=0 cellpadding=0 width=1><tr><td width=1></td></tr></table></td><td valign=top align=left colspan=3><table cellspacing=0 cellpadding=0 width=100% border=0>");
	document.write("<tr><td>");
	document.write("<a href='friend.asp?menu=add&username="+username+"' title='把"+username+"加入好友'> .好友</a>");
	document.write("<a href='search.asp?menu=ok&search=author&searchxm=username&content="+username+"' title='搜索"+username+"发表过的所有主题'> .搜索</a>");
	document.write("<a href=mailto:"+usermail+" title='发送电邮给"+username+"'> .邮件</a>");
	if (userhome!="" && userhome!="http://")
		{
		document.write("<a href="+userhome+" title=访问"+userhome+"的主页> .主页</a>");
		}
	document.write("<a href=javascript:copyText(document.all.yu"+id+") title=复制这个帖子> .复制</a>");
	document.write("<a href='retopic.asp?id="+topicid+"&retopicid="+id+"&quote=1&topic="+topic+"' alt=引用回复这个帖子> .引用</a>");
	document.write("<a href='retopic.asp?id="+topicid+"&topic="+topic+"' title=回复这个帖子> .回复</a>");
	document.write("<a href='EditTopic.asp?id="+topicid+"&retopicid="+id+"&topic="+topic+"' title=编辑这个帖子> .编辑</a>");
	document.write("<a onclick=checkclick('您确定要删除回贴?')  href=manage.asp?menu=deltopic&id="+topicid+"&retopicid="+id+" title=删除这个帖子> .删除</a>");
	document.write("<a href=manage.asp?menu=lookip&id="+topicid+"&retopicid="+id+" title=查看发表的IP> .IP</a>");
	if (forumid!="0")
		{
		document.write("<a href='Bz_EditTopic.asp?id="+topicid+"&retopicid="+id+"&topic="+topic+"' title=编辑这个帖子的分类（只限原作者和版主）> .分类</a>");
		}
	document.write(""+posttime+"");

	document.write("<font size=4></font></td>");
	i=i+1
	if (""+i+""=='1') 
		{	
		document.write("<td align=right><font color=red><b>楼主&nbsp;</b></td>");
		}
	else
		{
		document.write("<td align=right>第&nbsp;<font color=red><b>"+i+"</b></font>&nbsp;楼</font></td>");
		}

	document.write("</tr><tr valign=top>");

	//document.write("</tr><tr valign=top><td colspan=2 style=word-break:break-all background="+bkg+">");
	document.write("<td colspan=2 style=word-break:break-all>");
	document.write("<hr width=100% color=C7D3F7 size=1>");
	if (bkg == "")
		{
		document.write("<table><tr><td>");
		}
	else
		{
		document.write("<table><tr><td background="+bkg+">");
		}
	document.write("<img src=images/wenzhangface.gif><br><br>");
	if(badlist.indexOf(username) == -1 )
		{
		document.write(ybbcode("<span id=yu"+id+">"+content+"</span>"));
		//document.write(ybbcode(""+content+""));
		}
	else
		{
		document.write("<span id=yu"+id+">==============================<br>　　　<font color=RED>该用户帖子已被过滤　　　</font><br>==============================</span>")
		}
	document.write("</td>");
	document.write("</tr></table>");

	document.write("</td>");
	document.write("</tr></table></td></tr><tr class=docttxt"+ii+"><td valign=bottom>");
	document.write("<table cellspacing=0 cellpadding=0 width=100%>");

	document.write("<tr><td align=right valign=bottom colspan=3>");
	if (getCookie('sign')!='0' && sign!="" && auth>0)
		{
		//sign = sign.replace(/(\[IMG\])([^];]*)(\[\/IMG\])/ig,"<img border=0 src='$2' onmousewheel='return yuzi_img(event,this)' onload='javascript:if(this.width>512)this.width=120;if(this.height>256)this.height=120;'> ");
		document.write("————————<br>"+ybbcode(sign)+"");
		}
	document.write("</td></tr>");

	document.write("<tr><td align=center valign=bottom colspan=0>");
	document.write("<br><font color=97a3e7>本文观点仅代表桃源仙庄网友个人意见，不代表桃源仙庄立场！另请尊重作者劳动，如需转载请注明原创</font>")
	document.write("</td></tr>");

	document.write("<tr><td align=left valign=middle colspan=0 height=16>");
	document.write("<hr width=100% color=C7D3F7 size=1 height=0><font color=8888ff>广而告之：</font><a href='affiche.asp' target=_blank>"+affi+"</a>");
	document.write("</td></tr>");

	document.write("</table>");
	//document.write("</p>");
	document.write("</td></tr>");
	document.write("</table>");
	document.write("</td></tr>");
	document.write("</table>");
	}



//用户显示帖子
function usershowpost(id,username,content,posttime,honor,userface,sex,experience,membercode,money,regtime,usermail,userhome,landtime,realname,moderated,uid,menuid,bid,rid,kwd,sign,master,manage,pmaster,pmanage,nmb)
	{
	//document.write("<table class=sboder cellspacing=1 cellpadding=0 width=97% align=center border=0>");
	//document.write("<tr><td valign=top align=left>");

	document.write("<table style=BORDER-COLLAPSE: cellspacing=0 cellpadding=3 width=100% border=0 height=1%>");
	ii++
	if(ii==3)
		{
		ii=1
		}
	document.write("<tr class=docttxt"+ii+">");
	document.write("<td valign=top width=128 rowspan=4 height=250>");
	document.write("<table cellspacing=0 cellpadding=0 width=97% align=center border=0>");
	document.write("<tr><td>");

	document.write("<table border=0 cellspacing=0 width=97%>");
	document.write("<tr>");
	document.write("<td width=70%>");
	document.write("<table style='FILTER:glow(color=a4b6d7)'><caption><b><font color=333333 style=font-size:10pt>"+realname+"</font></b></caption></table>");
	document.write("<font style=font-size:9pt color=ff6767>"+honor+"</font>");
	document.write("</td>");

	if (nmb == 1) 
		{	
		document.write("<td width=28% align=right><font color=red><b>楼主</b></td>");
		}
	else
		{
		document.write("<td width=28% align=right><font color=red><b>"+nmb+"</b></font>楼</font></td>");
		}	
	document.write("</tr>");
	document.write("</table>");

	document.write("<table width=90% border=0>");
	document.write("<tr>");
	document.write("<td align=middle><a href='Profile.asp?username="+username+"' title='查看"+username+"的个人资料'><img src='"+userface+"' border=0 width=80></a></td>");
	document.write("</tr>");
	document.write("</table>");

	if (pmaster==1)
		{
		document.write("<img border=0 src=home/images/manage/master.gif>　<font color=2222dd>本站站长</font><br>");
		}
	//if (membercode=='4')
	//	{
	//	document.write("<img border=0 src=images/brow/mc04.gif>　<font color=004eff>仙 管 员</font><br>");
	//	}
	if (pmanage==1)
		{
		document.write("<img border=0 src=home/images/manage/manage.gif>　<font color=004eff>本版版主</font><br>");
		}

	document.write(""+level(experience,membercode,username,moderated)+"");
	//document.write(""+levelimage+"");
	document.write("<br>");
	document.write("&nbsp;等级："+levelname+"<br>");
	document.write("&nbsp;经验："+experience+"<br>");
	document.write("&nbsp;金钱："+money+"<br>");
	document.write("&nbsp;注册："+regtime+"<br>");

	
	document.write("</td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</td>");

	document.write("<td valign=bottom align=middle rowspan=4>");
	document.write("<table height=100% class=sboder cellspacing=0 cellpadding=0 width=1>");
	document.write("<tr>");
	document.write("<td width=1></td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</td>");

	document.write("<td valign=top align=left colspan=3>");
	document.write("<table cellspacing=0 cellpadding=0 width=100% border=0>");
	
	document.write("<tr><td>");
	document.write("<a href='friend.asp?menu=add&username="+username+"' title='把"+username+"加入好友'> .好友</a>");
	document.write("<a href='search.asp?menu=ok&search=author&searchxm=username&content="+username+"' target=_blank title='搜索"+username+"发表过的所有主题'> .搜索</a>");
	document.write("<a href=mailto:"+usermail+" title='发送电邮给"+username+"'> .邮件</a>");
	if (userhome!="" && userhome!="http://")
		{
		document.write("<a href="+userhome+" title=访问"+userhome+"的主页 target=_blank> .主页</a>");
		}
	//document.write("<a href=javascript:copyText(document.all.yu"+id+") title=复制这个帖子> .复制</a>");
	//document.write("<a href='retopic.asp?id="+topicid+"&retopicid="+id+"&quote=1&topic="+topic+"' alt=引用回复这个帖子> .引用</a>");
	document.write("<a href='home_bbsreppost.asp?userid="+uid+"&menuid="+menuid+"&bbsid="+bid+"&keyword="+kwd+"&id="+id+"&repid="+rid+"&quote=1' title=引用回复这个帖子> .引用</a>");
	document.write("<a href='home_bbsreppost.asp?userid="+uid+"&menuid="+menuid+"&bbsid="+bid+"&keyword="+kwd+"&id="+id+"&repid="+rid+"' title=回复这个帖子> .回复</a>");
	document.write("<a href='home_bbseditpost.asp?userid="+uid+"&menuid="+menuid+"&bbsid="+bid+"&keyword="+kwd+"&id="+id+"&repid="+rid+"' title=编辑这个帖子> .编辑</a>");
	if (nmb != 1) 
		{
		document.write("<a onclick=checkclick('您确定要删除帖子?')  href=home_bbsmanage.asp?userid="+uid+"&menuid="+menuid+"&bbsid="+bid+"&keyword="+kwd+"&id="+id+"&repid="+rid+"&menu=deltopic title=删除这个帖子> .删除</a>");
		}
	//document.write("<a href=manage.asp?menu=lookip&id="+topicid+"&retopicid="+id+" title=查看发表的IP> .IP</a>");
	//if (forumid!="0")
	//	{
	//	document.write("<a href='Bz_EditTopic.asp?id="+topicid+"&retopicid="+id+"&topic="+topic+"' title=编辑这个帖子的分类（只限原作者和版主）> .分类</a>");
	//	}
	document.write(""+posttime+"");

	document.write("<font size=4></font></td>");
	i=i+1
	//if (""+i+""=='1') 
	//	{	
	//	document.write("<td align=right><font color=red><b>楼主&nbsp;</b></td>");
	//	}
	//else
	//	{
	//	document.write("<td align=right>第&nbsp;<font color=red><b>"+i+"</b></font>&nbsp;楼</font></td>");
	//	}



	document.write("</tr><tr valign=top>");
	document.write("<td colspan=2 style=word-break:break-all>");
	document.write("<hr width=100% color=C7D3F7 size=1>");

	document.write("<img src=images/wenzhangface.gif><br><br>");
	document.write(ybbcode("<span id=yu"+id+">"+content+"</span>"));
	document.write("</td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</td>");
	document.write("</tr>");



	document.write("<tr class=docttxt"+ii+">");
	document.write("<td valign=bottom>");
	document.write("<table cellspacing=0 cellpadding=0 width=100%>");

	document.write("<tr>");
	document.write("<td align=right valign=bottom colspan=3>");
	if (sign!="")
		{
		document.write("————————<br>"+ybbcode(sign)+"");
		}
	document.write("</td>");
	document.write("</tr>");

	//document.write("<tr><td align=center valign=bottom colspan=0>");
	//document.write("<br><font color=97a3e7>本文观点仅代表桃源仙庄网友个人意见，不代表桃源仙庄立场！</font>")
	//document.write("</td></tr>");

	document.write("<tr><td align=left valign=middle colspan=0 height=16>");
	document.write("<hr width=100% color=C7D3F7 size=1 height=0><font color=8888ff>广而告之：</font>");
	//document.write("<a href='affiche.asp' target=_blank>"+affi+"</a>");
	document.write("</td></tr>");


	document.write("</table>");
	document.write("</td>");
	document.write("</tr>");

	document.write("</table>");
	//document.write("</td>");
	//document.write("</tr>");
	//document.write("</table>");
	}

//显示帖子
function showshopjj(id,content)
	{
	document.write(ybbcode("<span id=yu"+id+">"+content+"</span>"));
	}

//帖子列表
function ShowForum(ID,topic,newtopic,username,Views,icon,toptopic,locktopic,pollresult,goodtopic,replies,lastname,lasttime,kwe,mtp01,realname1,realname2,authen,plustype)
	{
	topic = topic.replace(key_word,"<font color=red>"+key_word+"<\/font>");
	ttt=""
	if (toptopic == 2) 
		{
		rimg="<img border=0 src=images/amtp.gif width=18>"
		ttt="amtp"
		}
	else
		{
		if (toptopic == 1) 
			{
			rimg="<img border=0 src=images/atop.gif width=18>"
			ttt="atop"
			}
		else
			{
			ttt="a4"
			if (locktopic== 1) 
				{
				rimg="<img border=0 src=images/alock.gif width=18>"
				ttt="alock"
				}
			else
				{
				if (pollresult!= '') 
					{
					rimg="<img border=0 src=images/apol.gif width=18>"
					ttt="apol"
					}
				else
					{
					if ((replies>40) || (Views>150)) 
						{
						rimg="<img border=0 src=images/ahot.gif width=18>"
						ttt="ahot"
						}
					else
						{
						rimg="<img border=0 src=images/anom.gif width=18>"
						//if (replies>0) 
						//	{
						//	rimg="<img border=0 src=images/anom.gif>"
						//	}
						//else
						//	{
						//	rimg="<img border=0 src=images/anew.gif>"
						//	}
						}
					}
				}
			}
		}


	reimage=""


	if (goodtopic== 1) 
		{
		rr21="<img src=images/agood.gif>"
		rr22=""
		}
	else
		{
		rr21=""
		if (username == cookieusername) 
			{
			rr22="<img src=images/amys.gif>"
			}
		else
			{
			rr22=""
			}
		}
	

	if (authen>0) 
		{
		rr23="<img src=images/auth.gif width=18>"
		}
	else
		{
		rr23=""
		}


	if (replies>0) 
		{
		reimage3="<font color=red>"+replies+"</font>"
		}
	else
		{
		reimage3="-"
		}

	document.write("<tr height=22>");
	if (plustype==0)
		{
		document.write("<td align=middle class=docttxt1><font color=666666>"+kwe+"</font></td>");
		}
	else
		{
		document.write("<td align=middle class=docttxt1><img src=images/maintype01/ppt"+plustype+".gif border=0></td>");
		}

	if (mtp01=="0")
		{
		document.write("<td  class=docttxt2>&nbsp;"+reimage+"<a href=viewpost.asp?id="+ID+"><img border=0 src=images/brow/"+icon+".gif></a> "+rimg+" <a href=ShowPost.asp?id="+ID+">"+topic+"</a>");
		}
	else
		{
		document.write("<td  class=docttxt2>&nbsp;"+reimage+"<a href=viewpost.asp?id="+ID+"><img border=0 src=images/maintype01/"+mtp01+".gif></a> "+rimg+" <a href=ShowPost.asp?id="+ID+">"+topic+"</a>");
		}

	if (replies > 39) 
		{
		var topicpage=""
		var tol=replies/39+1;
		for (var i=1; i < tol; i++) 
			{
			if(i<4 || i>=tol-2)
				{
				topicpage=topicpage+"<b><a href=ShowPost.asp?id="+ID+"&topage="+ i +">"+ i +"</a></b> ";
				}
			if (i >= tol-3  && i<tol-2 && i>3)
				{
				topicpage=topicpage+" ... ";
				}
			}
		document.write(" ( "+topicpage+" )");
		}
		document.write(" "+rr21+""+rr22+""+rr23+"");
	document.write(" "+newtopic+"</td><td align=middle class=docttxt1><a href=Profile.asp?username="+username+">"+realname1+"</a></td><td align=middle class=docttxt2>"+reimage3+"</td><td align=middle class=docttxt1>"+Views+"</td><td class=docttxt2>&nbsp;"+lasttime+" by <a href=Profile.asp?username="+lastname+">"+realname2+"</a></td></tr>");
	document.write("<tr height=25 style=display:none id=follow"+ID+"><td class=docttxt2>　</td><td width=3% class=docttxt1>　</td><td id=followTd"+ID+" align=left class=docttxt2 width=94% colspan=5><div onclick=loadThreadFollow("+ID+")><table width=100% cellpadding=10><tr><td width=100%>Loading...</td></tr></table></div></td>");
	document.write("</tr>");
	}


//用户帖子列表
function usershowforum(ID,topic,username,Views,icon,toptopic,locktopic,goodtopic,replies,lastname,lasttime,kwe,uid,menuid,pgsetup)
	{
	if (toptopic == 2) 
		{
		reimage="<img src=images/top.gif>"
		}
	else
		{
		if (toptopic == 1) 
			{
			reimage="<img src=images/f_top.gif>"
			}
		else
			{
			if (locktopic== 1) 
				{
				reimage="<img src=images/f_locked.gif>"
				}
			else
				{
				if ((replies>40) || (Views>150)) 
					{
					reimage="<img src=images/f_hot.gif>"
					}
				else
					{
					if (replies>0) 
						{
						reimage="<img src=images/f_new.gif>"
						}
					else
						{
						reimage="<img src=images/f_norm.gif>"
						}
					}
				}
			}
		}


	//reimage=""

	rr21=""
	if (goodtopic== 1) 
		{
		rr21="&nbsp;<img src=images/maintype02/1.gif>"
		rr22=""
		}
	

	if (replies>0) 
		{
		reimage3="<font color=red>"+replies+"</font>"
		}
	else
		{
		reimage3="-"
		}

//	document.write("<td align=middle width=4% class=docttxt1><font color=666666>"+kwe+"</font></td>");
	document.write("<td align=middle width=4% class=docttxt1><font color=666666>"+reimage+"</font></td>");

	document.write("<td  width=49%>&nbsp;<a href=home_bbsshow.asp?userid="+uid+"&menuid="+menuid+"&id="+ID+">"+topic+"</a>");


	if (replies > (pgsetup-1)) 
		{
		var topicpage=""
		var tol=replies/pgsetup+1;
		for (var i=1; i < tol; i++) 
			{
			if(i<4 || i>=tol-2)
				{
				topicpage=topicpage+"<b><a onclick=min_yuzi() href=home_bbsshow.asp?userid="+uid+"&menuid="+menuid+"&id="+ID+"&topage="+ i +">"+ i +"</a></b> ";
				}
			if (i >= tol-3  && i<tol-2 && i>3)
				{
				topicpage=topicpage+" ... ";
				}
			}
		document.write(" ( "+topicpage+" )");
		}



	//document.write(" "+rr21+" "+rr22+" ");
	document.write(""+rr21+" </td><td align=middle width=8% class=docttxt1><a href=Profile.asp?username="+username+">"+username+"</a></td><td align=middle width=4% class=docttxt2>"+reimage3+"</td><td align=middle width=5% class=docttxt1>"+Views+"</td><td width=25% class=docttxt2>&nbsp;"+lasttime+" by <a href=Profile.asp?username="+lastname+">"+lastname+"</a></td></tr>");
	//document.write("<tr height=25 style=display:none id=follow"+ID+"><td width=3% class=docttxt2>　</td><td width=3% class=docttxt1>　</td><td id=followTd"+ID+" align=left class=docttxt2 width=94% colspan=5><div onclick=loadThreadFollow("+ID+")><table width=100% cellpadding=10><tr><td width=100%>Loading...</td></tr></table></div></td>");
	}






//论坛列表
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=middle 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=ShowForum.asp?forumid="+id+"><font size=2><B>"+bbsname+"</B></Font></a> 』</td><td rowspan=2 align=right>")

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("<img src="+icon+" width=60 height=40 style=filter:alpha(opacity=80)> ")

}

document.write("</td>")

if(password==1){
document.write("<td rowspan=2 width=30% align=center>私密论坛")
}else{
document.write("<td rowspan=2 width=30%><font color=97a3e7>主题:"+lasttopic+"<br>作者:<a href=Profile.asp?username="+lastname+">"+lastname+"</a><br>时间:"+lasttime+"</font>")
}

document.write("</td></tr><tr><td><font color=97a3e7>"+intro+"</font></td></tr><tr class=docttxt1><td> <font color=97a3e7>版主：</font>")

var list= moderated.split ('|'); 
for(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>")

}


//用户论坛列表
function UserShowList(id,bbsname,icon,intro,moderated,today,toltopic,tolrestore,lasttime,lastname,lasttopic,uid,menuid)
	{
	//document.write("<tr>")
	//document.write("<td bgcolor=FFFFFF>")
	//document.write("<table border=0 width=100% cellspacing=0 cellpadding=3>")

	document.write("<tr>")
	document.write("<td class=docttxt2 valign=top>&nbsp;【 <a href=home_bbslist.asp?userid="+uid+"&menuid="+menuid+"&bbsid="+id+"><font size=2><B>"+bbsname+"</B></Font></a> 】</td>")
	document.write("<td class=docttxt2 rowspan=2 align=right>")
	if (icon!='')
		{
		document.write("<img src="+icon+" width=60 height=40 style=filter:alpha(opacity=80)> ")
		}
	else
		{
		var randicon=Math.floor(Math.random() * 77+1);
		document.write("<img src=home/images/icons/"+randicon+".gif width=60 height=40 style=filter:alpha(opacity=80)> ")
		}
	document.write("</td>")
	document.write("<td class=docttxt2 rowspan=2 width=30%><font color=97a3e7>&nbsp;主题:"+lasttopic+"<br>&nbsp;作者:<a href=Profile.asp?username="+lastname+">"+lastname+"</a><br>&nbsp;时间:"+lasttime+"</font>")
	document.write("</td>")
	document.write("</tr>")
	document.write("<tr><td  class=docttxt2><font color=97a3e7>&nbsp;&nbsp;&nbsp;&nbsp;"+intro+"</font></td><td></td></tr>")
	document.write("<tr class=docttxt1><td  class=docttxt2>&nbsp;&nbsp;&nbsp;版主：")
	var list= moderated.split ('|'); 
	for(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  class=docttxt2></td><td class=docttxt2><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>")


//document.write("</table></td></tr>")

}



function SmallShowList(id,bbsname,intro,moderated,today,toltopic,tolrestore)
{
intro = intro.replace(/<br>/ig,"\n");

i++;
if (i==1){document.write("<tr>")}

document.write("<td><table border=0 width=100% cellspacing=0 cellpadding=4><tr bgcolor=FFFFFF><td colspan=3 title='"+intro+"'>『 <a href=ShowForum.asp?forumid="+id+">"+bbsname+"</a> 』</td></tr><tr bgcolor=FFFFFF><td>今日:<font color=red>"+today+"</font></td><td>主题:"+toltopic+"</td><td>帖子:"+tolrestore+"</td></tr><tr class=docttxt1><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 (i==3){i=0;document.write("</tr>")}

}


function makeupShowList()
{
if (i!=0){
for(jj=i;jj<3;jj++){document.write("<td bgcolor=FFFFFF></td>")}
i=0
}
}


function SSS ()
	{
	AAA="http://www.tyxz.com/abc/dfg"
	BBB="http"
	var CCC=AAA&&BBB
	document.write("*** "+CCC+"<br>");

	}


//阴影显示
function Shadow (shadow_type,shadow_imgurl,shadow_linkurl,shadows_linktype,shadow_linktit,shadow_imgwid,shadow_imghig)
	{
	if (shadows_linktype == "0")
		{
		tg=""
		}
	else
		{
		tg="target=_Blank"
		}

	if(shadow_type == "1" )
		{
		shadow_sdwid=5
		shadow_sd1="images/sides/s_shadows1.gif"
		shadow_sd2="images/sides/s_shadows2.gif"
		shadow_sd3="images/sides/s_shadows3.gif"
		shadow_sd4="images/sides/s_shadows4.gif"
		shadow_sd5="images/sides/s_shadows5.gif"
		}
	if(shadow_type == "2" )
		{
		shadow_sdwid=10
		shadow_sd1="images/sides/d_shadows1.gif"
		shadow_sd2="images/sides/d_shadows2.gif"
		shadow_sd3="images/sides/d_shadows3.gif"
		shadow_sd4="images/sides/d_shadows4.gif"
		shadow_sd5="images/sides/d_shadows5.gif"
		}
	if(shadow_type == "3" )
		{
		shadow_sdwid=10
		sides_a00="images/sides/sides_a00.gif"
		sides_a01="images/sides/sides_a01.gif"
		sides_a02="images/sides/sides_a02.gif"
		sides_a10="images/sides/sides_a10.gif"
		sides_a12="images/sides/sides_a12.gif"
		sides_a20="images/sides/sides_a20.gif"
		sides_a21="images/sides/sides_a21.gif"
		sides_a22="images/sides/sides_a22.gif"
		}
		var s1=(shadow_imgwid-0)+(shadow_sdwid-0)
		var s2=(shadow_imghig-0)+(shadow_sdwid-0)
		var s3=(shadow_imghig-0)-(shadow_sdwid-0)
		var s4=(shadow_imgwid-0)-(shadow_sdwid-0)
		var s5=(shadow_imgwid-0)+(shadow_sdwid-0)*2
		var s6=(shadow_imghig-0)+(shadow_sdwid-0)*2


	if(shadow_type > 0  && shadow_type < 3)
		{
		document.write("<table border=0 cellPadding=0 cellSpacing=0 width="+s1+" height="+s2+">");
		document.write("<tr>");
		document.write("<td width="+shadow_imgwid+" height="+shadow_imghig+">");
		if (shadow_linkurl == "")
			{
			document.write("<IMG align=middle border=0 src="+shadow_imgurl+" width="+shadow_imgwid+" height="+shadow_imghig+">");
			}
		else
			{
			document.write("<a href="+shadow_linkurl+" "+tg+" title="+shadow_linktit+"><IMG align=middle border=0 src="+shadow_imgurl+" width="+shadow_imgwid+" height="+shadow_imghig+"></a>");
			}
		document.write("</td>");
		document.write("<td width="+shadow_sdwid+" height="+shadow_imghig+">");
		document.write("<table border=0 cellPadding=0 cellSpacing=0 width="+shadow_sdwid+" height="+shadow_imghig+">");
		document.write("<tr><td background="+shadow_sd5+" vAlign=top width="+shadow_sdwid+" height="+shadow_sdwid+"></td></tr>");
		document.write("<tr><td background="+shadow_sd4+" vAlign=top width="+shadow_sdwid+" height="+s3+"></td></tr>");
		document.write("</table>");
		document.write("</td>");
		document.write("</tr>");
		document.write("<tr>");
		document.write("<td width="+shadow_imgwid+" height="+shadow_sdwid+">");
		document.write("<table border=0 cellPadding=0 cellSpacing=0 width="+shadow_imgwid+" height="+shadow_sdwid+">");
		document.write("<tr>");
		document.write("<td background="+shadow_sd1+" height="+shadow_sdwid+" width="+shadow_sdwid+">	</td>");
		document.write("<td background="+shadow_sd2+" height="+shadow_sdwid+" width="+s4+"></td>");
		document.write("</tr>");
		document.write("</table>");
		document.write("</td>");
		document.write("<td background="+shadow_sd3+" height="+shadow_sdwid+" width="+shadow_sdwid+">  </td>");
		document.write("</tr>");
		document.write("</table>");
		}
	if(shadow_type > 2)
		{
		document.write("<table border=0 cellPadding=0 cellSpacing=0 width="+s5+" height="+s6+">");
		document.write("<tr>");
		document.write("<td background="+sides_a00+" vAlign=top width="+shadow_sdwid+" height="+shadow_sdwid+"></td>");
		document.write("<td background="+sides_a01+" vAlign=top width="+shadow_imgwid+" height="+shadow_sdwid+"></td>");
		document.write("<td background="+sides_a02+" vAlign=top width="+shadow_sdwid+" height="+shadow_sdwid+"></td>");
		document.write("</tr>");
		document.write("<tr>");
		document.write("<td background="+sides_a10+" vAlign=top width="+shadow_sdwid+" height="+shadow_imghig+"></td>");
		document.write("<td width="+shadow_imgwid+" height="+shadow_imghig+">");
		if (shadow_linkurl == "")
			{
			document.write("<IMG align=middle border=0 src="+shadow_imgurl+" width="+shadow_imgwid+" height="+shadow_imghig+">");
			}
		else
			{
			document.write("<a href="+shadow_linkurl+" "+tg+" title="+shadow_linktit+"><IMG align=middle border=0 src="+shadow_imgurl+" width="+shadow_imgwid+" height="+shadow_imghig+"></a>");
			}
		document.write("</td>");
		document.write("<td background="+sides_a12+" vAlign=top width="+shadow_sdwid+" height="+shadow_imghig+"></td>");
		document.write("</tr>");
		document.write("<tr>");
		document.write("<td background="+sides_a20+" vAlign=top width="+shadow_sdwid+" height="+shadow_sdwid+"></td>");
		document.write("<td background="+sides_a21+" vAlign=top width="+shadow_imgwid+" height="+shadow_sdwid+"></td>");
		document.write("<td background="+sides_a22+" vAlign=top width="+shadow_sdwid+" height="+shadow_sdwid+"></td>");
		document.write("</tr>");
		document.write("</table>");
		}
	}



//跳转页面显示
function ShowPage(TotalPage,topage,url)
	{
	if (topage<6)
		{
		PageLong=11-topage;
		}
	else
		if (TotalPage-topage<6)
			{
			PageLong=10-(TotalPage-topage)
			}
		else
			{
			PageLong=5;
			}

	for (var i=1; i <= TotalPage; i++) 
		{
		if (i < topage+PageLong && i > topage-PageLong || i==1 || i==TotalPage)
			{
			if (topage==i)
				{
				//document.write(" [<font color=red>"+ i +"</font>] ");
				document.write(" <font color=red>"+ i +"</font> ");
				}
			else
				{
				//document.write(" [<b><a href=?topage="+i+"&"+url+">"+ i +"</a></b>] ");
				document.write(" <b><a href=?topage="+i+"&"+url+">"+ i +"</a></b> ");
				}
			}
		}
	}



//菜单
var menuOffX=0	//菜单距连接文字最左端距离
var menuOffY=25	//菜单距连接文字顶端距离

var menuOffX0=0	//菜单距连接文字最左端距离
var menuOffY0=20	//菜单距连接文字顶端距离

var menuOffX1=0	//菜单距连接文字最左端距离
var menuOffY1=30	//菜单距连接文字顶端距离

var menuOffX2=60	//菜单距连接文字最左端距离
var menuOffY2=-2	//菜单距连接文字顶端距离



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 showmenux(e,vmenu,mod)
	{
	which=vmenu
	menuobj=document.getElementById("popmenu")
	menuobj.thestyle=menuobj.style
	menuobj.innerHTML=which
	menuobj.contentwidth=menuobj.offsetWidth
	menuobj.contentheight=menuobj.contentheight+10
	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 showmenu0(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+menuOffX0
		else
			menuobj.thestyle.left=ie4? ie_x(event.srcElement)+menuOffX0 : ns6? window.pageXOffset+eventX : eventX
		
		if (bottomedge<menuobj.contentheight&&mod!=0)
			menuobj.thestyle.top=document.body.scrollTop+eventY-menuobj.contentheight-event.offsetY+menuOffY0-23
		else
			menuobj.thestyle.top=ie4? ie_y(event.srcElement)+menuOffY0 : ns6? window.pageYOffset+eventY+10 : eventY

	menuobj.thestyle.visibility="visible"
}


function showmenu1(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+menuOffX1
		else
			menuobj.thestyle.left=ie4? ie_x(event.srcElement)+menuOffX1 : ns6? window.pageXOffset+eventX : eventX
		
		if (bottomedge<menuobj.contentheight&&mod!=0)
			menuobj.thestyle.top=document.body.scrollTop+eventY-menuobj.contentheight-event.offsetY+menuOffY1-23
		else
			menuobj.thestyle.top=ie4? ie_y(event.srcElement)+menuOffY1 : ns6? window.pageYOffset+eventY+10 : eventY

	menuobj.thestyle.visibility="visible"
}

function showmenu2(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+menuOffX2
		else
			menuobj.thestyle.left=ie4? ie_x(event.srcElement)+menuOffX2 : ns6? window.pageXOffset+eventX : eventX
		
		if (bottomedge<menuobj.contentheight&&mod!=0)
			menuobj.thestyle.top=document.body.scrollTop+eventY-menuobj.contentheight-event.offsetY+menuOffY2-23
		else
			menuobj.thestyle.top=ie4? ie_y(event.srcElement)+menuOffY2 : 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 onmouseover=highlightmenu(event,'on') onmouseout=highlightmenu(event,'off');dynamichide(event)></div>")
//菜单END


function loadtree(ino,bbsname){
document.frames["hiddenframe"].location.replace("ForumTree.asp?id="+ino+"")
}


function loadThreadFollow(ino,online){
var targetImg =eval("followImg" + ino);
var targetDiv =eval("follow" + ino);
if (targetDiv.style.display!='block'){
targetDiv.style.display="block";
targetImg.src="images/minus.gif";
if(targetImg.loaded=="no"){document.frames["hiddenframe"].location.replace("loading.asp?id="+ino+"&forumid="+online+"");}
}else{
targetDiv.style.display="none";
targetImg.src="images/plus.gif";
}
}
document.write("<iframe height=0 width=0 name=hiddenframe></iframe>")
