<%
Dim LMT_UrlEndString
Function DisplayAnnouncesSplitPages

	Dim Rs,SQL,Temp

	Dim SQLEndString,WhereFlag
	WhereFlag = 1
	SQLEndString = " where BoardID=" & GBL_board_ID

	Dim ALL_Count
	ALL_Count = GBL_Board_TopicNum

	Dim RootID,Temp1,Temp2
	Dim Upflag

	RootID = Left(Request.QueryString("RootID"),14)
	If isNumeric(RootID)=0 Then RootID=0
	RootID = cCur(RootID)

	Dim LastNum,LastNumBak
	LastNum = 0
	
	LastNumBak = (ALL_Count mod DEF_MaxListNum)
	If LastNumBak = 0 Then LastNumBak = DEF_MaxListNum

	Upflag = Request.QueryString("Upflag")
	If Upflag<>"1" and Upflag<>"0" Then Upflag="0"
	If Upflag = "1" Then
		LastNum = Request.QueryString("Num")
		If LastNum <> "" Then
			LastNum = LastNumBak
		End If
	End If

	Dim Page,MaxPage,JMPage
	Page = Left(Request.QueryString("p"),14)
	If isNumeric(Page) = 0 or inStr(Page,".") > 0 Then Page = 0
	Page = cCur(Page)
	MaxPage = Fix(All_Count / DEF_MaxListNum)
	If (All_Count mod DEF_MaxListNum)<>0 Then MaxPage = MaxPage + 1
	MaxPage = MaxPage - 1
	If Page > MaxPage or LastNum > 0 Then
		Page = MaxPage
	End If

	JMPage = Left(Request.QueryString("q"),14)
	If isNumeric(JMPage) = 0 or inStr(JMPage,".") > 0 Then JMPage = 0
	JMPage = Fix(cCur(JMPage))
	If JMPage > DEF_MaxJumpPageNum Then JMPage = 0
	
	Dim JMPRootID
	JMPRootID = Left(Request.QueryString("r"),14)
	If isNumeric(JMPRootID)=0 Then JMPRootID=0
	JMPRootID = Fix(cCur(JMPRootID))
	
	If JMPage > Maxpage or Maxpage < 0 Then JMPage = 0
	If Upflag="0" and JMPage+Page > MaxPage Then JMPage = 0
	If Upflag="1" and JMPage+Page < 0 Then JMPage = 0
	If JMPRootID > GBL_Board_AllMaxRootID Then JMPage = 0
	If JMPRootID < GBL_Board_AllMinRootID Then JMPage = 0

	If RootID > 0 Then LMT_UrlEndString = LMT_UrlEndString & "&RootID=" & RootID
	If Page > 0 Then LMT_UrlEndString = LMT_UrlEndString & "&p=" & Page	
	If Upflag = "1" Then LMT_UrlEndString = LMT_UrlEndString & "&Upflag=" & Upflag	
	If LastNum <> 0 Then LMT_UrlEndString = LMT_UrlEndString & "&Num=1"
	If JMPage > 0 Then LMT_UrlEndString = LMT_UrlEndString & "&q=" & JMPage
	If JMPRootID > 0 Then LMT_UrlEndString = LMT_UrlEndString & "&r=" & JMPRootID
	
	If Upflag="1" Then
		Page = Page - JMPage
	Else
		Page = Page + JMPage
	End If

	If Page = 0 Then '开启此项则当页数为0时即忽略一切信息的返回首页
		JMPage = 0
		JMPRootID = 0
		LastNum = 0
		Upflag = "0"
		RootID = 0
	End If

	Dim HaveRootIDFlag
	Dim FirstRootID,LastRootID

	If Temp1+1<DEF_MaxListNum and All_Count > 0 Then
		If Upflag="0" Then
			If JMPage > 0 Then
				If JMPRootID<>0 Then
					If WhereFlag = 1 Then
						SQLEndString = SQLEndString & " And RootID<" & JMPRootID
					Else
						SQLEndString = SQLEndString & " Where RootID<" & JMPRootID
						WhereFlag = 1
					End If
				End If
			Else
				If RootID<>0 Then
					If WhereFlag = 1 Then
						SQLEndString = SQLEndString & " And RootID<" & RootID
					Else
						SQLEndString = SQLEndString & " Where RootID<" & RootID
						WhereFlag = 1
					End If
				End If
			End If
		Else
			If JMPage > 0 Then
				If WhereFlag = 1 Then
					SQLEndString = SQLEndString & " And RootID>" & JMPRootID
				Else
					SQLEndString = SQLEndString & " Where RootID>" & JMPRootID
					WhereFlag = 1
				End If
			Else
				If RootID>=GBL_Board_AllMaxRootID Then
					RootID = GBL_Board_AllMaxRootID-1
					'TopicSortID = GBL_Board_AllMaxRootID + 1
				
					If RootID<>0 Then
						If WhereFlag = 1 Then
							SQLEndString = SQLEndString & " And RootID>" & RootID
						Else
							SQLEndString = SQLEndString & " Where RootID>" & RootID
							WhereFlag = 1
						End If
					End If
				Else
					If RootID<>0 Then
						If WhereFlag = 1 Then
							SQLEndString = SQLEndString & " And RootID>" & RootID
						Else
							SQLEndString = SQLEndString & " Where RootID>" & RootID
							WhereFlag = 1
						End If
					End If
				End If
			End If
		End If

		Dim NoPage
		NoPage = 0

		If Page < 0 or (Page > MaxPage and MaxPage>=(DEF_MaxJumpPageNum-1)) or (Page > (DEF_MaxJumpPageNum-1) and Page<(MaxPage-DEF_MaxJumpPageNum+1)) Then NoPage = 1
		If (RootID > 0 or LastNum>0 or NoPage = 1) and JMPage < 1 Then
			If Upflag="0" Then
				SQLEndString = SQLEndString & " order by RootID DESC"
			Else
				SQLEndString = SQLEndString & " order by RootID ASC"
			End If
			If LastNum > 0 Then
				Temp = LastNum
			Else
				Temp = DEF_MaxListNum
			End If
		Else
			If JMPage > 0 Then
				If Upflag="0" Then
					SQLEndString = SQLEndString & " order by RootID DESC"
					Upflag="0"
					Temp = (JMPage-1) * DEF_MaxListNum + DEF_MaxListNum
				Else
					SQLEndString = SQLEndString & " order by RootID ASC"
					Upflag="1"
					Temp = (JMPage-1) * DEF_MaxListNum + DEF_MaxListNum
				End If
			Else
				If Page < DEF_MaxJumpPageNum Then
					SQLEndString = SQLEndString & " order by RootID DESC"
					Upflag="0"
					Temp = Page * DEF_MaxListNum + DEF_MaxListNum
				Else
					SQLEndString = SQLEndString & " order by RootID ASC"
					Upflag="1"
					Temp = (MaxPage-Page) * DEF_MaxListNum + LastNumBak
				End If
			End If
		End If

		Dim FirstRootID_2,LastRootID_2
		Dim GetData_2

		SQL = "select top " & Temp & " id,ChildNum,Title,FaceIcon,LastTime,Hits,Length,UserName,UserID,RootID,LastUser,NotReplay,GoodFlag,BoardID,TopicType,PollNum,TitleStyle,LastInfo,ndatetime,GoodAssort from LeadBBS_Topic " & SQLEndString
		Set Rs = Con.ExeCute(SQL)
		GBL_DBNum = GBL_DBNum + 1

		If LastNum = "" or isNull(LastNum) then LastNum = 0
		LastNum = cCur(LastNum)
		If (RootID = 0 and Page >= 1 and LastNum = 0 and NoPage = 0) or JMPage > 0 Then
			If Not Rs.Eof Then
				If JMPage > 0 Then
					If Upflag="0" Then
						Rs.Move (JMPage-1)* DEF_MaxListNum
					Else
						If Page < MaxPage Then
							Rs.Move (JMPage-2) * DEF_MaxListNum + DEF_MaxListNum
						End If
					End If
				Else
					If Page < DEF_MaxJumpPageNum Then
						Rs.Move Page * DEF_MaxListNum
					Else
						If Page < MaxPage Then
							Rs.Move (MaxPage-Page-1) * DEF_MaxListNum + LastNumBak
						End If
					End If
				End If
			End If
		End If
		If Not Rs.Eof Then
			HaveRootIDFlag = 1
			GetData_2 = Rs.GetRows(DEF_MaxListNum)
		Else
			HaveRootIDFlag = 0
		End If
		Rs.Close
		Set Rs = Nothing
	
		If HaveRootIDFlag = 1 Then
			Temp2 = Ubound(GetData_2,2)
			FirstRootID_2 = cCur(GetData_2(9,0))
			LastRootID_2 = cCur(GetData_2(9,Temp2))
				
			If FirstRootID_2<LastRootID_2 Then
				SQL = FirstRootID_2
				FirstRootID_2 = LastRootID_2
				LastRootID_2 = SQL
			End If
	
			LastRootID = LastRootID_2
			FirstRootID = FirstRootID_2
		Else
			Temp2 = 0
		End If
	Else
		HaveRootIDFlag = 0
	End If
	
	Dim GetDataTop,AllTopNum,N
	AllTopNum = -1
	If FirstRootID >= GBL_Board_AllMaxRootID Then
		GetDataTop = application(DEF_MasterCookies & "TopAnc")
		If isArray(GetDataTop) = False Then
			If GetDataTop & "" <> "yes" Then
				ReloadTopAnnounceInfo(0)
			End If
		Else
			GetDataTop = application(DEF_MasterCookies & "TopAnc")
			AllTopNum = Ubound(GetDataTop,2)
		End If
	End If
	
	Dim GetDataPartTop,PartTopNum
	PartTopNum = -1
	If FirstRootID >= GBL_Board_AllMaxRootID Then
		GetDataPartTop = application(DEF_MasterCookies & "TopAnc" & GBL_Board_BoardAssort)
		If isArray(GetDataPartTop) = False Then
			If GetDataPartTop & "" <> "yes" Then
				ReloadTopAnnounceInfo(GBL_Board_BoardAssort)
			End If
		Else
			GetDataPartTop = application(DEF_MasterCookies & "TopAnc" & GBL_Board_BoardAssort)
			PartTopNum = Ubound(GetDataPartTop,2)
		End If
	End If

	SQL = "?BoardID=" & GBL_board_ID
	Dim PageSplitString,PageSplitString2
	PageSplitString = "<tr bgcolor=" & DEF_BBS_LightestColor & " height=25 class=TBBG9><td colspan=5><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><img src=../images/null.gif width=2 height=2><br>&nbsp;"
	If FirstRootID >= GBL_Board_AllMaxRootID Then
		PageSplitString = PageSplitString & "<font color=888888 class=GrayFont><font face=webdings title=首页>9</font></font>"
		PageSplitString = PageSplitString & " <font color=888888 class=GrayFont><font face=webdings title=上页>7</font></font>"
	Else
		PageSplitString = PageSplitString & "<a href=Board_txt.asp" & SQL & "&p=0><font face=webdings title=首页>9</font></a>"
		PageSplitString = PageSplitString & " <a href=Board_txt.asp" & SQL & "&RootID=" & FirstRootID & "&Upflag=1&p=" & Page-1 & "><font face=webdings title=上页>7</font></a>"
	End If
	
	Dim DN
	DN = DEF_DisplayJumpPageNum
	Dim For1,For2,StepValue,DotFlag
	DotFlag = 0
	PageSplitString = PageSplitString & " "

	If MaxPage > 0 Then
		For1 = Page - DN
		For2 = Page + DN
		If For1 < 0 Then
			For1 = 0
		End If
		If For2 >= MaxPage Then For2 = MaxPage
		If For2 > MaxPage Then For2 = MaxPage
		If For2 - For1 < DEF_MaxJumpPageNum and For1 > 1 and For2 > For1 Then For1 = For1 - (DEF_MaxJumpPageNum - ((For2 - For1) + 1))
		
		If For1 < 0 Then
			For1 = 0
		ElseIf For1 > 0 Then
			PageSplitString = PageSplitString & " ..."
		End If

		If For2 - For1 < DEF_MaxJumpPageNum and For2 < MaxPage and For2 > For1 Then For2 = For2 + (DEF_MaxJumpPageNum - ((For2 - For1) + 1))
		If For2 >= MaxPage Then For2 = MaxPage

		For N = For1 to For2
			If N <> For1 Then PageSplitString = PageSplitString & " "
			If N = Page Then
				PageSplitString = PageSplitString & "<font color=Red class=RedFont>" & N + 1 & "</font>"
			Else
				If (N-Page) > 0 Then
					PageSplitString = PageSplitString & "<a href=Board_txt.asp" & SQL & "&r=" & LastRootID & "&Upflag=0&p=" & page & "&q=" & N-Page & ">" & N + 1 & "</a>"
				Else
					PageSplitString = PageSplitString & "<a href=Board_txt.asp" & SQL & "&r=" & FirstRootID & "&Upflag=1&p=" & page & "&q=" & Page-N & ">" & N + 1 & "</a>"
				End If
			End If
			DotFlag = 2
		Next
		If For2 < MaxPage Then
			PageSplitString = PageSplitString & "..."
			DotFlag = 1
		End If
	Else
		PageSplitString = PageSplitString & " <font color=888888 class=GrayFont>1</font> "
	End If

	PageSplitString = PageSplitString & " "

	If LastRootID <= GBL_Board_AllMinRootID Then
		PageSplitString = PageSplitString & " <font color=888888 class=GrayFont><font face=webdings title=下页>8</font></font>"
		PageSplitString = PageSplitString & " <font color=888888 class=GrayFont><font face=webdings title=尾页>:</font></font>"
	Else
		PageSplitString = PageSplitString & " <a href=Board_txt.asp" & SQL & "&RootID=" & LastRootID & "&p=" & Page+1 & "><font face=webdings title=下页>8</font></a>"
		PageSplitString = PageSplitString & " <a href=Board_txt.asp" & SQL & "&Upflag=1&Num=1&p=" & MaxPage & "><font face=webdings title=尾页>:</font></a>"
	End If

	Rs = Temp1
	Rs = Temp2+Rs
	If HaveRootIDFlag = 1 Then Rs = Rs+1

	If AllTopNum <> -1 Then
		ALL_Count = ALL_Count + AllTopNum + 1
		Rs =  Rs + AllTopNum + 1
	End If
	If PartTopNum <> -1 Then
		ALL_Count = ALL_Count + PartTopNum + 1
		Rs =  Rs + PartTopNum + 1
	End If
	if MaxPage < 1 Then MaxPage = 0
	'if MaxPage > 0 Then MaxPage = MaxPage + 1
	PageSplitString = PageSplitString & " 共<b>" & ALL_Count &"</b>主题 第<b>" & Page+1 & "</b>/<b>" & MaxPage+1 & "</b>页 每页<b>" & DEF_MaxListNum & "</b>条<td align=right><img src=../images/null.gif width=2 height=2><br>"
	PageSplitString2 = "</td></tr></table></td></tr>"
	For1 = 0
	For2 = 0
	If Rs < DEF_MaxListNum and GBL_ShowBottomSure = 0 Then GBL_SiteBottomString = ""
	%>
<script language=javascript>

var Temp,Temp1,T1,T2="";
var now = "<%=Left(GetTimeValue(DEF_Now),8)%>";
<%
	Dim TArray,Num
	TArray = Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID & "_TI")
	If isArray(TArray) = False Then%>
	var GN=new Array([0,"",""]);
	<%
	Else
		Num = Ubound(TArray,2)
		Response.Write "var GN=new Array([" & TArray(0,0) & ",""" & Replace(Replace(TArray(1,0) & "","\","\\"),"""","\""") & """,""""]"

		For N = 1 To Num
			Response.Write ",[" & TArray(0,N) & ",""" & Replace(Replace(TArray(1,N) & "","\","\\"),"""","\""") & """,""""]"
		Next
		Response.Write ");"
	End If
%>
for(T1=0;T1<GN.length;T1++){GN[T1][2] = KillHTMLLabel(GN[T1][1]);}

function Show2(obj,objtd,obj2,id)
{
	if (EndFlag==0){alert("网页未下载完成,请稍候...");return;}
	if (obj.style.display!='block')
	{
		obj.style.display="block";
		obj2.src="../images/<%=GBL_DefineImage%>Expand.gif";
		if(obj2.loaded=="no"){objtd.innerHTML="下载中...";document.frames["hiddenframe"].location.replace("SmallList.asp?id="+id);}
		}else{
		obj.style.display="none";
		obj2.src="../images/<%=GBL_DefineImage%>clsExpand.gif";
	}
}

function leadbbs(AllFlag,G0,G2,G4,G5,G6,G7,G8,G9,G10,G11,G13,G14,G15,G16,G17,G18,G19,G20,G21,G22)
{
	document.write("<tr  height=25 bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9><td bgcolor=<%=DEF_BBS_LightColor%> class=TBBG9 colspan=5>");
	if(AllFlag == 1 || AllFlag == 2)
	{
		if(AllFlag == 1){Temp = "[总固顶]";}else{Temp = "[区置顶]";}
	}
	else
	{
		if(G11>=<%=DEF_BBS_TOPMinID%>)
		{
			Temp = "[置顶]";
		}
		else
		{
			if(G17 == 80)
			{
				if(G18 >= 20)
				{
					Temp = "[投票]";
				}
				else
				{
					Temp = "[投票]";
				}
			}
			else
			{
				
				if(G21.substr(0,8)==now)
				{
					Temp = "[新帖]";
				}
				else
				{
					if(G15 == 1 || G15 == true){Temp = "[精华]";}
					else{
						if(G2 >= 20){Temp = "[热帖]";}
						else{Temp = "";}
					}
				}
			}
			if(G14 == 1)Temp+="[锁定]";
		}
	}
	document.write(Temp);
	if(G2 > 0){document.write("<img src=../images/<%=GBL_DefineImage%>clsExpand.gif id=LeadImg" + G0 + " name=LeadImg" + G0 + " width=16 height=16 align=absmiddle onclick=Show2(Lead" + G0 + ",LeadTD" + G0 + ",LeadImg" + G0 + "," + G0 + ") loaded=no style=cursor:hand>");}
	else{document.write("<img src=../images/<%=GBL_DefineImage%>Expand.gif width=16 height=16 align=absmiddle>");}

	if(G8 > 1024)
	{
		G8 = "主题内容：" + Math.round((G8/1024)) + " KB";
	}
	else
	{
		G8 = "主题内容：" + G8 + " 字节";
	}
	if(G20 != "")G8 = G8 + "\n" + "发表时间：" + G21.substr(0,4) + "-" + G21.substr(4,2) + "-" + G21.substr(6,2) + " " + G21.substr(8,2) + ":" + G21.substr(10,2) + "\n" + "最后回复：" + htmlencode(G20);

	Temp1 = Math.round((G2+1)/<%=DEF_TopicContentMaxListNum%>);
	if(Temp1 < ((G2+1)/<%=DEF_TopicContentMaxListNum%>))Temp1+=1;
	if(G2>=<%=DEF_TopicContentMaxListNum%>)
	{
		Temp = <%=DEF_BBS_DisplayTopicLength%> - (Temp1+"").length - 3;
	}
	else
	{
		Temp = <%=DEF_BBS_DisplayTopicLength%>;
	}


	if(G22 > 0)
	{
		T2 = "";
		for(T1=0;T1<GN.length;T1++)
		{
			if(GN[T1][0]==G22)
			{
				T2=strlength(GN[T1][2]);
				if(T2<=14)
				{Temp-=(T2+4);T2=GN[T1][1];}
				else{Temp-=18;T2=LeftTrue(GN[T1][2],11) + "...";}
				break;
			}
		}
	}
	else{T2="";}

	if(G19 != 1 && strlength(G4)>Temp)G4 = LeftTrue(G4,Temp-3) + "...";

	if(T2!="")document.write("【<a href=../Board/EBoard.asp?BoardID=" + G16 + "&E=1&EID=" + G22 + ">" + T2 + "</a>】");
	document.write("<a href=../Announce/textview.asp?BoardID=" + G16 + "&ID=" + G0 + "<%=LMT_UrlEndString%> title=\"" + G8 + "\">");
	if(G17 != 80 && G17 != 54 && G18 > 0)document.write("<img src=../images/<%=GBL_DefineImage%>TC/" + G18 + ".gif align=absmiddle width=16 height=16 border=0>");
	if(G19 == 0)
	{
		document.write(htmlencode(G4));
	}
	else
	{
		document.write(DisplayAnnounceTitle(G4,G19));
	}
	document.write("</a>");
	if(G10 > 0)
	{
		document.write("〖作者:<a href=../User/LookUserInfo.asp?ID=" + G10 + ">" + htmlencode(G9) + "</a>");
	}
	else
	{
		document.write(htmlencode(G9));
	}
	document.write("&nbsp;");

	if(G18 == null)G18 = 0;
	if(G17 == 80)
	{
		document.write("共" + G18 + "票");
	}
	else
	{
		if(G7>=10000)G7="<font color=blue class=BlueFont title='人气:" + G7 + "'>" + parseInt(G7/10000)+"</font>万";
		if(G2>=10000)G2="<font color=blue class=BlueFont title='回帖:" + G2 + "'>" + parseInt(G2/10000)+"</font>";
		document.write(G2 + "/" + G7);
	}
	document.write("&nbsp;");
	if(G6.substr(0,8)==now)document.write("<font color=990000 class=RedFont>");

	G6 = G6.substr(0,4) + "-" + G6.substr(4,2) + "-" + G6.substr(6,2) + " " + G6.substr(8,2) + ":" + G6.substr(10,2);
	document.write("最后回复:"+ G6  + "〗</td></tr>");

	document.write("<tr style=\"DISPLAY: none\" id=Lead" + G0 + " bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9><td colspan=5 id=LeadTD" + G0 + "></td></tr>")
}		

function DisplayAnnounceTitle(str,style)
{
	switch(style)
	{
		case 1: return(str);
		case 2: return("<font color=red class=RedFont>" + htmlencode(str) + "</font>");
		case 3: return("<font color=green class=GreenFont>" + htmlencode(str) + "</font>");
		case 4: return("<font color=blue class=BlueFont>" + htmlencode(str) + "</font>");
		default: return(htmlencode(str));
	}
}

function htmlencode(str)
{
	var re = /(<)/gi;
	var rv = str.replace(re,"&lt;");
	re = /(>)/gi;
	rv = rv.replace(re,"&gt;");
	re = /(\")/gi;
	rv = rv.replace(re,"&quot;");
	return(rv);
}

function LeftTrue(str,n)
{
	var mx=String.fromCharCode(127);
	if(str.length<=n/2)
	{
		return(str);
	}
	else
	{
		var TStr="";
		var l,t=0;
		var i;
		l=str.length;
		for(i=0;i<l;i++)
		{
			if(str.charAt(i)>mx)
			{
				t=t+2;
			}
			else
			{
				t=t+1;
			}
			if(t>n)break;
			TStr=TStr+str.charAt(i);
		}
		return(TStr);
	}
}


function strlength(str)
{
	var mx=String.fromCharCode(127);
	if(str.length==0)
	{
		return(0);
	}
	else
	{
		var TStr="";
		var l,t,c;
		var i;
		l=str.length;
		t=l;
		for(i=0;i<l;i++)
		{
			if(str.charAt(i)>mx)
			{
				t+=1;
			}
		}
		return(t);
	}
}
function KillHTMLLabel(str)
{
	var n,m,str2;
	n = str.indexOf("<");
	m = str.indexOf(">");
	str2 = str;
	while(n >= 0 && n < m)
	{
		str2 = str2.substr(0,n) + str2.substr(m+1);
		n = str2.indexOf("<");
		m = str2.indexOf(">");
	}
	return(str2);
}
</script>



<%If GBL_TableHeadString <> "" Then%><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableHeadString%></td></tr></table><%End If%>
<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="<%=DEF_BBS_DarkColor%>" class=TBone>
<tr>
	<td>
	<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">

	<%Response.Write PageSplitString
	Response.Write PageSplitString2%>
	<tr height=20 bgcolor=<%=DEF_BBS_LightDarkColor%> align=center>
		<td align=left class=TBHead2 colspan=5><img src=../images/null.gif width=300 height=2><br>&nbsp;<b><font color=ffffff class=HeadFont>主题</font></b>&nbsp;&nbsp;&nbsp;<A HREF="Board.asp?BoardID=<%=GBL_board_ID%>" >[切换到完整模式]</A></td>
	</tr><%
	If AllTopNum <> -1 Then
		DisplayAnnounceData 0,AllTopNum,1,GetDataTop,1
	End If
	If PartTopNum <> -1 Then
		DisplayAnnounceData 0,PartTopNum,1,GetDataPartTop,2
	End If
	If Upflag="0" Then
		If HaveRootIDFlag = 1 Then
			If Upflag="0" Then
				For1 = 0
				For2 = Temp2
				StepValue = 1
			Else
				For1 = Temp2
				For2 = 0
				StepValue = -1
			End If
			DisplayAnnounceData For1,For2,StepValue,GetData_2,0
		End If
	Else

		If HaveRootIDFlag = 1 Then
			If Upflag="0" Then
				For1 = 0
				For2 = Temp2
				StepValue = 1
			Else
				For1 = Temp2
				For2 = 0
				StepValue = -1
			End If
			DisplayAnnounceData For1,For2,StepValue,GetData_2,0
		End If
	End If
	Response.Write PageSplitString
	%>
	<!-- #include file=../../inc/IncHtm/BoardJump.asp -->
	<%
	Response.Write PageSplitString2
	Response.Write "</table>"%></td>
	</tr>
	</table>
	<%If GBL_TableBottomString <> "" Then%><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><%End If%>
	<%

End Function

Function DisplayAnnounceData(For1,For2,StepValue,GetData,AllFlag)

	Dim N,Temp,Temp1
	Response.Write "<script language=javascript>" & VbCrLf
	For N = For1 to For2 Step StepValue
		If AllFlag = 0 or GBL_Board_ID <> cCur(GetData(13,N)) Then
			'GetData(2,n) = Replace(GetData(2,n),"&#60","&lt;")
			If GetData(16,n) <> 1 Then GetData(2,n) = Replace(GetData(2,n) & "","<","&lt;")
			If GetData(16,n) >=60 Then
				GetData(2,n) = "<font color=gray class=GrayFont>帖子等待审核中...</font>"
				GetData(16,n) = 1
			End If
			GetData(17,n) = Replace(Replace(Replace(Replace(Replace(GetData(17,N) & "","\","\\"),"""","\"""),"<","&lt;"),VbCrLf,"\n"),chr(13),"")
			Response.Write "leadbbs(" & AllFlag & "," & GetData(0,N) & "," & GetData(1,N) & ",""" & Replace(Replace(GetData(2,N) & "","\","\\"),"""","\""") & ""","
			Response.Write GetData(3,N) & ",""" & GetData(4,N) & ""","
			Response.Write GetData(5,N) & "," & GetData(6,N) & ",""" & Replace(Replace(Replace(GetData(7,N) & "","\","\\"),"""","\"""),"<","&lt;") & ""","
			Response.Write GetData(8,N) & "," & GetData(9,N) & ",""" & Replace(Replace(Replace(GetData(10,N) & "","\","\\"),"""","\"""),"<","&lt;") & """," & GetData(11,n) & "," & GetData(12,N) & "," & GetData(13,N) & "," & GetData(14,N) & "," & GetData(15,N) & "," & GetData(16,N) & ",""" & GetData(17,n) & """,""" & GetData(18,N) & """," & GetData(19,N) & ");" & VbCrLf
		End If
	Next
	Response.Write "</script>" & VbCrLf

End Function

Sub ReloadTopAnnounceInfo(TID)

	If isNumeric(TID) = 0 Then Exit Sub
	TID = Fix(cCur(TID))
	Dim Rs,GetDataTop,TIDStr
	If TID = 0 Then
		TIDStr = ""
	Else
		TIDStr = TID
	End If
	Set Rs = Con.ExeCute("Select RootID,BoardID from LeadBBS_TopAnnounce where TopType=" & TID)
	GBL_DBNum = GBL_DBNum + 1
	If Rs.Eof Then
		Application.Lock
		application(DEF_MasterCookies & "TopAnc" & TIDStr) = "yes"
		application(DEF_MasterCookies & "TopAncList" & TIDStr) = ""
		Application.UnLock
		Rs.Close
		Set Rs = Nothing
		Exit Sub
	Else
		GetDataTop = Rs.GetRows(-1)
		Rs.close
		Set Rs = Nothing
	End If
	
	Dim Temp,N
	Temp = ""
	If cCur(GetDataTop(0,0)) > 0 Then Temp = GetDataTop(0,0)
	For N = 1 to Ubound(GetDataTop,2)
		If cCur(GetDataTop(0,N)) > 0 Then Temp = Temp & "," & GetDataTop(0,N)
	Next
	If Left(Temp,1) = "," Then Temp = Mid(Temp,2)
	If cStr(Temp) <> "" Then
		Set Rs = Con.ExeCute("select top " & Ubound(GetDataTop,2)+1 & " id,ChildNum,Title,FaceIcon,LastTime,Hits,Length,UserName,UserID,RootID,LastUser,NotReplay,GoodFlag,BoardID,TopicType,PollNum,TitleStyle,LastInfo,ndatetime,GoodAssort from LeadBBS_Topic where ID in(" & Temp & ")")
		GBL_DBNum = GBL_DBNum + 1
		If Not Rs.Eof Then
			GetDataTop = Rs.GetRows(-1)
			Rs.Close
			Set Rs = Nothing
			Application.Lock
			application(DEF_MasterCookies & "TopAnc" & TIDStr) = GetDataTop
			Application.UnLock
			Application.Lock
			application(DEF_MasterCookies & "TopAncList" & TIDStr) = "," & Temp & ","
			Application.UnLock
		Else
			Rs.Close
			Set Rs = Nothing
			Application.Lock
			application(DEF_MasterCookies & "TopAnc" & TIDStr) = "yes"
			Application.UnLock
		End If
	Else
		Application.Lock
		application(DEF_MasterCookies & "TopAnc" & TIDStr) = "yes"
		Application.UnLock
	End If

End Sub%>