<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/User_Setup.ASP -->
<!-- #include file=../inc/Upload_Setup.ASP -->
<!-- #include file=../inc/Ubbcode.asp -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=../inc/Constellation.asp -->
<!-- #include file=inc/announce_fun.asp -->
<!-- #include file=inc/Poll_fun.asp -->
<!-- #include file=inc/MakeAnnounceTop.asp -->
<!-- #include file=../inc/Limit_Fun.asp -->
<%
Const LMT_RefreshEnable = 0
Dim LMT_DefaultEdit
LMT_DefaultEdit = DEF_UbbDefaultEdit
DEF_BBS_HomeUrl = "../"
Const LMTDEF_MaxReAnnounce = 1500 '仅在允许树形下限制才会有效

Dim Article_NotReplay
Dim Form_ID,Form_ParentID,Form_TopicSortID,Form_BoardID,Form_RootID,Form_ChildNum
Dim Form_RootMinID,Form_RootMaxID
Dim Form_Layer,Form_Title,Form_Content,Form_PrintContent,Form_FaceIcon,Form_ndatetime,Form_LastTime
Dim Form_Hits,Form_Length,Form_UserName,Form_UserID,Form_HTMLFlag,Form_UnderWriteFlag
Dim Form_UserPass,Form_NoUserUnderWriteFlag,Form_NotReplay
Dim Form_AnnounceIsTopFlag,Form_FaceUrl,Form_FaceWidth,Form_FaceHeight
Dim Form_TopicType,Form_NeedValue,Form_OtherInfo,Form_GoodAssort
Dim Form_TopicType_Old,Form_NeedValue_Old,RootTopicType
Dim Form_VoteFlag,Form_VoteItem,Form_Vote_ExpireDay,Form_VoteType,Form_UserTitle,Form_TitleStyle,Form_PollNum,Form_CachetValue,Form_CharmPoint
Form_Vote_ExpireDay = 0
Form_VoteType = 0
Form_TitleStyle = 0
Form_NoUserUnderWriteFlag = 1
Form_GoodAssort = 0

Dim LMT_RootID,LMT_TopicName,LMT_ChildNum,LMT_RootIDBak,LMT_TopicTitleStyle,LMT_TopicNameNoHTML,LMT_LastInfo,LMT_TopicNameNoHTML_Temp
LMT_RootIDBak = 0
Form_ChildNum = 0

Form_HTMLFlag = 2

const PageSplitNum = 10

Rem 新发表帖子的ＩＤ号
Dim NewAnnounceID
NewAnnounceID = 0

Dim ChangeLMTFlag
ChangeLMTFlag = 0
If Request("LMT_DefaultEdit") <> "" Then
	LMT_DefaultEdit = Left(Request("LMT_DefaultEdit"),2)
	If LMT_DefaultEdit = "10" or LMT_DefaultEdit = "01" Then ChangeLMTFlag = 1
	If LMT_DefaultEdit = "10" or LMT_DefaultEdit = "0" Then
		LMT_DefaultEdit = 0
	Else
		LMT_DefaultEdit = 1
	End If
End If

If Request("submitflag") = "" and isNumeric(Request("ID") & "") <> 0 Then
	ChangeLMTFlag = 0
	LMT_DefaultEdit = 1
End If

Dim LMT_MaxTextLength
If CheckSupervisorUserName = 0 Then
	LMT_MaxTextLength = DEF_MaxTextLength
Else
	LMT_MaxTextLength = DEF_MaxTextLength * 4
End If

Function DisplayAnnounceForm

	GBL_CHK_TempStr = ""
	If Form_ParentID = 0 Then
		CheckBoardAnnounceLimit
	Else
		CheckBoardReAnnounceLimit
	End If
	CheckUserAnnounceLimit
	If GBL_CHK_TempStr <> "" Then Exit Function
	If Article_NotReplay = 1 Then Exit Function
%>

<script language=javascript>
<!--

	var EFlag = <%=LMT_DefaultEdit%>;
	var ValidationPassed = true;
	function rightStr(str,n)
	{
		if(str.length<=n)
		{
			return(str);
		}
		{
			return(str.substr(str.length-n,n));
		}
	}
	
	function insertHTML2(html) {
			LEADEDT.focus();
			if (!validateMode()) return;
			if (LEADEDT.document.selection.type.toLowerCase() != "none")
				LEADEDT.document.selection.clear() ;
			LEADEDT.document.selection.createRange().pasteHTML(html) ; 
			LEADEDT.focus();
	}

	function addcontent(str1,str2)
	{
		if(EFlag == 1)
		{
			LeadBBSFm.Form_Content.focus();
			if ((document.selection)&&(document.selection.type== "Text"))
			{
				var range= document.selection.createRange();
				var ch_text=range.text;
				range.text= str1 + ch_text + str2;
			} 
			else
			{
				document.LeadBBSFm.Form_Content.value=document.LeadBBSFm.Form_Content.value+str1+str2;
				LeadBBSFm.Form_Content.focus();
			}
		}
		else{insertHTML2(str1+str2);return;}
	}
	function submitonce(theform)
	{
		var lg;<%If DEF_EnableAttestNumber > 2 Then%>
		
		if(theform.ForumNumber.value=="")
		{
			alert("请输入验证码!\n");
			ValidationPassed = false;
			theform.ForumNumber.focus();
			return;
		}
		else
		{ValidationPassed = true;
		}<%End If%>
		if(EFlag == 1)
		{
			lg = theform.Form_Content.value.length
		}
		else
		{
			lg = LEADEDT.document.body.innerHTML.length;
		}
		if(lg > <%=LMT_MaxTextLength%>)
		{
			alert("发表的内容超过了<%=LMT_MaxTextLength%>文字，目前长度" + lg + "文字\n");
			ValidationPassed = false;
			return;
		}
		else
		{
			ValidationPassed = true;
		}
		if (document.all||document.getElementById)
		{
			for (i=0;i<theform.length;i++)
			{
				var tempobj=theform.elements[i];
				if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
				tempobj.disabled=true;
			}
		}
	}

	function storeCaret (textEl)
	{
		if (textEl.createTextRange) 
		textEl.caretPos = document.selection.createRange().duplicate(); 
	}

	function checklength()
	{
		if(EFlag == 1)
		{
			alert("帖子内容长度: "+document.LeadBBSFm.Form_Content.value.length+" 个字，\n最多允许<%=LMT_MaxTextLength%>字节。");
		}
		else
		{
			alert("帖子内容长度: "+LEADEDT.document.body.innerHTML.length+" 个字，\n最多允许<%=LMT_MaxTextLength%>字。");
		}
	}

	function ctlkey()
	{
		if(event.ctrlKey && window.event.keyCode==13){submitonce(document.LeadBBSFm);if(ValidationPassed)document.LeadBBSFm.submit();}
		if(event.altKey && (window.event.keyCode==83 || window.event.keyCode==115)){submitonce(document.LeadBBSFm);if(ValidationPassed)document.LeadBBSFm.submit();}
	}
	function changemode(mode)
	{
		submitonce(document.LeadBBSFm);
		if(ValidationPassed == true)
		{
			document.LeadBBSFm.LMT_DefaultEdit.value = mode;
			document.LeadBBSFm.submit();
		}
	}
	var ie = (document.all)? true:false
	if (ie)
	{
		window.document.onkeydown=ctlkey;
	}
//-->
</script>
<%If Request("submitflag") = "" and Form_ParentID > 0 Then%><img src=../images/null.gif height=4 width=2><br><%End If
If GBL_TableHeadString <> "" Then
	Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"
	Response.Write GBL_TableHeadString
	Response.Write "</td></tr></table>"
End If%><table border=0 cellpadding=0 cellspacing=0 width="<%=DEF_BBS_ScreenWidth%>" align="center">
<tbody>
<tr>
<td>
<table border=0 cellpadding=0 cellspacing=0 width="100%">
<tbody>
<tr>
	<td>
		<table border=0 cellpadding=5 cellspacing=1 width="100%" bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightDarkColor%> colspan="2" class=TBHead><img src=../images/null.gif width=2 height=3><br><b><font color="#ffffff" class=HeadFont><%
			If cCur(Form_ParentID)=0 Then
				If Form_VoteFlag <> "" and Form_ParentID = 0 Then
					Response.Write "发表新投票 注意: *为必填项"
				Else
					Response.Write "发表新帖子 注意: *为必填项"
				End If
			Else
				Response.Write LMT_TopicNameNoHTML_Temp
			End If
			If GBL_BoardMasterFlag <4 and GetBinarybit(GBL_Board_BoardLimit,13) = 1 Then
				Response.Write "<b>，你在此版发表的帖子需要等待管理员审核才能正常显示．</b>"
			End If%></font></b>
			</td>
		</tr>
		<form action=announce2.asp method=post name=LeadBBSFm onSubmit="submitonce(this);return ValidationPassed;">
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>*用户名<br><img src=../images/blank.gif width=<%=DEF_BBS_LeftTDWidth%> height=2></td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<input maxlength=20 name=User value="<%=htmlencode(Form_UserName)%>" size="20" class=fminpt> 没有注册的<a href=../User/UserJoin.asp>点击这里注册</a>新用户<%If GetBinarybit(GBL_Board_BoardLimit,9) = 1 Then%>，可以不填写<%End If%></td>
                </tr>
         <tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>密码</td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<TABLE border=0 cellpadding="0" cellspacing="0">
					<TR>
						<TD width=20>
				<input maxlength=20 type=password name=Pass value="<%'=htmlencode(Form_UserPass)%>" size="20" class=fminpt></td><%If GetBinarybit(GBL_Board_BoardLimit,9) = 1 Then%><td>&nbsp;可以不填写</td><%End If%>
				<%If DEF_EnableAttestNumber > 2 Then%>
				<td>&nbsp;验证码</td>
				<td>&nbsp;<input name=ForumNumber maxlength=4 size=4 value="<%=htmlencode(Request("RndNumber"))%>" class=fminpt></td>
				<td>&nbsp;请在框中输入<img src=<%=DEF_BBS_HomeUrl%>User/number.asp?n=<%=timer%> align=absmiddle></td>
				<%End If%>
						</TD></TR></TABLE>
			</td>
		</tr>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>
				<table border=0 cellpadding=0 cellspacing=0 width="100%">
				<tr><td>*帖子名称</td>
				<td><SELECT name=font onchange="document.LeadBBSFm.Form_Title.value=this.value+document.LeadBBSFm.Form_Title.value;">
	              <OPTION selected value="">选择话题</OPTION> <OPTION value=[原创]>[原创]</OPTION> 
	              <OPTION value=[转帖]>[转帖]</OPTION> <OPTION value=[灌水]>[灌水]</OPTION> 
	              <OPTION value=[讨论]>[讨论]</OPTION> <OPTION value=[求助]>[求助]</OPTION> 
	              <OPTION value=[推荐]>[推荐]</OPTION> <OPTION value=[公告]>[公告]</OPTION> 
	              <OPTION value=[注意]>[注意]</OPTION> <OPTION value=[贴图]>[贴图]</OPTION>
	              <OPTION value=[建议]>[建议]</OPTION> <OPTION value=[下载]>[下载]</OPTION>
	              <OPTION value=[分享]>[分享]</OPTION>
				</SELECT></td></tr></table></td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<input name=submitflag value="true" type=hidden>
				<input name=LMT_DefaultEdit value="<%=LMT_DefaultEdit%>" type=hidden>
				<input name=VoteFlag value="<%=htmlencode(Form_VoteFlag)%>" type=hidden>
				<input name=BoardID value="<%=Form_BoardID%>" type=hidden>
				<input name=ID value="<%=Form_ParentID%>" type=hidden><%If Form_VoteFlag = "" Then%>
				<input maxlength=255 name=Form_Title size="49" value="<%
				If (Request("SubmitFlag") = "first" or Request("SubmitFlag") = "") and form_ParentID > 0 and Form_Title="" Then
					If Left(LMT_TopicName,3) <> "Re:" Then
						Response.Write "Re:" & htmlencode(LMT_TopicNameNoHTML)
					Else
						Response.Write htmlencode(LMT_TopicNameNoHTML)
					End If
				Else
					Response.Write htmlencode(Form_title)
				End If%>" class=fminpt><%Else%>
              <input maxlength=255 name=Form_Title size="35" value="<%=htmlencode(Form_Title)%>" class=fminpt>
				<%If isNumeric(Form_Vote_ExpireDay) = 0 then Form_Vote_ExpireDay = 0
				Form_Vote_ExpireDay = cCur(Form_Vote_ExpireDay)%>
				<select name="Form_Vote_ExpireDay" class=TBBG9>
					<option value=0>到期时间</option>
					<option value=0<%If Form_Vote_ExpireDay = 0 Then Response.Write " selected"%>>永不到期</option>
					<option value=1<%If Form_Vote_ExpireDay = 1 Then Response.Write " selected"%>>一天</option>
					<option value=2<%If Form_Vote_ExpireDay = 2 Then Response.Write " selected"%>>两天</option>
					<option value=3<%If Form_Vote_ExpireDay = 3 Then Response.Write " selected"%>>三天</option>
					<option value=7<%If Form_Vote_ExpireDay = 7 Then Response.Write " selected"%>>一周</option>
					<option value=10<%If Form_Vote_ExpireDay = 10 Then Response.Write " selected"%>>十天</option>
					<option value=15<%If Form_Vote_ExpireDay = 15 Then Response.Write " selected"%>>半个月</option>
					<option value=20<%If Form_Vote_ExpireDay = 20 Then Response.Write " selected"%>>二十天</option>
					<option value=30<%If Form_Vote_ExpireDay = 30 Then Response.Write " selected"%>>一个月</option>
					<option value=45<%If Form_Vote_ExpireDay = 45 Then Response.Write " selected"%>>一个月半</option>
					<option value=60<%If Form_Vote_ExpireDay = 60 Then Response.Write " selected"%>>二个月</option>
					<option value=90<%If Form_Vote_ExpireDay = 90 Then Response.Write " selected"%>>三个月</option>
					<option value=120<%If Form_Vote_ExpireDay = 120 Then Response.Write " selected"%>>四个月</option>
					<option value=180<%If Form_Vote_ExpireDay = 180 Then Response.Write " selected"%>>六个月</option>
					<option value=240<%If Form_Vote_ExpireDay = 240 Then Response.Write " selected"%>>八个月</option>
					<option value=365<%If Form_Vote_ExpireDay = 365 Then Response.Write " selected"%>>一年</option>
				</select>
				<%End If
				If GBL_BoardMasterFlag >= 5 Then
					If isNumeric(Form_TitleStyle) = 0 then Form_TitleStyle = 0
					Form_TitleStyle = cCur(Form_TitleStyle)
				%>
				<select name="Form_TitleStyle" class=TBBG9>
					<option value=0<%If Form_TitleStyle = 0 Then Response.Write " selected"%>>样式</option><%If GBL_BoardMasterFlag >= 9 Then%>
					<option value=1<%If Form_TitleStyle = 1 Then Response.Write " selected"%>>HTML</option><%End If%>
					<option value=2<%If Form_TitleStyle = 2 Then Response.Write " selected"%>>红色</option>
					<option value=3<%If Form_TitleStyle = 3 Then Response.Write " selected"%>>绿色</option>
					<option value=4<%If Form_TitleStyle = 4 Then Response.Write " selected"%>>蓝色</option>
				</select>
				<%
				End If

				If cCur(Form_ParentID)=0 and (GBL_CHK_CachetValue > 1 or GBL_BoardMasterFlag >= 4) Then
					Dim TArray,Num,N
					TArray = Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID & "_TI")
					If isArray(TArray) = True Then%>
					<select name="Form_GoodAssort" class=TBBG9  style="width:74">
						<Option value=0>选择专题</option>
					<%
						Num = Ubound(TArray,2)
						For N = 0 To Num
							If cCur(TArray(0,N)) = Form_GoodAssort Then
								Response.Write "<Option value=" & TArray(0,N) & " selected>" & TArray(1,N) & VbCrLf
							Else
								Response.Write "<Option value=" & TArray(0,N) & ">" & TArray(1,N) & VbCrLf
							End If
						Next
					Response.Write "</select>" & VbCrLf
					End If
				End If%> 最长255字
				</td>
		</tr><%If Form_VoteFlag <> "" Then%>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>*投票选项
			<p>每行一个投票选项，最多<%=DEF_VOTE_MaxNum%>个选项，选项最长24字，超过作废，空行过滤
			<p><%If isNumeric(Form_VoteType) = 0 then Form_VoteType = 0
				Form_VoteType = cCur(Form_VoteType)%><table border=0 cellpadding=0 cellspacing=0><tr><td><input class=fmchkbox type=radio name=Form_VoteType value=0 <%If Form_VoteType = 0 Then Response.Write " checked"%>></td><td>单选票</td>
          		<td><input class=fmchkbox type=radio name=Form_VoteType value=1 <%If Form_VoteType = 1 Then Response.Write " checked"%>></td><td>多选票</td></tr></table>
			</td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<textarea cols=80 name=Form_VoteItem rows=8 class=fmtxtra><%If Form_VoteItem <> "" Then Response.Write VbCrLf & htmlEncode(Form_VoteItem)%></textarea>
				</td>
		</tr><%End If%>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>发帖表情</td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<input name=Form_FaceIcon class=fmchkbox type=radio value=1<%If Form_FaceIcon=1 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE1.GIF" width="20" height="20" align="absmiddle"> 
				<input name=Form_FaceIcon class=fmchkbox type=radio value=2<%If Form_FaceIcon=2 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE2.GIF" width="20" height="20" align="absmiddle"> 
				<input name=Form_FaceIcon class=fmchkbox type=radio value=3<%If Form_FaceIcon=3 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE3.GIF" width="20" height="20" align="absmiddle"> 
				<input name=Form_FaceIcon class=fmchkbox type=radio value=5<%If Form_FaceIcon=5 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE5.GIF" width="20" height="20" align="absmiddle"> 
				<input name=Form_FaceIcon class=fmchkbox type=radio value=6<%If Form_FaceIcon=6 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE6.GIF" width="20" height="20" align="absmiddle"> 
				<input name=Form_FaceIcon class=fmchkbox type=radio value=7<%If Form_FaceIcon=7 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE7.GIF" width="20" height="20" align="absmiddle">
				<input name=Form_FaceIcon class=fmchkbox type=radio value=15<%If Form_FaceIcon=15 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE15.GIF" width="20" height="20" align="absmiddle">
				<input name=Form_FaceIcon class=fmchkbox type=radio value=16<%If Form_FaceIcon=16 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE16.GIF" width="20" height="20" align="absmiddle">
				<br>
				<input name=Form_FaceIcon class=fmchkbox type=radio value=8<%If Form_FaceIcon=8 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE8.GIF" width="20" height="20" align="absmiddle"> 
				<input name=Form_FaceIcon class=fmchkbox type=radio value=9<%If Form_FaceIcon=9 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE9.GIF" width="20" height="20" align="absmiddle"> 
				<input name=Form_FaceIcon class=fmchkbox type=radio value=10<%If Form_FaceIcon=10 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE10.GIF" width="20" height="20" align="absmiddle"> 
				<input name=Form_FaceIcon class=fmchkbox type=radio value=12<%If Form_FaceIcon=12 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE12.GIF" width="20" height="20" align="absmiddle">
				<input name=Form_FaceIcon class=fmchkbox type=radio value=13<%If Form_FaceIcon=13 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE13.GIF" width="20" height="20" align="absmiddle">
				<input name=Form_FaceIcon class=fmchkbox type=radio value=14<%If Form_FaceIcon=14 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE14.GIF" width="20" height="20" align="absmiddle"> 
				<input name=Form_FaceIcon class=fmchkbox type=radio value=4<%If Form_FaceIcon=4 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE4.GIF" width="20" height="20" align="absmiddle">
				<input name=Form_FaceIcon class=fmchkbox type=radio value=11<%If Form_FaceIcon=11 Then Response.WRite " CHECKED"%>><img src="../images/<%=GBL_DefineImage%>bf/FACE11.GIF" width="20" height="20" align="absmiddle">
			</td>
		</tr><%
		N = 1
		If GBL_UserID < 1 Then N = 0
		Select Case DEF_EnableUpload
			Case 0: N = 0
			case 2: If CheckSupervisorUserName = 0 Then N = 0
			Case 3: If GBL_BoardMasterFlag < 4 Then N = 0
			Case 4: If GetBinarybit(GBL_CHK_UserLimit,2) = 0 Then N = 0
			Case 5: If GBL_BoardMasterFlag < 4 and GetBinarybit(GBL_CHK_UserLimit,2) = 0 Then N = 0
		End Select
		If DEF_UploadSpendPoints > 0 and DEF_UploadSpendPoints > GBL_CHK_Points Then N = 0
		If N = 1 and (GBL_CHK_OnlineTime >= DEF_NeedOnlineTime or DEF_NeedOnlineTime = 0) Then%>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>上传附件<%
			If DEF_UploadSpendPoints > 0 Then
				Response.Write " 消耗" & DEF_UploadSpendPoints & DEF_PointsName
			ElseIf DEF_UploadSpendPoints < 0 Then
				Response.Write " 奖励" & 0-DEF_UploadSpendPoints & DEF_PointsName
			End If%></td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<iframe name="ad" frameborder=0 width=100% height=25 scrolling=no src=uploadFile.asp?UserID=<%=GBL_UserID%>&BoardID=<%=GBL_Board_ID%>></iframe>
			</td>
		</tr><%End If
		If LMT_DefaultEdit <> 0 Then%>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>插入UBB标签</td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<a href="javascript:addcontent('[B]','[/B]');" title=粗体><img src="../images/ubb/bold.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[I]','[/I]');" title=斜体><img src="../images/ubb/italicize.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[U]','[/U]');" title=下划线><img src="../images/ubb/underline.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[ALIGN=CENTER]','[/ALIGN]');" title=居中><img src="../images/ubb/center.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[URL]','[/URL]');" title=链接><img src="../images/ubb/url1.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[EMAIL]','[/EMAIL]');" title=邮件><img src="../images/ubb/email1.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<%If DEF_EnableImagesUBB = 1 Then%><a href="javascript:addcontent('[IMGA]','[/IMGA]');" title=图片><img src="../images/ubb/image.GIF" width="20" height="20" align="absmiddle" border=0></a><%end If%>
				<a href="javascript:addcontent('[FLASH]','[/FLASH]');" title=Flash><img src="../images/ubb/swf.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[CODE]','[/CODE]');" title=代码><img src="../images/ubb/code.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[QUOTE]','[/QUOTE]');" title=引用><img src="../images/ubb/quote1.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[FLY]','[/FLY]');" title=飞行><img src="../images/ubb/fly.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[LIGHT]','[/LIGHT]');" title=闪烁文字><img src="../images/ubb/light.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[GLOW=255,RED,2]','[/GLOW]');" title=发光><img src="../images/ubb/glow.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[SHADOW=255,RED,2]','[/SHADOW]');" title=阴影><img src="../images/ubb/shadow.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[SIZE=3]','[/SIZE]');" title=3号字><img src="../images/ubb/size3.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[COLOR=blue]','[/COLOR]');" title=蓝色字><img src="../images/ubb/blue.gif" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[COLOR=red]','[/COLOR]');" title=红色字><img src="../images/ubb/red.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<%If DEF_EnableFlashUBB = 1 then%><a href="javascript:addcontent('[MP=320,240]','[/MP]');" title=插入Media文件><img src="../images/ubb/media.gif" width="20" height="20" align="absmiddle" border=0></a>
				<a href="javascript:addcontent('[RM=320,240]','[/RM]');" title=插入RealPlay文件><img src="../images/ubb/real.gif" width="20" height="20" align="absmiddle" border=0></a><%End If%>
			</td>
		</tr><%End If%>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> valign="top" width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1> <br>
				<table border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>
						<table border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td colspan="2">内容(最大<%=Fix(LMT_MaxTextLength/1024)%>K)
						<b><%If LMT_DefaultEdit = 0 Then%>
						<span onclick="javascript:changemode('01');" style="cursor:hand">传统模式</span>
						<%Else%>
						<span onclick="javascript:changemode('10');" style="cursor:hand">高级模式</span>
						<%End If%></b><br><br>
							</td>
						</tr>
						<tr>
								<%If CheckSupervisorUserName = 1 Then%>
							<td valign="middle" colspan=2>
								&nbsp;编码方式<br>
								<input class=fmchkbox type="radio" name="Form_HTMLFlag" value="0"<%If Form_HTMLFlag=0 Then Response.Write " checked"%>>文本
								<input class=fmchkbox type="radio" name="Form_HTMLFlag" value="1"<%If Form_HTMLFlag=1 Then Response.Write " checked"%>>HTML
								<input class=fmchkbox type="radio" name="Form_HTMLFlag" value="2"<%If Form_HTMLFlag=2 Then Response.Write " checked"%>>UBB
								<%Else%>
							<td valign="middle">是否是UBB代码</td>
							<td valign="middle">
								<input class=fmchkbox type="checkbox" name="Form_HTMLFlag" value="2"<%If Form_HTMLFlag=2 Then Response.Write " checked"%>>
								<%End If%>
							</td>
						</tr>
						</table>
						<br>
						<a href="../User/Help/Ubb.asp" target=_blank>内容支持插入ＵＢＢ标签，使用方法请参考帮助</a>
						
						<p>按Ctrl+Enter快速提交</p></td>
				</tr>
				</table>
				<br>
			</td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<%If LMT_DefaultEdit = 0 Then
					%><input type=hidden name=Form_Content  value="<%If Form_Content <> "" Then Response.Write Server.htmlEncode(Form_Content)%>">
				<%	DisplayLeadBBSEditor1
				Else
					%><textarea class=fmtxtra cols=80 name=Form_Content rows=16 ONSELECT="storeCaret(this);" ONCLICK="storeCaret(this);" ONKEYUP="storeCaret(this);"><%If Form_Content <> "" Then Response.Write VbCrLf & Server.htmlEncode(Form_Content)%></textarea>
				<%End If%>
			</td>
		</tr><%If DEF_UBBiconNumber > 0 and LMT_DefaultEdit <> 0 Then%>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>插入UBB表情,时间</td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				&nbsp;<%
				Dim Temp_N
				For Temp_N = 1 to DEF_UBBiconNumber%><a href="javascript:addcontent('[em<%=Right("0" & Temp_N,2)%>]','');"><img src="../images/UBBicon/em<%=Right("0" & Temp_N,2)%>.GIF" width="20" height="20" align="absmiddle" border=0></a>
				<%Next%>
				<a href="javascript:var d; d=new Date();addcontent(d.getYear()+'-'+rightStr('0'+(d.getMonth()+1),2)+'-'+rightStr('0'+d.getDate(),2)+' '+rightStr('0'+d.getHours(),2)+':'+rightStr('0'+d.getMinutes(),2)+':'+rightStr('0'+d.getSeconds(),2),'');" title=插入时间><b>T</b></a>
				<a href="javascript:checklength();">长度</a>
			</td>
		</tr><%End If
		If Form_ParentID=0 and Form_VoteFlag = "" Then%>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>加密本帖功能</td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<table border="0" cellspacing="0" cellpadding="0"><tr><td><select name=Form_TopicType onchange="if(value<50)NextContactDateDiv.style.display='none';if(value>49)NextContactDateDiv.style.display='block';">
								<option value="0">======选择条件======
								<%If DEF_EnableSpecialTopic = 1 and GetBinarybit(GBL_Board_BoardLimit,14) = 1 Then%><option value="7"<%If Form_TopicType = 7 Then Response.Write " selected"%>>回复本帖才能查看<%End If%>
								<option value="50"<%If Form_TopicType = 50 Then Response.Write " selected"%>>查看本帖需要达到<%=DEF_PointsName%>
								<option value="51"<%If Form_TopicType = 51 Then Response.Write " selected"%>>回复本帖需要达到<%=DEF_PointsName%>
								<option value="52"<%If Form_TopicType = 52 Then Response.Write " selected"%>>查看本帖需要达到经验
								<option value="53"<%If Form_TopicType = 53 Then Response.Write " selected"%>>回复本帖需要达到经验
								<option value="55"<%If Form_TopicType = 55 Then Response.Write " selected"%>>只限指定用户能查看此帖：
								<%If DEF_EnableSpecialTopic = 1 and GetBinarybit(GBL_Board_BoardLimit,14) = 1 Then%><option value="54"<%If Form_TopicType = 54 Then Response.Write " selected"%>>出售本帖，花费<%=DEF_PointsName%><%End If%>
								<option value="1"<%If Form_TopicType = 1 Then Response.Write " selected"%>>仅本版版主才能查看
								<option value="2"<%If Form_TopicType = 2 Then Response.Write " selected"%>>仅本版版主才能回复
								<option value="3"<%If Form_TopicType = 3 Then Response.Write " selected"%>>仅版主才能查看
								<option value="4"<%If Form_TopicType = 4 Then Response.Write " selected"%>>仅版主才能回复
								<option value="5"<%If Form_TopicType = 5 Then Response.Write " selected"%>>仅认证会员才能查看
								<option value="6"<%If Form_TopicType = 6 Then Response.Write " selected"%>>仅认证会员才能回复
							</select></td>
				<td>
				<span name=NextContactDateDiv id=NextContactDateDiv<%If Form_TopicType<50 Then Response.Write " style='display:none'"%>>
					&nbsp; <input name=Form_NeedValue value="<%If cStr(Form_NeedValue) <> "0" Then Response.Write htmlencode(Form_NeedValue)%>" size=10 maxlength=10 class=fminpt></span>
				</td></tr></table>
		</tr><%End If%>
		<tr bgcolor="<%=DEF_BBS_LightColor%>" class=TBBG1> 
			<td colspan="2">
				<table border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>&nbsp;其它选项:&nbsp; </td>
					<td>
						<input class=fmchkbox type="checkbox" name="Form_NoUserUnderWriteFlag" value="checkbox"<%If Form_NoUserUnderWriteFlag=1 Then Response.Write " checked"%>>
					</td>
					<td>显示签名</td><%If Form_ParentID=0 and GBL_UserID>0 and GBL_BoardMasterFlag >= 5 and GetBinarybit(GBL_CHK_UserLimit,4) = 0 Then%>
					<td>
						&nbsp;<input class=fmchkbox type="checkbox" name="Form_AnnounceIsTop" value="checkbox"<%If Form_AnnounceIsTopFlag=1 Then Response.Write " checked"%>>
					</td>
					<td>帖子置顶</td><%End If%>
					<td>
						&nbsp;<input class=fmchkbox type="checkbox" name="Form_NotReplay" value="checkbox"<%If Form_NotReplay=1 Then Response.Write " checked"%>>
					</td>
					<td><%If Form_ParentID=0 Then
							Response.Write "锁定主题"
						Else
							Response.Write "锁定帖子"
						End If%></td>
					<td>&nbsp;- <a href="../User/Help/Color.asp" target=_blank>颜色表</a></td>
				</tr>
				</table>
			</td>
		</tr>
		<tr bgcolor="<%=DEF_BBS_LightestColor%>" class=TBBG9> 
			<td colspan="2" align="center">
				<input name=submit2 type=submit value=" 完 成 " class=fmbtn>
				<input name=b12 type=reset value=" 重 写 " class=fmbtn>
			</td>
		</tr>
		</tbody> 
		</form>
		</table>
	</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody> 
</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 GetRequestValue

	If cStr(Form_ParentID) = "" Then Form_ParentID = Left(Request.QueryString("ID"),14)
	If cStr(Form_ParentID) = "" Then Form_ParentID = Left(Request.Form("ID"),14)
	If isNumeric(Form_ParentID) = 0 Then Form_ParentID = 0
	Form_ParentID = Fix(cCur(Form_ParentID))

	Form_BoardID = GBL_board_ID

	If Article_NotReplay = 1 Then Exit Function

	If Request("submitflag")="true" Then
		Form_Title = Trim(Request("Form_Title"))
		Form_HTMLFlag = Request("Form_HTMLFlag")
		If Form_HTMLFlag="2" Then
			Form_HTMLFlag=2
		ElseIf Form_HTMLFlag = "1" and CheckSupervisorUserName = 1 and GBL_UserID > 0 Then
			Form_HTMLFlag=1
		Else
			Form_HTMLFlag=0
		End If
		'If Form_ParentID<>0 and Form_Title = "" Then Form_Title="回复:"
	Else
		Form_HTMLFlag = 2
	End If

	If Request.QueryString("submitflag") <> "first" Then
		Form_Content = Request.Form("Form_Content")
	End If

	Form_FaceIcon = Left(Request("Form_FaceIcon"),14)
	If isNumeric(Form_FaceIcon) = 0 Then Form_FaceIcon = 0
	Form_FaceIcon = Fix(cCur(Form_FaceIcon))
	If Form_FaceIcon < 0 or Form_FaceIcon > 16 Then Form_FaceIcon = 0
	
	Form_UserID = GBL_UserID

	Form_UserName = GBL_CHK_User
	'Form_UserPass = GBL_CHK_pass
	
	If Request("submitflag") <> "" and Request("submitflag") <> "first" Then
		Form_NoUserUnderWriteFlag = Request("Form_NoUserUnderWriteFlag")
		If Form_NoUserUnderWriteFlag="checkbox" Then
			Form_NoUserUnderWriteFlag = 1
		Else
			Form_NoUserUnderWriteFlag = 0
		End If
	
		Form_AnnounceIsTopFlag = Request("Form_AnnounceIsTop")
		If Form_AnnounceIsTopFlag="checkbox" Then
			Form_AnnounceIsTopFlag = 1
		Else
			Form_AnnounceIsTopFlag = 0
		End If
		
		Form_NotReplay = Request("Form_NotReplay")
		If Form_NotReplay <> "" Then 
			Form_NotReplay = 1
		Else
			Form_NotReplay = 0
		End If
	End If

	If IsNull(Form_TopicType) Then Form_TopicType = 0
	If IsNull(Form_NeedValue) Then Form_NeedValue = 0
	If Form_ParentID=0 and Form_VoteFlag = "" and Form_TopicType <> 80 Then
		Form_TopicType = Left(Request("Form_TopicType"),14)
		If isNumeric(Form_TopicType) = 0 Then Form_TopicType = 0
		Form_TopicType = cCur(Form_TopicType)
		If Not ((Form_TopicType >=0 and Form_TopicType <=7) or (Form_TopicType>=50 and Form_TopicType<=55)) Then Form_TopicType = 0
		If Form_TopicType = 55 Then
			Form_NeedValue = Left(Request("Form_NeedValue"),14)
			Form_NeedValue = GetUserID(Form_NeedValue)
		Else
			If Form_TopicType >=50 and Form_TopicType <=54 Then
				Form_NeedValue = Left(Request("Form_NeedValue"),14)
				If isNumeric(Form_NeedValue) = 0 Then Form_NeedValue = 0
				Form_NeedValue = cCur(Form_NeedValue)
				If Form_NeedValue<0 or Form_NeedValue > 99999 Then Form_NeedValue = 0
			Else
				Form_NeedValue = 0
			End If
		End If
		If Form_TopicType = 54 or Form_TopicType = 7 Then
			If DEF_EnableSpecialTopic = 0 or GetBinarybit(GBL_Board_BoardLimit,14) = 0 Then
				Form_TopicType = 0
				Form_NeedValue = 0
			End If
		End If
	Else
		If Form_VoteFlag <> "" and Form_ParentID=0 Then
			Form_TopicType = 80
		Else
			Form_TopicType = 0
			Form_NeedValue = 0
		End If
	End If
	
	If Form_VoteFlag <> "" and Form_ParentID=0 Then
		Form_VoteItem = Trim(Request("Form_VoteItem"))
		Form_Vote_ExpireDay = Left(Trim(Request("Form_Vote_ExpireDay")),14)
		Form_VoteType = Left(Trim(Request("Form_VoteType")),14)
	End If
	Form_TitleStyle = Left(Request.Form("Form_TitleStyle"),14)
	Form_GoodAssort = Left(Request.Form("Form_GoodAssort"),14)

End Function

Function Borad_CheckAnnounceIDExist(ID)

	Borad_CheckAnnounceIDExist = 1
	exit function
	Dim Rs
	Set Rs = Con.ExeCute("Select top 1 id from LeadBBS_Announce where id=" & ID)
	GBL_DBNum = GBL_DBNum + 1
	If Rs.Eof Then
		Borad_CheckAnnounceIDExist = 0
	Else
		Borad_CheckAnnounceIDExist = 1
	End If
	Rs.Close
	Set Rs = Nothing

End Function

function GetUserID(UserName)

	Dim Rs,SQL
	SQL = "Select top 1 ID from LeadBBS_User Where UserName='" & Replace(username,"'","''") & "'"
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	If Rs.Eof Then
		GetUserID = 0
	Else
		SQL = Rs(0)
		If isNull(SQL) Then SQL = 0
		GetUserID = cCur(SQL)
	End If
	Rs.Close
	Set Rs = Nothing

End Function

function GetUserName(UserID)

	Dim Rs,SQL
	SQL = "Select top 1 UserName from LeadBBS_User Where ID=" & UserID
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	If Rs.Eof Then
		GetUserName = ""
	Else
		SQL = Rs(0)
		If isNull(SQL) Then SQL = 0
		GetUserName = SQL
	End If
	Rs.Close
	Set Rs = Nothing

End Function

Sub UpdateAnnounceApplicationInfo(AncID,IndexN,Value,tp,tid)

	Dim GetDataTop,AllTopNum,N,Str
	If tid = 0 Then
		Str = ""
	Else
		Str = tid
	End if
	AllTopNum = -1
	GetDataTop = Application(DEF_MasterCookies & "TopAnc" & Str)
	If isArray(GetDataTop) = False Then
		'If GetDataTop <> "yes" Then ReloadTopAnnounceInfo(tid)
		Exit Sub
	Else
		AllTopNum = Ubound(GetDataTop,2)
	End If

	For N = 0 to AllTopNum
		If cCur(AncID) = cCur(GetDataTop(0,N)) Then
			If tp = 1 Then
				GetDataTop(IndexN,N) = cCur(GetDataTop(IndexN,N)) + Value
			Else
				GetDataTop(IndexN,N) = Value
			End If
			Application.Lock
			Application(DEF_MasterCookies & "TopAnc" & Str) = GetDataTop
			Application.UnLock
			Exit Sub
		End If
	Next

End Sub

Function DisplayOfficerString(Officer)

	Dim Officer_Temp,Temp_N,dotFlag
	dotFlag = 0
	Officer_Temp = split(Officer,",")
	For Temp_N = 0 to Ubound(Officer_Temp,1)
		If isNumeric(Officer_Temp(Temp_N)) Then
			Officer_Temp(Temp_N) = cCur(Officer_Temp(Temp_N))
			If Officer_Temp(Temp_N)>=0 and Officer_Temp(Temp_N)<=DEF_UserOfficerNum Then
				If dotFlag = 0 Then
					dotFlag = 1
					DisplayOfficerString = DisplayOfficerString & DEF_UserOfficerString(Officer_Temp(Temp_N))
				Else
					DisplayOfficerString = DisplayOfficerString & "," & DEF_UserOfficerString(Officer_Temp(Temp_N))
				End If
			End If
		End If
	Next

End Function

Function Borad_DisplayAnnounceID

	Dim ID
	ID = Form_ParentID
	If isNumeric(ID)=0 Then ID=0
	ID = cCur(ID)
	If ID = 0 Then Exit Function
	Dim Rs

	If ID = 0 Then Exit Function
	Set Rs = Con.ExeCute("Select top 1 T1.*,T2.Mail,T2.OICQ,T2.Userphoto,T2.UserLevel,T2.Homepage,T2.PrintUnderWrite,T2.Points,T2.Officer,T2.OnlineTime,T2.NongLiBirth,T2.Birthday,T2.ApplyTime,T2.Sex,T2.LastDoingTime,T2.AnnounceNum2,T2.FaceUrl,T2.FaceWidth,T2.FaceHeight,T2.UserLimit,T2.ShowFlag,T2.NotSecret,T2.UserTitle,T2.CachetValue,T2.CharmPoint from LeadBBS_Announce as T1 left join LeadBBS_User as T2 on T2.id=T1.userid where T1.id=" & ID)
	GBL_DBNum = GBL_DBNum + 1
	Dim Mail,OICQ,UserPhoto,UserLevel,Homepage,PrintUnderWrite,Points,Officer,OnlineTime,Birthday,ApplyTime,Sex,LastDoingTime,AnnounceNum,UserLimit,IPAddress,NongLiBirth
	Dim ShowFlag,NotSecret
	If Rs.Eof Then
		Borad_DisplayAnnounceID = 0
		Exit Function
	Else
		Borad_DisplayAnnounceID = 1
	End If
	Mail = Rs("Mail")
	OICQ = Rs("OICQ")
	If isNull(OICQ) or OICQ="" Then OICQ=0
	UserPhoto = Rs("UserPhoto")
	UserLevel = Rs("UserLevel")
	Homepage = Rs("Homepage")
	PrintUnderwrite = Rs("PrintUnderWrite")
	Officer = Rs("Officer")
	OnlineTime = Rs("OnlineTime")
	Birthday = Rs("Birthday")
	NongLiBirth = Rs("NongLiBirth")
	ApplyTime = Rs("ApplyTime")
	Sex = Rs("Sex")
	LastDoingTime = Rs("LastDoingTime")
	AnnounceNum = Rs("AnnounceNum2")
	IPAddress = Rs("IPAddress")
	ShowFlag = Rs("ShowFlag")
	NotSecret = Rs("NotSecret")
	If NotSecret = True or NotSecret = 1 Then
		NotSecret = 1
	Else
		NotSecret = 0
	End If
	Form_UserTitle = Rs("UserTitle") & ""
	Form_CachetValue = Rs("CachetValue")
	Form_CharmPoint = Rs("CharmPoint")
	If isNull(Form_CachetValue) Then Form_CachetValue = 0
	If isNull(Form_CharmPoint) Then Form_CharmPoint = 0
	Form_CachetValue = cCur(Form_CachetValue)
	Form_CharmPoint = cCur(Form_CharmPoint)
	
	Dim ThisParentID
	Form_ID = cCur(Rs("ID"))
	ThisParentID = cCur(Rs("ParentID"))
	Form_TopicSortID = Rs("TopicSortID")
	Form_BoardID = Rs("BoardID")
	Form_RootID = Rs("RootIDBak")
	Form_ChildNum = Rs("ChildNum")
	Form_Layer = Rs("Layer")
	Form_Title = Rs("Title")
	Form_TopicType = Rs("TopicType")
	Form_NeedValue = Rs("NeedValue")
	Form_TopicType_Old = Form_TopicType
	Points = Rs("Points")

	'Form_Content = Rs("Content")
	Form_PrintContent = Rs("PrintContent")
	Form_FaceIcon = cCur(Rs("FaceIcon"))
	Form_ndatetime = cCur(Rs("ndatetime"))
	Form_LastTime = Rs("LastTime")
	Form_Hits = cCur(Rs("Hits"))
	Form_Length = Rs("Length")
	Form_UserName = Rs("UserName")
	Form_UserID = cCur(Rs("UserID"))
	Form_HTMLFlag = cCur(Rs("HTMLFlag"))
	Form_UnderWriteFlag = Rs("UnderWriteFlag")
	'Article_NotReplay = Rs("NotReplay")
	Form_FaceUrl = Rs("FaceUrl")
	Form_FaceWidth = Rs("FaceWidth")
	Form_FaceHeight = Rs("FaceHeight")
	UserLimit = Rs("UserLimit")
	Form_TitleStyle = Rs("TitleStyle")
	Form_PollNum = Rs("PollNum")
	Form_OtherInfo = Rs("OtherInfo")
	Rs.close
	Set Rs = Nothing

	If isNull(Userphoto) Then
		Mail = ""
		OICQ = 0
		Userphoto = 0
		UserLevel = 0
		Homepage = ""
		PrintUnderwrite = ""
		Points = 0
		Officer = 0
		OnlineTime = 0
		Birthday = 0
		ApplyTime = 0
		Sex = "密"
		LastDoingTime = 0
		AnnounceNum = 0
		Form_FaceUrl = ""
		Form_FaceWidth = 0
		Form_FaceHeight = 0
		UserLimit = 0
		ShowFlag = 1
	Else
		Points = cCur(Points)
	End If

	Dim OnlineFlag
	If (ShowFlag = 1 or ShowFlag = True) and DEF_EnableUserHidden = 1 Then
		OnlineFlag = 0
	Else
		OnlineFlag = DateDiff("s",RestoreTime(LastDoingTime), DEF_Now)
		If OnlineFlag < 0 or OnlineFlag > DEF_UserOnlineTimeOut Then
			OnlineFlag = 0
		Else
			OnlineFlag = 1
		End If
	End If
	If GBL_TableHeadString <> "" Then
		Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"
		Response.Write GBL_TableHeadString
		Response.Write "</td></tr></table>"
	End If
	%><table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
	<tr bgcolor=<%=DEF_BBS_LightDarkColor%>><td colspan=2 class=TBHead2>
		<table width=100% border="0" cellspacing="0" cellpadding="0">
		<tr><td>
		<img src=../images/null.gif width=2 height=2><br>
		&nbsp;<b><font color=ffffff class=HeadFont>帖子主题: <%
		Dim Temp
		Temp = LMT_TopicNameNoHTML
		If strLength(Temp)>DEF_BBS_DisplayTopicLength+10 Then
			Temp = LeftTrue(Temp,DEF_BBS_DisplayTopicLength+7) & "..."
		End if
		Response.Write Temp
		Response.Write "</font></b></td><td align=right>"
		If GBL_CHK_User <> "" Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""Collectannounce.asp"",""CollectID""," & LMT_RootIDBak & ");'><img src=../images/" & GBL_DefineImage & "collect.GIF border=0 title=收藏此主题 align=absmiddle width=16 height=16></a>"
		If GBL_CHK_User <> "" and GBL_BoardMasterFlag >= 5 Then
			Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""Topannounce.asp"",""TopID""," & LMT_RootIDBak & ");'><img src=../images/" & GBL_DefineImage & "ti.GIF border=0 title=提取主题到最首位置 align=absmiddle width=16 height=16></a>"
			Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""RepairAnnounce.asp"",""RepairID""," & LMT_RootIDBak & ");'><img src=../images/" & GBL_DefineImage & "repair.GIF border=0 title=修复此主题帖子或归入专题 align=absmiddle width=16 height=16></a>"
			If GetBinarybit(GBL_CHK_UserLimit,9) = 0 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""Moveannounce.asp"",""MoveID""," & LMT_RootIDBak & ");'><img src=../images/" & GBL_DefineImage & "move.GIF border=0 title=转移此主题到其它版面 align=absmiddle width=16 height=16></a>"
			Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""MakeTopAnc.asp"",""TopID""," & LMT_RootIDBak & ");'><img src=../images/" & GBL_DefineImage & "maketop.GIF border=0 title=主题固顶或取消固顶 align=absmiddle width=16 height=16></a>"
			If GBL_BoardMasterFlag >= 6 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""MakeAlltopAnc.asp"",""TopID"",""" & LMT_RootIDBak & "&part=1"");'><img src=../images/" & GBL_DefineImage & "makeparttop.GIF border=0 title=主题区固顶或取消区固顶 align=absmiddle width=16 height=16></a>"
			If GBL_BoardMasterFlag >= 7 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""MakeAlltopAnc.asp"",""TopID""," & LMT_RootIDBak & ");'><img src=../images/" & GBL_DefineImage & "makealltop.GIF border=0 title=主题总固顶或取消总固顶 align=absmiddle width=16 height=16></a>"
		End If
		%></font></b>&nbsp;</td></tr></table></td></tr></table>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
	<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
		<td height=20 width=<%=DEF_BBS_LeftTDWidth%> align=center valign=top>
			<img src=../images/null.gif width=<%=DEF_BBS_LeftTDWidth%> height=2><table align=center width=90% cellspacing="0" cellpadding="0"><tr><td>
			<%
			If (Not isNull(Form_UserTitle)) and Form_UserTitle <> "" Then Response.write "<table style=""filter:glow(color=ffffff, strength=2)"" width=100% border=0 cellspacing=0 cellpadding=0><tr><td><font style=""line-height:18px"">头衔：" & htmlencode(Form_UserTitle) & "<br><img src=../images/blank.gif height=3 width=2><br></table>"
			Response.Write "<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
			If Form_UserID > 0 Then Response.write "<a href=" & DEF_BBS_HomeUrl & "User/LookUserInfo.asp?ID=" & Form_UserID
			If CheckSupervisorUserName = 1 and GBL_UserID > 0 Then Response.Write " title=""IP地址:" & IPAddress & """ "
			Response.Write "><img src="
			If Form_FaceWidth > DEF_AllFaceMaxWidth Then Form_FaceWidth = DEF_AllFaceMaxWidth
			If Form_FaceHeight > DEF_AllFaceMaxWidth*2 Then Form_FaceHeight = DEF_AllFaceMaxWidth
			If DEF_AllDefineFace = 1 and Form_FaceUrl <> "" Then
				Response.Write chr(34) & htmlencode(Form_FaceUrl) & chr(34) & " width=" & Form_FaceWidth & " height=" & Form_FaceHeight & " border=0>"
			Else
				Response.Write DEF_BBS_HomeUrl & "images/face/" & string(4-len(cstr(UserPhoto)),"0")&UserPhoto & ".gif border=0 width=62 height=62>"
			End If
			If Form_UserID > 0 Then Response.Write "</a>"
			Response.Write "</td><td valign=top align=right>"
			If Form_UserID = 0 Then OnlineFlag = 1
			Select Case Sex
			Case "女"
				If OnlineFlag = 1 Then
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/sxmg/FeMale.gif align=absmiddle Alt=美女，在线 width=23 height=21>"
				Else
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/sxmg/OfFeMale.gif align=absmiddle Alt=美女，离线 width=23 height=21>"
				End If
			Case "男"
				If OnlineFlag = 1 Then
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/sxmg/Male.gif align=absmiddle Alt=帅哥，在线 width=23 height=21>"
				Else
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/sxmg/OfMale.gif align=absmiddle Alt=帅哥，离线 width=23 height=21>"
				End If
			Case Else
				If OnlineFlag = 1 Then
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/sxmg/Male.gif align=absmiddle Alt=在线 width=23 height=21>"
				Else
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/sxmg/OfMale.gif align=absmiddle Alt=离线 width=23 height=21>"
				End If
			End Select

			Response.Write "</td>"
			Response.Write "</tr></table>"
			Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/null.gif width=2 height=5 border=0><br>"
			If Form_UserID > 0 Then
				Response.Write "<a href=" & DEF_BBS_HomeUrl & "User/LookUserInfo.asp?ID=" & Form_UserID & ">" & htmlencode(Form_UserName) & "</a>"
			Else
				Response.Write htmlencode(Form_UserName)
			End If
			Response.Write "&nbsp;"
			If len(Birthday)=14 Then
				Birthday = RestoreTime(Left(Birthday,8))
				If isTrueDate(Birthday) Then
					Response.Write " " & Constellation(Birthday)
				End If
				If len(NongLiBirth) = 14 Then
					Response.Write " " & DisplayBirthAnimal(year(RestoreTime(NongLiBirth)))
				End If
			End If

			Response.Write "</td></tr><tr><td>"
			Form_ID = UserLevel
			If Form_ID > 10 Then Form_ID = 10

			Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/null.gif width=2 height=5 border=0><br><img src=" & DEF_BBS_HomeUrl & "images/lvstar/level" & UserLevel & ".gif align=absmiddle title=""级别：" & DEF_UserLevelString(UserLevel) & """><br>"
			Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/null.gif width=2 height=5 border=0><br>"

			If Form_UserID > 0 Then	
				If Officer<>"0" Then
					Response.write "荣誉：" & Replace(DisplayOfficerString(Officer),",","<br>&nbsp; &nbsp; &nbsp; ") & "<br>"
				End If
				If GetBinarybit(UserLimit,10) = 1 Then
					Response.write "职务：<font color=blue class=BlueFont>总版主</font><br>"
				ElseIf GetBinarybit(UserLimit,14) = 1 Then
					Response.write "职务：<font color=blue class=BlueFont>区版主</font><br>"
				ElseIf GetBinarybit(UserLimit,8) = 1 Then
					Response.write "职务：<font color=blue class=BlueFont>论坛版主</font><br>"
				ElseIf GetBinarybit(UserLimit,2) = 1 Then
					Response.write "认证：<font color=green class=GreenFont>认证会员</font><br>"
				End If
				Response.Write "级别：" & DEF_UserLevelString(UserLevel) & "<br>"
				If Form_CachetValue <> 0 Then
					If Form_CachetValue > 127 Then
						Form_CachetValue = 127-Form_CachetValue
						Response.write "威望：" & Form_CachetValue & "<br>"
					Else
						Response.write "威望：<font color=blue class=BlueFont>＋" & Form_CachetValue & "</font><br>"
					End If
				End If
				If Form_CharmPoint <> 0 Then Response.write "魅力：" & Form_CharmPoint & "<br>"
				Response.Write "" & DEF_PointsName & "：" & Points & "<br>"
				Response.Write "经验：" & CLng(cCur(OnlineTime)/60) & "<br>"
				Response.Write "文章：" & AnnounceNum & "<br>"
				Response.Write "注册：" & Mid(RestoreTime(ApplyTime),3,14)
			End If
			%>
			<br>
			</td></tr></table>
		</td>
		<td height=20 valign=top><table width=100% style="table-layout:fixed; word-break:break-all"><tr><td width=2><img src=../images/blank.gif width=2 height=2></td><td>
			<%
			Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "bf/face" & Form_FaceIcon & ".gif align=absbottom width=20 height=20>"
			Response.Write "发表: " & RestoreTime(Form_ndatetime) & " 人气:" & Form_Hits
			'If Form_UserID > 0 Then Response.Write " <a href=" & DEF_BBS_HomeUrl & "User/LookUserInfo.asp?ID=" & Form_UserID & "><img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "userinfo.gif border=0 title=查看此用户资料 align=absmiddle width=16 height=16></a>"
			'If cCur(OICQ)>=10000 Then Response.Write " <a href=http://search.tencent.com/cgi-bin/friend/user_show_info?ln=" & OICQ & " target=_blank><img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "oicq.gif border=0 title=查看OICQ资料 align=absmiddle width=16 height=16></a>"

			'If Mail<>"" and NotSecret = 1 Then
			'	Response.Write " <a href=""mailto:" & htmlencode(Mail) & """ target=_blank><img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "mail.gif border=0 title=给此用户发邮件 align=absmiddle width=15 height=15></a>"
			'End if

			If Article_NotReplay <> 1 Then Response.Write " <a href=""Announce2.asp?BoardID=" & GBL_board_ID & "&ID=" & Form_ParentID & "&submitflag=first&repost=1""><img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "re.gif border=0 title=引用回复 align=absmiddle width=16 height=16></a>"

			If Form_UserID > 0 Then Response.Write " <a href=""" & DEF_BBS_HomeUrl & "User/SendMessage.asp?SdM_ToUser=" & urlencode(Form_UserName) & """><img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "message.GIF border=0 title=给" & htmlencode(Form_UserName) & "发消息 align=absmiddle width=16 height=16></a>"
			If trim(homepage)<>"" Then
				If Left(lcase(homepage),4)<>"http" Then homepage = "http://" & homepage
				Response.Write " <a href=""" & htmlencode(homepage) & """ target=_blank><img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "home.gif border=0 title=此用户主页 align=absmiddle width=16 height=16></a>"
			End if
			
			If GBL_CHK_User <> "" and (GBL_BoardMasterFlag >= 5 or cCur(Form_UserID) = GBL_UserID) Then
				Response.Write " <a href=""EditAnnounce.asp?BoardID=" & GBL_board_ID & "&ID=" & Form_ParentID & """><img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "edit.gif border=0 title=修改帖子内容 align=absmiddle width=16 height=16></a>"
				Response.Write " <a href='javascript:opw(""TypeSetAnnounce.asp"",""RepairID""," & Form_ParentID & ");'><img src=../images/" & GBL_DefineImage & "ts.gif border=0 title=自动排版消除多余换行，锁帖，审核帖等功能 align=absmiddle width=16 height=16></a>"
			End If
			If GBL_CHK_User <> "" and GBL_UserID>0 Then
				%>
				<script language=javascript>
				function opw(f,r,id)
				{
					window.open(f+'?BoardID=<%=GBL_board_ID%>&'+r+'='+id,'','width=450,height=37,scrollbars=auto,status=no');
				}
				</script>
				<%
				If GBL_CHK_User <> "" and Form_UserID > 0 Then Response.Write " <a href='javascript:opw(""AddFriend.asp"",""AddSureFlag=yes&FriendName"",""" & htmlencode(Form_UserName) & """);'><img src=../images/" & GBL_DefineImage & "friend.gif border=0 title=加此用户为好友 align=absmiddle width=16 height=16></a>"
				
				If GBL_CHK_User <> "" and GBL_BoardMasterFlag >= 5 Then
					If GetBinarybit(GBL_Board_BoardLimit,5) = 0 and GetBinarybit(GBL_CHK_UserLimit,5) = 0 Then
						Response.Write " <a href='javascript:opw("""
						If GBL_Board_ID <> 444 and DEF_EnableDelAnnounce = 0 and ThisParentID = 0 Then
							Response.Write "MoveAnnounce.asp"",""MoveID"",""" & Form_ParentID & "&BoardID2=444"""
						Else
							Response.Write "DelAnnounce.asp"",""DelID"",""" & Form_ParentID & """"
						End If
						Response.Write ");'><img src=../images/" & GBL_DefineImage & "Del.GIF border=0 title=删除此帖子 align=absmiddle width=16 height=16></a>"
					End If
					If GetBinarybit(GBL_CHK_UserLimit,6) = 0 Then Response.Write " <a href='javascript:opw(""MakeGood.asp"",""GoodID""," & Form_ParentID & ");'><img src=../images/" & GBL_DefineImage & "jh.GIF border=0 title=精华或取消精华此帖子，奖惩发帖用户 align=absmiddle width=16 height=16></a>"
				End If
			End If

			If Form_TopicType > 0 and ThisParentID = 0 Then
				Form_NeedValue = cCur(Form_NeedValue)
				Select case Form_TopicType
					Case 1,2:
						If GBL_CHK_User <> "" Then
							If GBL_BoardMasterFlag < 5 and GBL_UserID <> Form_UserID Then
								If Form_TopicType = 2 Then
									Article_NotReplay = 1
								Else
									Form_Printcontent = GetFobStr("此帖只有本版版主才能查看")
								End If
							Else
								If Form_TopicType = 1 Then Form_OtherInfo = Form_OtherInfo & " 此帖只有本版版主才能查看"
							End If
						Else
							Form_Printcontent = GetFobStr("此帖只有本版版主才能查看")
						End If
					Case 3,4:
						If GBL_BoardMasterFlag < 4 and GBL_UserID <> Form_UserID Then
							If Form_TopicType = 4 Then
								Article_NotReplay = 1
							Else
								Form_Printcontent = GetFobStr("此帖只有版主才能查看")
							End If
						Else
							If Form_TopicType = 3 Then Form_OtherInfo = Form_OtherInfo & " 此帖只有版主才能查看"
						End If
					Case 5,6:
						If (GBL_CHK_User = "" or GetBinarybit(GBL_CHK_UserLimit,2) <> 1) and GBL_UserID <> Form_UserID Then
							If Form_TopicType = 6 Then
								Article_NotReplay = 1
							Else
								Form_Printcontent = GetFobStr("此帖只有认证会员才能查看")
							End If
						Else
							If Form_TopicType = 5 Then Form_OtherInfo = Form_OtherInfo & " 此帖只有认证会员才能查看"
						End If
					Case 7:
						If GBL_UserID > 0 Then
							If GBL_UserID <> cCur(Form_UserID) and GBL_UserID <> Form_UserID Then
								Set Rs = Con.ExeCute("Select top 1 ID from LeadBBS_Announce where UserID=" & GBL_UserID & " and ParentID=" & Form_ParentID)
								GBL_DBNum = GBL_DBNum + 1
								If Rs.Eof Then
									Form_Printcontent = GetFobStr("回复此帖才能查看内容")
								Else
									Form_OtherInfo = Form_OtherInfo & " 回复此帖才能查看内容"
								End If
								Rs.Close
								Set Rs = Nothing
							Else
								Form_OtherInfo = Form_OtherInfo & " 回复此帖才能查看内容"
							End If
						Else
							Form_Printcontent = GetFobStr("回复此帖才能查看内容")
						End If
					Case 54:
						If GBL_UserID > 0 Then
							If GBL_UserID <> cCur(Form_UserID) Then
								Set Rs = Server.CreateObject("ADODb.RecordSet")
								Set Rs = Con.ExeCute("Select top 1 ID from LeadBBS_VoteUser where AnnounceID=" & Form_ParentID & " and UserName='" & Replace(GBL_CHK_User,"'","''") & "'")
								GBL_DBNum = GBL_DBNum + 1
								If Rs.Eof Then
									If GBL_CHK_Points < Form_NeedValue Then
										Form_Printcontent = GetFobStr("购买此帖需要花费" & Form_NeedValue & "" & DEF_PointsName & "，可惜你的" & DEF_PointsName & "不够，不能购买")
									Else
										Form_Printcontent = GetFobStr("购买此帖需要花费" & Form_NeedValue & "" & DEF_PointsName & "，<a href='javascript:opw(""BuyAnnounce.asp"",""BoardID=" & GBL_board_ID & "&AnnounceID"",""" & Form_ParentID & """);'>点击购买帖子</a>")
									End If
								End If
								Rs.Close
								Set Rs = Nothing
							End If
						Else
							Form_Printcontent = GetFobStr("游客无权浏览限制帖子")
						End If
					Case 50,51:
						If GBL_CHK_Points < Form_NeedValue and GBL_UserID <> Form_UserID Then
							If Form_TopicType = 51 Then
								Article_NotReplay = 1
							Else
								Form_Printcontent = GetFobStr("此帖需要" & DEF_PointsName & "" & Form_NeedValue & "才能查看")
							End If
						Else
							If Form_TopicType = 50 Then Form_OtherInfo = Form_OtherInfo & " 此帖需要" & DEF_PointsName & "" & Form_NeedValue & "才能查看"
						End If
					Case 52,53:
						If GBL_CHK_OnlineTime < Form_NeedValue*60 and GBL_UserID <> Form_UserID Then
							If Form_TopicType = 53 Then
								Article_NotReplay = 1
							Else
								Form_Printcontent = GetFobStr("此帖需要经验" & Form_NeedValue & "才能查看")
							End If
						Else
							If Form_TopicType = 52 Then Form_OtherInfo = Form_OtherInfo & " 此帖需要经验" & Form_NeedValue & "才能查看"
						End If
					Case 55:
						If Form_NeedValue > 0 Then
							Form_NeedValue = GetUserName(Form_NeedValue)
							If Form_NeedValue <> "" Then
								If Form_NeedValue <> GBL_CHK_User and GBL_UserID <> Form_UserID Then
									Form_Printcontent = GetFobStr("此帖只限用户<font color=Green class=GreenFont>" & Form_NeedValue & "</font>才能查看")
								Else
									Form_OtherInfo = Form_OtherInfo & " 此帖只限用户<font color=Green class=GreenFont>" & Form_NeedValue & "</font>才能查看"
								End If
							End If
						End If
				End Select
			End If

			Response.Write "<br><br><span style=""line-height:15pt;"">"			
			If Form_TitleStyle >=60 and GBL_BoardMasterFlag < 4 Then
				Form_Printcontent = GetFobStr("此帖有待管理人员审核才能查看")
			Else
				If Form_TitleStyle >= 60 Then Form_TitleStyle = Form_TitleStyle - 60
			End If
			If GetBinarybit(UserLimit,7) = 1 Then
				Response.Write GetFobStr("该用户发言已经被屏蔽")
			Else
				If Left(Form_Title,3) = "re:" and Form_Title <> "re:" Then Form_Title = ""
				If Form_Title <> "" Then Response.Write "<b>" & DisplayAnnounceTitle(Form_Title,Form_TitleStyle) & "</b><br><br>" & VbCrLf
				If Form_TopicType = 80 Then DisplayVoteForm Form_ParentID,0
				Response.Write "<table width=100% border=0 cellspacing=0 cellpadding=0 style=""line-height:15pt;""><tr><td>"
				If DEF_AnnounceFontSize <> "0" then Response.Write "<span style=font-size:" & DEF_AnnounceFontSize & ">"
				Response.Write Form_Printcontent
				If DEF_AnnounceFontSize <> "0" then Response.Write "</span>"
				Response.Write "</td></tr></table>"
			End If
			Response.Write "</span>"

			If Form_TopicType = 54 Then
				If cCur(Form_PollNum) = 0 Then
					Response.Write "<p>[<font color=888888 class=GrayFont>此帖为出售帖，目前还没有人购买。</font>]"
				Else
					Response.Write "<p>[<font color=888888 class=GrayFont>此帖为出售帖，已经有<a href=#438 onclick='javascript:window.open(" & chr(34) & "BuyUser.asp?BoardID=" & GBL_board_ID & "&AnnounceID=" & ID & chr(34) & "," & chr(34) & chr(34) & "," & chr(34) & "width=450,height=400 scrollbars=yes" & chr(34) & ");'><b>" & Form_PollNum & "</b></a>人购买了此帖</font>]"
				End If
			End If
			If Form_OtherInfo <> "" Then Response.Write "<br><br>[ <font color=888888 class=GrayFont>" & Form_OtherInfo & "</font> ]&nbsp; &nbsp;"

			If DEF_EnableUnderWrite = 0 Then PrintUnderwrite = DEF_SiteNameString & "感谢您的参与"
			If Form_UnderWriteFlag = 1 And trim(PrintUnderWrite&"")<>"" Then
				Response.Write "<br><br>"
				Response.Write "<table width=332 border=0 cellspacing=0 cellpadding=0 style='table-layout:fixed; word-break:break-all'><tr><td><img src=../images/" & GBL_DefineImage & "signature.gif width=500 height=17 border=0><br>"
				Response.Write PrintUnderwrite
				'Response.Write "<br><img src=../images/null.gif width=2 height=6>"
				Response.Write "</td></tr></table>"
			Else
				Response.Write "<br><img src=../images/null.gif width=2 height=2>"
			End If
			DisplayAnnouncesSplitPages
			Response.Write "<br>"
			%>
			</td></tr></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
	
	Form_ID = ""
	Form_TopicSortID = ""
	Form_BoardID = ""
	Form_RootID = ""
	Form_ChildNum = ""
	Form_Layer = ""
	'Form_Title = ""
	Form_Content = ""
	Form_FaceIcon = ""
	Form_ndatetime = ""
	Form_LastTime = ""
	Form_Hits = ""
	Form_Length = ""
	Form_UserName = ""
	Form_UserID = ""
	Form_HTMLFlag = ""

End Function

Function GetFobStr(Str)

	GetFobStr = "<font color=888888 class=GrayFont>-----------------------------------------------------<br>" & _
				"<font color=blue class=BlueFont>" & Str & "</font>[<a href=../User/help/help.asp#lmt>说明</a>]<br>" & _
				"-----------------------------------------------------</font><br>"

End Function

Function Borad_CheckBoardIDExist(ID)

	Dim Temp
	Temp = Application(DEF_MasterCookies & "BoardInfo" & ID)
	If isArray(Temp) = False Then
		ReloadBoardInfo(ID)
		Temp = Application(DEF_MasterCookies & "BoardInfo" & ID)
	End If
	If isArray(Temp) = False Then
		Borad_CheckBoardIDExist = 0
	Else
		Borad_CheckBoardIDExist = 1
	End If

	'Dim Rs
	'Set Rs = Con.ExeCute("Select top 1 BoardID from LeadBBS_Boards where BoardID=" & ID)
	'GBL_DBNum = GBL_DBNum + 1
	'If Rs.Eof Then
	'	Borad_CheckBoardIDExist = 0
	'Else
	'	Borad_CheckBoardIDExist = 1
	'End If
	'Rs.Close
	'Set Rs = Nothing

End Function


Rem 检测某用户名是否存在
Function CheckUserNameExist(UserName)

	Dim Rs
	Set Rs=Con.ExeCute("Select top 1 ID from LeadBBS_User where UserName='" & Replace(UserName,"'","''") & "'")
	GBL_DBNum = GBL_DBNum + 1
	If Rs.Eof Then
		CheckUserNameExist = 0
	Else
		CheckUserNameExist = 1
	End if
	Rs.Close
	Set Rs = Nothing

End Function

Dim LMT_GoodAssortIndex
LMT_GoodAssortIndex = -1
Function CheckGoodAssortID(ID)

	Dim TArray,Num,N
	TArray = Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID & "_TI")
	If isArray(TArray) = True Then
		Num = Ubound(TArray,2)
		For N = 0 To Num
			If cCur(TArray(0,N)) = ID Then
				CheckGoodAssortID = 1
				LMT_GoodAssortIndex = N
				Exit Function
			End If
		Next
	End If
	CheckGoodAssortID = 0

End Function

Sub ChangeGoodAssort(ID)

	If ID = 0 Then Exit Sub
	Dim TArray
	TArray = Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID & "_TI")
	If isArray(TArray) = False Then
		CheckGoodAssort = 0
		Exit Sub
	End If
	If cCur(TArray(2,LMT_GoodAssortIndex)) = -1 Then
		TArray(2,LMT_GoodAssortIndex) = 1
		TArray(3,LMT_GoodAssortIndex) = 0
		TArray(4,LMT_GoodAssortIndex) = 0
	Else
		TArray(2,LMT_GoodAssortIndex) = cCur(TArray(2,LMT_GoodAssortIndex)) + 1
		TArray(3,LMT_GoodAssortIndex) = 0
		TArray(4,LMT_GoodAssortIndex) = 0
	End If
	Application.Lock
	Application(DEF_MasterCookies & "BoardInfo" & GBL_board_ID & "_TI") = TArray
	Application.UnLock

End Sub

Function CheckAnnouceValue

	If Article_NotReplay = 1 Then Exit Function

	GBL_CHK_TempStr = ""

	If DEF_EnableAttestNumber > 2 Then
		If CheckRndNumber = 0 Then
			If ChangeLMTFlag = 1 Then
				If LMT_DefaultEdit = 0 Then
					LMT_DefaultEdit = 1
				Else
					LMT_DefaultEdit = 0
				End If
				GBL_CHK_TempStr = ""
			End If
			GBL_CHK_TempStr = "<b><font color=ff0000>验证码填写错误!</font></b><br>"
			GBL_CHK_Flag = 0
			Exit Function
		End If
	End If
	If GBL_BoardMasterFlag < 5 or isNumeric(Form_TitleStyle) = 0 then
		Form_TitleStyle = 0
	Else
		Form_TitleStyle = fix(cCur(Form_TitleStyle))
		If Form_TitleStyle < 0 or Form_TitleStyle > 4 Then Form_TitleStyle = 0
		If Form_TitleStyle = 1 and GBL_BoardMasterFlag <9 then Form_TitleStyle = 0
	End If

	If cCur(Form_ParentID) <> 0 or (GBL_CHK_CachetValue <= 1 and GBL_BoardMasterFlag <= 4) or isNumeric(Form_GoodAssort) = 0 Then
		Form_GoodAssort = 0
	Else
		Form_GoodAssort = fix(cCur(Form_GoodAssort))
		If Form_GoodAssort <> 0 Then
			If CheckGoodAssortID(Form_GoodAssort) = 0 Then
				GBL_CHK_TempStr = "错误，所属专题选择错误.<br>" & VbCrLf
				CheckAnnouceValue = 0
				Exit Function
			End If
		End If
	End If

	If Len(Form_Content)>LMT_MaxTextLength Then
		GBL_CHK_TempStr = "错误，帖子内容不能超过" & DEF_MaxTextLength & "字节.<br>" & VbCrLf
		CheckAnnouceValue = 0
		If ChangeLMTFlag = 1 Then
			If LMT_DefaultEdit = 0 Then
				LMT_DefaultEdit = 1
			Else
				LMT_DefaultEdit = 0
			End If
		End If
		Exit Function
	End If

	If ChangeLMTFlag = 1 Then
		CheckAnnouceValue = 0
		If LMT_DefaultEdit = 0 Then
			ConvertFlag = 0
			Form_Content = Ubb_Code(Form_Content)
			ConvertFlag = 1
		Else
			Form_Content = Html2UbbCode(Form_Content)
		End If
		GBL_CHK_TempStr = ""
		Exit Function
	End If
	
	If GetBinarybit(GBL_Board_BoardLimit,9) = 0 Then
		If GBL_UserID<1 Then
			GBL_CHK_TempStr = "密码或用户名错误，或此用户已经被服务器暂时屏蔽。<br>" & VbCrLf
			CheckAnnouceValue = 0
			Exit Function
		End If
		If GBL_CHK_OnlineTime < DEF_NeedOnlineTime and DEF_NeedOnlineTime > 0 and CheckSupervisorUserName = 0 Then
			GBL_CHK_TempStr = "论坛限制在线时间(经验)" & Fix(DEF_NeedOnlineTime/60) & "分钟以上用户才能发言。<br>" & VbCrLf
			CheckAnnouceValue = 0
			Exit Function
		End If
	Else
		If GBL_UserID < 1 and Form_UserName <> "" Then
			If CheckUserNameExist(Form_UserName) = 1 Then
				GBL_CHK_TempStr = "注意：用户名" & htmlencode(Form_UserName) & "已经有人使用，请不要使用此用户名发帖。<br>" & VbCrLf
				CheckAnnouceValue = 0
				Exit Function
			End If
		End If
	End If

	If isNumeric(Form_BoardID)=0 Then
		GBL_CHK_TempStr = "发生错误，一切资料需要重发。<br>" & VbCrLf
		CheckAnnouceValue = 0
		Exit Function
	End If
	Form_BoardID = cCur(Form_BoardID)
	If Borad_CheckBoardIDExist(Form_BoardID) = 0 Then
		GBL_CHK_TempStr = "发生错误，一切资料需要重发.<br>" & VbCrLf
		CheckAnnouceValue = 0
		Exit Function
	End If

	If isNumeric(Form_ParentID)=0 Then Form_ParentID=0
	Form_ParentID = cCur(Form_ParentID)
	If Form_ParentID<>0 Then
		If Borad_CheckAnnounceIDExist(Form_ParentID) = 0 Then
			GBL_CHK_TempStr = "发生错误，要回复的帖子不存在，可以是刚删除或其它原因.<br>" & VbCrLf
			CheckAnnouceValue = 0
			Exit Function
		End If
	End If
	
	If Trim(Form_Title & "") = "" Then
		GBL_CHK_TempStr = "错误，请填写帖子名称.<br>" & VbCrLf
		CheckAnnouceValue = 0
		Exit Function
	End If

	If strLength(Form_Title)>255 Then
		GBL_CHK_TempStr = "错误，帖子名称太长.<br>" & VbCrLf
		CheckAnnouceValue = 0
		Exit Function
	End If
 	If Trim(Replace(Form_Content,VbCrLf,"")) = "" and (Form_ParentID = 0 or (htmlencode(Form_Title) = LMT_TopicNameNoHTML or htmlencode(Form_Title) = "Re:" & LMT_TopicNameNoHTML)) Then
		GBL_CHK_TempStr = "错误，请填写帖子内容.<br>" & VbCrLf
		CheckAnnouceValue = 0
		Exit Function
	End If

	Dim TempURL,Loop_N,Temp
	If Form_VoteFlag <> "" and Form_ParentID=0 Then
		If Replace(Form_VoteItem,VbCrLf,"") = "" Then
			GBL_CHK_TempStr = "错误，投票选项必须填写.<br>" & VbCrLf
			CheckAnnouceValue = 0
			Exit Function
		End If
		
		Dim Form_VoteItem_Old
		Form_VoteItem_Old = Form_VoteItem
		Temp = 0
		TempURL = Split(Form_VoteItem,VbCrLf)
		Form_VoteItem = ""
		For Loop_N = 0 to Ubound(TempURL,1)
			TempURL(Loop_N) = Trim(TempURL(Loop_N))
			If TempURL(Loop_N) <> "" Then
				If StrLength(TempURL(Loop_N)) > 48 Then
					GBL_CHK_TempStr = "错误，投票选项内容太长，不能超过24字.<br>" & VbCrLf
					Form_VoteItem = Form_VoteItem_Old
					CheckAnnouceValue = 0
					Exit Function
				End If
				If Temp > 0 Then
					Form_VoteItem = Form_VoteItem & VbCrLf & TempURL(Loop_N)
				Else
					Form_VoteItem = Form_VoteItem & TempURL(Loop_N)
				End If
				Temp = Temp + 1
				If Temp > DEF_VOTE_MaxNum Then
					GBL_CHK_TempStr = "错误，投票选项不能超过" & DEF_VOTE_MaxNum & "个.<br>" & VbCrLf
					Form_VoteItem = Form_VoteItem_Old
					CheckAnnouceValue = 0
					Exit Function
				End If
			End If
		Next
		
		If Temp < 2 Then
			GBL_CHK_TempStr = "既然是投票，请不要少于两个选项.<br>" & VbCrLf
			Form_VoteItem = Form_VoteItem_Old
			CheckAnnouceValue = 0
			Exit Function
		End If

		If Left(Form_VoteItem,1) = VbCrLf Then Form_VoteItem = Mid(Form_VoteItem,2)

		If isNumeric(Form_Vote_ExpireDay) = 0 then Form_Vote_ExpireDay = 0
		Form_Vote_ExpireDay = Fix(cCur(Form_Vote_ExpireDay))
		If Form_Vote_ExpireDay < 0 or Form_Vote_ExpireDay > 365 Then
			GBL_CHK_TempStr = "错误，投票到期时间选择错误.<br>" & VbCrLf
			Form_VoteItem = Form_VoteItem_Old
			CheckAnnouceValue = 0
			Exit Function
		End If

		If isNumeric(Form_VoteType) = 0 then Form_VoteType = 0
		Form_VoteType = Fix(cCur(Form_VoteType))
		If Form_VoteType <> 0 and Form_VoteType <> 1 Then
			GBL_CHK_TempStr = "错误，投票类型只能是单选票或多选票.<br>" & VbCrLf
			Form_VoteItem = Form_VoteItem_Old
			CheckAnnouceValue = 0
			Exit Function
		End If
	End If

	Loop_N = CheckIsRestSpaceTime(Form_Title)
	If Loop_N = 1 and CheckSupervisorUserName = 0 Then
		GBL_CHK_TempStr = GBL_CHK_TempStr & "不能连续发太多的帖子，请休息" & DEF_RestSpaceTime & "秒钟后再发帖!<br>"
		GBL_CHK_Flag = 0
		Exit Function
	Else
		If Loop_N = 2 Then
			GBL_CHK_TempStr = GBL_CHK_TempStr & "请不要发重复的帖子!<br>"
			GBL_CHK_Flag = 0
			Exit Function
		End If
	End If

	If Form_ParentID=0 and GBL_UserID>0 and (GBL_BoardMasterFlag >= 5) and Form_AnnounceIsTopFlag=1 and GetBinarybit(GBL_CHK_UserLimit,4) = 0 Then
		If CheckMakeTopAnnounceOver = 1 then
			GBL_CHK_TempStr = GBL_CHK_TempStr & "错误,置顶的帖子太多，不能再发表直接置顶的帖子.<br>"
			GBL_CHK_Flag = 0
			Exit Function
		End If
	End If

	Form_Title = UBB_FiltrateBadWords(Form_Title)

	If Form_ParentID = 0 Then
		LMT_LastInfo = ""
	Else
		If Form_Title = "Re:" & LMT_TopicNameNoHTML Then
			LMT_LastInfo = UBB_FiltrateBadWords(Left(Form_Content,100))
		Else
			If Form_TitleStyle = 1 Then
				LMT_LastInfo = UBB_FiltrateBadWords(KillHTMLLabel(Form_Title))
			Else
				LMT_LastInfo = UBB_FiltrateBadWords(Form_Title)
			End if
		End If
	End If

	Form_Length = Len(Form_Content)
	If Left(Form_Title,3) = "Re:" and htmlencode(Form_Title) <> "Re:" & LMT_TopicNameNoHTML and Form_ParentID <> 0 Then Form_Title = Mid(Form_Title,4)
	If GBL_Board_ForumPass <> "" or GBL_Board_OtherLimit > 0 or GetBinarybit(GBL_Board_BoardLimit,2) = 1 or GetBinarybit(GBL_Board_BoardLimit,7) = 1 Then
	Else
		If Left(Form_Title,3) = "Re:" Then
			GBL_CHK_TempStr = Trim(Left(Form_Content,20))
			If Form_Length > 20 Then GBL_CHK_TempStr = GBL_CHK_TempStr & "..."
			If Replace(Replace(GBL_CHK_TempStr,chr(13),""),chr(10),"") <> "" Then Form_Title = "re:" & GBL_CHK_TempStr
			GBL_CHK_TempStr = ""
		End If
	End If
	Form_Title = Replace(Replace(Form_Title,chr(13),""),chr(10),"")

	CheckAnnouceValue = 1

End Function

Function CheckMakeTopAnnounceOver

	Dim Rs,SQL
	Set Rs = Server.CreateObject("ADODB.RecordSet")
	SQL = "Select count(*) from LeadBBS_Topic Where BoardID=" & GBL_board_ID & " and RootID>=" & DEF_BBS_TOPMinID
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	If Not Rs.Eof Then
		SQL = Rs(0)
		If isNull(SQL) Then SQL = 0
		SQL = cCur(SQL)
	Else
		SQL = 0
	End If
	Rs.Close
	Set Rs = Nothing

	If SQL > DEF_BBS_MaxTopAnnounce Then
		CheckMakeTopAnnounceOver = 1
	Else
		CheckMakeTopAnnounceOver = 0
	End If

End Function

Function CheckIsRestSpaceTime(Form_Title)

	Dim Rs,ndatetime,Temp_ID,Temp_Title,Temp_Content,LastAnnounceID
	If GBL_CHK_LastAnnounceID > 0 and GetBinarybit(GBL_Board_BoardLimit,9) = 0 or GBL_UserID > 0 Then
		Set Rs=Con.ExeCute("Select top 1 ndatetime,ID,title,Content,htmlflag,printContent from LeadBBS_Announce where ID=" & GBL_CHK_LastAnnounceID)
		GBL_DBNum = GBL_DBNum + 1
		If Rs.Eof Then
			CheckIsRestSpaceTime = 0
			Rs.Close
			Set Rs = Nothing
			Temp_ID = 0
		Else
			ndatetime = Rs(0)
			Temp_ID = cCur(Rs(1))
			Temp_Title = Rs(2)
			Select Case Rs(4)
				Case 1: Temp_Content = Rs(5)
				Case 2: Temp_Content = Rs(3)
				Case 3: Temp_Content = ResumeCode(Rs(5))
				Case Else: Temp_Content = ResumeCode(Rs(5))
			End Select
			Rs.Close
			Set Rs = Nothing
		End if
	Else
		Set Rs=Con.ExeCute("Select max(ID) from LeadBBS_Announce where IPAddress='" & Replace(GBL_IPAddress,"'","''") & "'")
		If Not Rs.Eof Then
			LastAnnounceID = Rs(0)
			If isNull(LastAnnounceID) Then LastAnnounceID = 0
			LastAnnounceID = cCur(LastAnnounceID)
		Else
			LastAnnounceID = 0
		End If
		Rs.close
		Set Rs = Nothing
		If LastAnnounceID = 0 Then
			CheckIsRestSpaceTime = 0
			Exit Function
		End If
		Set Rs=Con.ExeCute("Select top 1 ndatetime,ID,title,Content,htmlflag,printContent from LeadBBS_Announce where ID=" & LastAnnounceID)
		GBL_DBNum = GBL_DBNum + 1
		If Rs.Eof Then
			CheckIsRestSpaceTime = 0
			Rs.Close
			Set Rs = Nothing
			Exit Function
		Else
			ndatetime = Rs(0)
			Temp_ID = cCur(Rs(1))
			Temp_Title = Rs(2)
			Select Case Rs(4)
				Case 1: Temp_Content = Rs(5)
				Case 2: Temp_Content = Rs(3)
				Case 3: Temp_Content = ResumeCode(Rs(5))
				Case Else: Temp_Content = ResumeCode(Rs(5))
			End Select
			Rs.Close
			Set Rs = Nothing
		End if
	End If

	If Temp_ID = 0 Then
		Exit Function
	End If

	If DateDiff("s", RestoreTime(ndatetime), DEF_Now) < 0 Then
		CheckIsRestSpaceTime = 0
		Exit Function
	End If

	If DateDiff("s", RestoreTime(ndatetime), DEF_Now) < DEF_RestSpaceTime and CheckSupervisorUserName = 0 Then
		CheckIsRestSpaceTime = 1
		GBL_DBNum = GBL_DBNum + 1
	Else
		If (Temp_Title = Form_Title or "Re:" & Temp_Title = Form_Title) and Temp_Content = Form_Content Then
			CheckIsRestSpaceTime = 2
		Else
			CheckIsRestSpaceTime = 0
		End If
	End If

End Function

Function SaveAnnounceValue

	If Form_UserName = "" Then
		Form_UserName = "游客"
		GBL_UserID = 0
		Form_UserID = 0
	End If
	Form_UserID = cCur(Form_UserID)
	If inStr(Lcase(Form_UserName),"<script") > 0 or inStr(Lcase(Form_UserName),"<\script") > 0 or inStr(Lcase(Form_UserName),"</script") > 0 Then Form_UserName = "游客"
	Form_NoUserUnderWriteFlag = cCur(Form_NoUserUnderWriteFlag)
	Form_UnderWriteFlag = cCur(Form_UnderWriteFlag)
	Dim SQL,Rs,MaxRootID
	Rem 为了兼容，最好加入选取最大RootID值，如果RootID大于MaxID，则RootID取代MaxID(RootID<DEF_BBS_TOPMinID)
	
	If Form_ParentID = 0 or DEF_EnableMakeTopAnc = 1 Then
		'MaxRootID = cCur(Application(DEF_MasterCookies & "BoardInfo" & GBL_board_ID)(11,0))
		'If MaxRootID >= DEF_BBS_TOPMinID Then
			Set Rs = Con.ExeCute("Select top " & DEF_BBS_MaxTopAnnounce + 2 & " RootID from LeadBBS_Topic where BoardID=" & GBL_Board_ID & " Order by RootID DESC")
			MaxRootID = 0
			Do while Not Rs.Eof
				If cCur(Rs(0)) < DEF_BBS_TOPMinID Then
					MaxRootID = cCur(Rs(0))
					Exit Do
				End If
				Rs.MoveNext
			Loop
			GBL_DBNum = GBL_DBNum + 1
			Rs.Close
			Set Rs = Nothing
			
			If MaxRootID >= DEF_BBS_TOPMinID and MaxRootID > 0 Then
				Set Rs = Con.ExeCute("Select Max(RootID) from LeadBBS_Topic where BoardID=" & GBL_Board_ID & " and RootID<" & DEF_BBS_TOPMinID)
				If Rs.Eof Then
					MaxRootID = 1
				Else
					MaxRootID = Rs(0)
					If isNull(MaxRootID) or MaxRootID="" Then MaxRootID=1
					MaxRootID = cCur(MaxRootID)
				End If
			End If
		'End If
	End If

	If Form_ParentID<>0 Then
		If DEF_EnableTreeView = 1 Then
			Set Rs = Con.ExeCute("Select top 1 RootIDBak,Layer,TopicSortID from LeadBBS_Announce where id=" & Form_ParentID)
			GBL_DBNum = GBL_DBNum + 1
			If Rs.Eof Then
				SaveAnnounceValue = 0
				Rs.Close
				Set Rs = Nothing
				GBL_CHK_TempStr = "意外错误，要回复的帖子找不到.<br>" & VbCrLf
				Exit Function
			Else
				Form_RootID = cCur(Rs("RootIDBak"))
				Form_Layer = Rs("Layer") + 1
				Form_TopicSortID = cCur(Rs("TopicSortID"))+1
				Rs.Close
				Set Rs = Nothing
			End If
		Else
			Form_RootID = 0
			Form_Layer = 2
			Form_TopicSortID = Form_RootMaxID + 1
		End If

		If Form_Layer>2 Then
			Con.ExeCute(" Update LeadBBS_Announce Set ChildNum=ChildNum+1 where id=" & Form_ParentID)
			GBL_DBNum = GBL_DBNum + 1
		End If
		If DEF_EnableTreeView = 1 Then
			Con.ExeCute("Update LeadBBS_Announce Set TopicSortID=TopicSortID+1 where BoardID=" & Form_boardID & " and RootIDBak=" & LMT_RootIDBak & " and TopicSortID>=" & Form_TopicSortID)
			GBL_DBNum = GBL_DBNum + 1
		End If
	Else
		If Form_ParentID=0 and GBL_UserID>0 and (GBL_BoardMasterFlag >= 5) and Form_AnnounceIsTopFlag=1 and GetBinarybit(GBL_CHK_UserLimit,4) = 0 Then
			Set Rs=Con.ExeCute("Select Max(RootID) from LeadBBS_Topic Where BoardID=" & GBL_Board_ID & " and RootID>=" & DEF_BBS_TOPMinID)
			GBL_DBNum = GBL_DBNum + 1
			If Rs.Eof Then
				Form_RootID = DEF_BBS_TOPMinID+1
			Else
				Form_RootID = Rs(0)
				If isNull(Form_RootID) or Form_RootID="" Then Form_RootID = DEF_BBS_TOPMinID+1
				Form_RootID = cCur(Form_RootID)+1
				If Form_RootID<DEF_BBS_TOPMinID Then Form_RootID=DEF_BBS_TOPMinID
			End If
			Rs.Close
			Set Rs = Nothing
		Else
			Form_RootID = MaxRootID+1
		End If
		Form_Layer = 1
		Form_TopicSortID = 1
	End If
	Form_ndatetime = GetTimeValue(DEF_Now)
	Form_LastTime = Form_ndatetime

	'0-纯文本，1-html，２-ubb,3-同纯文本的无ubb处理过的
	If LMT_DefaultEdit = 0 Then
		If Form_htmlflag = 2 Then
			Form_content = Html2UBBCode(Form_content)
			Form_PrintContent = Ubb_code(Form_content)
			If Form_PrintContent = UBB_FiltrateBadWords(PrintTrueText(Form_content)) Then
				Form_htmlflag = 3
				Form_content = ""
			End If
		ElseIf Form_htmlflag = 1 and CheckSupervisorUserName = 1 and GBL_UserID > 0 Then
			Form_PrintContent = Form_content
			Form_content = ""
		Else
			Form_content = KillHTMLLabel(Replace(Replace(Replace(Replace(Form_content,"</p>",VbCrLf & VbCrLf),"</P>",VbCrLf & VbCrLf),"<BR>",VbCrLf),"<br>",VbCrLf))
			Form_PrintContent = UBB_FiltrateBadWords(PrintTrueText(Form_content))
			Form_content = ""
		End If
	Else
		If Form_htmlflag = 2 Then
			Form_PrintContent = Ubb_code(Form_content)
			If Form_PrintContent = UBB_FiltrateBadWords(PrintTrueText(Form_content)) Then
				Form_htmlflag = 3
				Form_content = ""
			End If
		ElseIf Form_htmlflag = 1 and CheckSupervisorUserName = 1 and GBL_UserID > 0 Then
			Form_PrintContent = Form_content
			Form_content = ""
		Else
			Form_PrintContent = UBB_FiltrateBadWords(PrintTrueText(Form_content))
			Form_content = ""
		End If
	End If

	Form_PollNum = 0
	If Form_htmlflag = 2 and Form_TopicType <> 80 and Form_ParentID = 0 and Form_TopicType <> 54 Then
		If inStr(Form_content,"[/MP]") or inStr(Form_content,"[/mp]") Then
			Form_PollNum = 1
		ElseIf inStr(Form_content,"[/rm]") or inStr(Form_content,"[/RM]") Then
			Form_PollNum = 2
		ElseIf inStr(Form_content,"[/flash]") or inStr(Form_content,"[/FLASH]") Then
			Form_PollNum = 3
		ElseIf inStr(Form_content,".rar]") or inStr(Form_content,".RAR]") or inStr(Form_content,".rar ") or inStr(Form_content,".RAR ") or inStr(Form_content,".rar" & VbCrLf) or inStr(Form_content,".RAR" & VbCrLf) or LCase(Right(Form_content,4)) = ".rar" Then
			Form_PollNum = 6
		ElseIf inStr(Form_content,".zip]") or inStr(Form_content,".ZIP]") or inStr(Form_content,".zip ") or inStr(Form_content,".ZIP ") or inStr(Form_content,".zip" & VbCrLf) or inStr(Form_content,".ZIP" & VbCrLf) or LCase(Right(Form_content,4)) = ".zip" Then
			Form_PollNum = 7
		ElseIf inStr(Form_content,".txt]") or inStr(Form_content,".TXT]") or inStr(Form_content,".txt ") or inStr(Form_content,".TXT ") or inStr(Form_content,".txt" & VbCrLf) or inStr(Form_content,".TXT" & VbCrLf) or LCase(Right(Form_content,4)) = ".txt" Then
			Form_PollNum = 8
		ElseIf inStr(Form_content,".doc]") or inStr(Form_content,".DOC]") or inStr(Form_content,".doc ") or inStr(Form_content,".DOC ") or inStr(Form_content,".doc" & VbCrLf) or inStr(Form_content,".DOC" & VbCrLf) or LCase(Right(Form_content,4)) = ".doc" Then
			Form_PollNum = 9
		ElseIf inStr(Form_content,"[/img") or inStr(Form_content,"[/IMG") Then
			Form_PollNum = 4
		ElseIf inStr(Form_content,"[/url]") or inStr(Form_content,"[/URL]") Then
			Form_PollNum = 5
		End If
	End If
	If Form_NeedValue = "" then Form_NeedValue = 0
	Form_NeedValue = cCur(Form_NeedValue)

	If Form_ParentID <> 0 Then
		Form_TopicType = 0
		Form_NeedValue = 0
	End If

	If GBL_BoardMasterFlag <4 and GetBinarybit(GBL_Board_BoardLimit,13) = 1 Then
		Form_TitleStyle = Form_TitleStyle + 60
	End If
	SQL = " insert into LeadBBS_Announce(ParentID,TopicSortID,BoardID,RootID," & _
		    "Layer,Title,Content,PrintContent,FaceIcon,ndatetime,LastTime,Length," &_
		    "UserName,UserID,UnderWriteFlag,htmlflag,NotReplay,IPAddress,TopicType,NeedValue,TitleStyle,RootIDBak,VisitIP,GoodAssort,PollNum)" &_
	" values(" & Form_ParentID & "," & Form_TopicSortID & "," & Form_BoardID & "," & Form_RootID & "," &_
	Form_Layer & ",'" & Replace(Form_Title,"'","''") & "','" & Replace(Replace(Form_Content & "","\" & VbCrLf,"\\" & VbCrLf & VbCrLf),"'","''") & "','" & Replace(Replace(Form_PrintContent & "","\" & VbCrLf,"\\" & VbCrLf & VbCrLf),"'","''") & "'," &_
	Form_FaceIcon & "," & Form_ndatetime & "," & Form_LastTime & "," & Form_Length & ",'" &_
	Replace(Form_UserName,"'","''") & "'," & Form_UserID & "," & Form_NoUserUnderWriteFlag & "," & Form_htmlflag & "," & Form_NotReplay & ",'" & Replace(GBL_IPAddress,"'","''") & "'" & _
	"," & Form_TopicType & "," & Form_NeedValue & "," & Form_TitleStyle & "," & LMT_RootIDBak & ",'0.0.0.0'," & Form_GoodAssort & "," & Form_PollNum & ")"
	
	ChangeGoodAssort(Form_GoodAssort)

	Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	
	If NewAnnounceID = 0 Then
		SQL = "Select max(id) from LeadBBS_Announce where UserID=" & Form_UserID
		Set Rs=Con.ExeCute(SQL)
		If Rs.Eof Then
			GBL_CHK_TempStr = "意外错误，刚发的帖可能已经删除或其它意外错误！<br>" & VbCrLf
			Rs.Close
			Set Rs = Nothing
			Exit Function
		End If
		NewAnnounceID = Rs(0)
		If isNull(NewAnnounceID) Then NewAnnounceID = 0
		NewAnnounceID = cCur(NewAnnounceID)
		If Form_ParentID = 0 then LMT_RootIDBak = NewAnnounceID
		Rs.Close
		Set Rs = Nothing
	End If
	
	If Form_ParentID = 0 Then
		SQL = " insert into LeadBBS_Topic(ID,BoardID,RootID," & _
			    "Title,FaceIcon,ndatetime,LastTime,Length," &_
			    "UserName,UserID,NotReplay,TopicType,NeedValue,TitleStyle,VisitIP,GoodAssort,PollNum)" &_
		" values(" & NewAnnounceID & "," & Form_BoardID & "," & Form_RootID & "," &_
		"'" & Replace(Form_Title,"'","''") & "'," &_
		Form_FaceIcon & "," & Form_ndatetime & "," & Form_LastTime & "," & Form_Length & ",'" &_
		Replace(Form_UserName,"'","''") & "'," & Form_UserID & "," & Form_NotReplay & "" & _
		"," & Form_TopicType & "," & Form_NeedValue & "," & Form_TitleStyle & ",'0.0.0.0'," & Form_GoodAssort & "," & Form_PollNum & ")"
	
		Con.ExeCute(SQL)
	End If

	If GBL_BoardMasterFlag <4 and GetBinarybit(GBL_Board_BoardLimit,13) = 1 Then
		Form_Title = "新审核帖子..."
		LMT_TopicNameNoHTML = "新审核帖子..."
		LMT_LastInfo = ""
	End If

	Dim NewMaxAnnounceID
	NewMaxAnnounceID = NewAnnounceID

	Rem 更新MaxRootID
	If Form_ParentID > 0 Then
		If DEF_EnableMakeTopAnc = 1 and cCur(LMT_RootID)<DEF_BBS_TOPMinID Then
			Con.ExeCute("Update LeadBBS_Announce Set RootID=" & MaxRootID+1 & ",ChildNum=ChildNum+1,LastTime=" & GetTimeValue(DEF_Now) & ",LastUser='" & Replace(Form_UserName,"'","''") & "',RootMaxID=" & NewMaxAnnounceID & ",LastInfo='" & Replace(Left(LMT_LastInfo,100),"'","''") & "' where ID=" & LMT_RootIDBak)
			GBL_DBNum = GBL_DBNum + 1
			Con.ExeCute("Update LeadBBS_Topic Set RootID=" & MaxRootID+1 & ",ChildNum=ChildNum+1,LastTime=" & GetTimeValue(DEF_Now) & ",LastUser='" & Replace(Form_UserName,"'","''") & "',RootMaxID=" & NewMaxAnnounceID & ",LastInfo='" & Replace(Left(LMT_LastInfo,100),"'","''") & "' where ID=" & LMT_RootIDBak)
			GBL_DBNum = GBL_DBNum + 1
			
			If cCur(Application(DEF_MasterCookies & "BoardInfo" & GBL_board_ID)(12,0)) >= cCur(LMT_RootID) Then
				UpdateBoardValue(GBL_board_ID)
			Else
				Con.ExeCute(" Update LeadBBS_Boards Set AllMaxRootID=" & MaxRootID+1 & ",LastWriter='" & Replace(Form_UserName,"'","''")  &"',LastWriteTime=" & Form_LastTime & ",LastAnnounceID=" & LMT_RootIDBak & ",LastTopicName='" & Replace(LMT_TopicNameNoHTML,"'","''") & "' where BoardID=" & GBL_board_ID)
				GBL_DBNum = GBL_DBNum + 1
				UpdateBoardApplicationInfo GBL_Board_ID,MaxRootID+1,11
			End If
		Else
			Con.ExeCute(" Update LeadBBS_Boards Set LastWriter='" & Replace(Form_UserName,"'","''")  &"',LastWriteTime=" & Form_LastTime & ",LastAnnounceID=" & LMT_RootIDBak & ",LastTopicName='" & Replace(LMT_TopicNameNoHTML,"'","''") & "' where BoardID=" & GBL_board_ID)
			GBL_DBNum = GBL_DBNum + 1
			Con.ExeCute("Update LeadBBS_Announce Set ChildNum=ChildNum+1,LastTime=" & GetTimeValue(DEF_Now) & ",LastUser='" & Replace(Form_UserName,"'","''") & "',RootMaxID=" & NewMaxAnnounceID & ",LastInfo='" & Replace(Left(LMT_LastInfo,100),"'","''") & "' where ID=" & LMT_RootIDBak)
			GBL_DBNum = GBL_DBNum + 1			
			Con.ExeCute("Update LeadBBS_Topic Set ChildNum=ChildNum+1,LastTime=" & GetTimeValue(DEF_Now) & ",LastUser='" & Replace(Form_UserName,"'","''") & "',RootMaxID=" & NewMaxAnnounceID & ",LastInfo='" & Replace(Left(LMT_LastInfo,100),"'","''") & "' where ID=" & LMT_RootIDBak)
			GBL_DBNum = GBL_DBNum + 1
		End If

		UpdateBoardApplicationInfo GBL_board_ID,Form_UserName,3
		UpdateBoardApplicationInfo GBL_board_ID,Form_LastTime,4
		UpdateBoardApplicationInfo GBL_board_ID,LMT_RootIDBak,19
		UpdateBoardApplicationInfo GBL_board_ID,LMT_TopicNameNoHTML,20
		UpdateBoardAnnounceNum Application(DEF_MasterCookies & "BoardInfo" & GBL_board_ID)(28,0),0,1,1,0,Form_UserName,Form_LastTime,LMT_RootIDBak,LMT_TopicNameNoHTML

		Con.ExeCute(" Update LeadBBS_User set Points=Points+" & DEF_BBS_AnnouncePoints & ",AnnounceNum=AnnounceNum+1,AnnounceNum2=AnnounceNum2+1,LastAnnounceID=" & NewAnnounceID & " Where ID = " & Form_UserID)
		GBL_DBNum = GBL_DBNum + 1
		UpdateSessionValue 4,DEF_BBS_AnnouncePoints,1
		UpdateSessionValue 14,NewAnnounceID,0
		If inStr(application(DEF_MasterCookies & "TopAncList"),"," & LMT_RootIDBak & ",") Then
			UpdateAnnounceApplicationInfo LMT_RootIDBak,10,Form_UserName,0,0
			UpdateAnnounceApplicationInfo LMT_RootIDBak,4,Form_LastTime,0,0
			UpdateAnnounceApplicationInfo LMT_RootIDBak,1,LMT_ChildNum + 1,0,0
			UpdateAnnounceApplicationInfo LMT_RootIDBak,17,LMT_LastInfo,0,0
		Else
			If inStr(application(DEF_MasterCookies & "TopAncList" & GBL_Board_BoardAssort),"," & LMT_RootIDBak & ",") Then
				UpdateAnnounceApplicationInfo LMT_RootIDBak,10,Form_UserName,0,GBL_Board_BoardAssort
				UpdateAnnounceApplicationInfo LMT_RootIDBak,4,Form_LastTime,0,GBL_Board_BoardAssort
				UpdateAnnounceApplicationInfo LMT_RootIDBak,1,LMT_ChildNum + 1,0,GBL_Board_BoardAssort
				UpdateAnnounceApplicationInfo LMT_RootIDBak,17,LMT_LastInfo,0,GBL_Board_BoardAssort
			End If
		End If
	Else
		Con.ExeCute("Update LeadBBS_Announce Set RootMaxID=ID,RootMinID=ID,RootIDBak=ID where RootIDBak=0")
		GBL_DBNum = GBL_DBNum + 1
		Con.ExeCute("Update LeadBBS_Topic Set RootMaxID=ID,RootMinID=ID where ID=" & NewAnnounceID)
		GBL_DBNum = GBL_DBNum + 1
		Con.ExeCute(" Update LeadBBS_User set Points=Points+" & DEF_BBS_AnnouncePoints * 2 & ",AnnounceNum=AnnounceNum+1,AnnounceNum2=AnnounceNum2+1,AnnounceTopic=AnnounceTopic+1,LastAnnounceID=" & NewAnnounceID & " Where ID = " & Form_UserID)
		GBL_DBNum = GBL_DBNum + 1
		UpdateSessionValue 4,DEF_BBS_AnnouncePoints * 2,1
		UpdateSessionValue 14,NewAnnounceID,0

		LMT_TopicName = Form_Title
		If Form_TitleStyle <> 1 Then
			LMT_TopicNameNoHTML = Form_Title
		Else
			LMT_TopicNameNoHTML = KillHTMLLabel(Form_Title)
		End If
		
		If Form_RootID > cCur(Application(DEF_MasterCookies & "BoardInfo" & GBL_board_ID)(11,0)) Then
			If cCur(Application(DEF_MasterCookies & "BoardInfo" & GBL_board_ID)(12,0)) = 0 Then
				UpdateBoardValue(GBL_board_ID)
			Else
				Con.ExeCute(" Update LeadBBS_Boards Set AllMaxRootID=" & Form_RootID & ",LastWriter='" & Replace(Form_UserName,"'","''")  &"',LastWriteTime=" & Form_LastTime & ",LastAnnounceID=" & LMT_RootIDBak & ",LastTopicName='" & Replace(LMT_TopicNameNoHTML,"'","''") & "' where BoardID=" & GBL_board_ID)
				UpdateBoardApplicationInfo GBL_Board_ID,Form_RootID,11
			End If
		Else
			Con.ExeCute(" Update LeadBBS_Boards Set LastWriter='" & Replace(Form_UserName,"'","''")  &"',LastWriteTime=" & Form_LastTime & ",LastAnnounceID=" & LMT_RootIDBak & ",LastTopicName='" & Replace(LMT_TopicNameNoHTML,"'","''") & "' where BoardID=" & GBL_board_ID)
		End If
		GBL_DBNum = GBL_DBNum + 1
		UpdateBoardApplicationInfo GBL_board_ID,Form_RootID,11
		UpdateBoardApplicationInfo GBL_board_ID,Form_UserName,3
		UpdateBoardApplicationInfo GBL_board_ID,Form_LastTime,4
		UpdateBoardApplicationInfo GBL_board_ID,LMT_RootIDBak,19
		UpdateBoardApplicationInfo GBL_board_ID,LMT_TopicNameNoHTML,20
		UpdateBoardAnnounceNum Application(DEF_MasterCookies & "BoardInfo" & GBL_board_ID)(28,0),1,1,1,0,Form_UserName,Form_LastTime,LMT_RootIDBak,LMT_TopicNameNoHTML
	End If
	'on error resume next
	If err Then
		SaveAnnounceValue = 0
		GBL_CHK_TempStr = "错误，服务器太忙或您的文档大太，请重新提交表单!<br>" & VbCrLf
		err.clear
	Else
		SaveAnnounceValue = 1
	End If

	Rem 下面保存投票选项
	Dim TempURL,Loop_N,Temp
	If Form_VoteFlag <> "" and Form_ParentID=0 Then
		Form_Vote_ExpireDay = cCur(Form_Vote_ExpireDay)
		If Form_Vote_ExpireDay <> 0 Then Form_Vote_ExpireDay = GetTimeValue(DateAdd("d",Form_Vote_ExpireDay,DEF_Now))
		Temp = 0
		TempURL = Split(Form_VoteItem,VbCrLf)
		Form_VoteItem = ""
		For Loop_N = 0 to Ubound(TempURL,1)
			If TempURL(Loop_N) <> "" Then
				Con.ExeCute("insert into [LeadBBS_VoteItem](AnnounceID,VoteType,VoteName,ExpiresTime) values(" & NewAnnounceID & "," & Form_VoteType & ",'" & Replace(UBB_FiltrateBadWords(TempURL(Loop_N)),"'","''") & "'," & Form_Vote_ExpireDay & ")")
				GBL_DBNum = GBL_DBNum + 1
				Temp = Temp + 1
				If Temp > DEF_VOTE_MaxNum Then
					GBL_CHK_TempStr = "错误，投票选项不能超过" & DEF_VOTE_MaxNum & "个.<br>" & VbCrLf
					CheckAnnouceValue = 0
					Exit Function
				End If
			End If
		Next
	End If

	UpdateUserLevel(Form_UserID)
	
End Function

Function DisplayAnnounceAccessfull

If GBL_TableHeadString <> "" Then
	Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"
	Response.Write GBL_TableHeadString
	Response.Write "</td></tr></table>"
End If%>
<table bgcolor=<%=DEF_BBS_DarkColor%> border=0 cellpadding=0 cellspacing=0 width="<%=DEF_BBS_ScreenWidth%>" align="center" class=TBone>
<tbody>
<tr>
<td>
<table border=0 cellpadding=0 cellspacing=0 width="100%">
<tbody>
<tr>
	<td>
		<table border=0 cellpadding=5 cellspacing=1 width="100%">
		<tr>
			<td bgcolor=<%=DEF_BBS_LightDarkColor%> colspan="2" class=TBHead><img src=../images/null.gif width=2 height=3><br><font color="#ffffff" class=HeadFont>&nbsp;<%
			If Form_ParentID=0 Then
				Response.Write "刚发的新帖子"
			Else
				Response.Write "刚发的回复帖子"
			End If%> 已经成功发表到版面“<%=GBL_Board_BoardName%>”中，您可以选择以下操作：</font></td>
		</tr>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightestColor%> colspan="2" class=TBBG9>
			<%
			If GBL_BoardMasterFlag <4 and GetBinarybit(GBL_Board_BoardLimit,13) = 1 Then
				Response.Write "<br>&nbsp;请耐心等待论坛管理员审核您的帖子．<br>"
			End If%>
			<br>&nbsp;本页面将在5秒后自动返回您所发表的帖子，可以继续选择以下操作：<br>
				<ul>
				<meta http-equiv=refresh content="5;URL=announce.asp?BoardID=<%=GBL_board_ID%>&ID=<%=NewAnnounceID%>&AUpflag=1&ANum=1">
					<li><a href=../Boards.asp>返回首页</a><br>
					<li>返回<a href=../Board/Board.asp?BoardID=<%=GBL_board_ID%>><%=GBL_Board_BoardName%></a>论坛<br>
					<%
					If (LMT_ChildNum + 2) > DEF_TopicContentMaxListNum Then%>
					<li>返回<a href=announce.asp?BoardID=<%=GBL_board_ID%>&ID=<%
					If Form_ParentID >0 Then
						Response.Write Form_ParentID
					Else
						Response.Write NewAnnounceID
					End If%>>刚发表的主题</a><br>
					<%End If%>
					<li>到<a href=announce.asp?BoardID=<%=GBL_board_ID%>&ID=<%
					If Form_ParentID >0 Then
						Response.Write Form_ParentID
					Else
						Response.Write NewAnnounceID
					End If%>&AUpflag=1&ANum=1>刚发表的帖子</a><br><br>
			</td>
		</tr>
		</tbody>
		</table>
	</td>
</tr>
</tbody> 
</table>
</td>
</tr>
</tbody> 
</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 ResumeCode(Tstr)

	Dim str
	str = Tstr
	str = Replace(str,"&gt;",">")
	Str = Replace(str,"&lt;","<")
	Str = Replace(str,"&quot;","""")
	Str = Replace(str," &nbsp; &nbsp; &nbsp;",chr(9))
	Str = Replace(str,"<br>" & "&nbsp;",VbCrLf & " ")
	Str = Replace(str,"<br>" & VbCrLf,VbCrLf)
	Str = Replace(str,"&nbsp;"," ")
	ResumeCode = Str

End Function

Function GetReContent(str)

	Dim in1,in2
	in1 = inStr(str,"[QUOTE]")
	if in1 > 0 Then
		in2 = inStr(str,"[/QUOTE]")
	Else
		in2 = 0
	End If
	If in1 = 0 or in2 = 0 or in1 >= in2 Then
		GetReContent = str
		Exit Function
	End If
	str = Mid(str,in2+8)
	If Left(str,2) = VbCrLf Then str = Mid(str,3)
	GetReContent = Str

End Function

Function GetTopicInfo

	If Form_ParentID = 0 Then Exit Function
	Dim ThisParentID,TmpContent
	ThisParentID = 1
	Dim Rs,SQL,submitflag,Form_TopicType,Form_NeedValue,TParentID
	Dim Topic_UserName '发帖人
	
	submitflag = Request("submitflag")
	TParentID = -1
	
	Dim RootIDBak

	Dim ac,rd,Hits
	ac = Request("ac")
	rd = Left(Request("rd"),14)
	If isNumeric(rd) = 0 or inStr(rd,".") then rd = 0
	rd = cCur(rd)
	If rd = 0 Then
		SQL = ""
	Else
		Select Case ac
			Case "pre": SQL = "Select top 1 t1.ID,t1.RootID,t1.TopicType,t1.NeedValue,t1.ParentID,t1.ChildNum,t1.Title,t1.hits,t1.NotReplay,t1.Content,t1.UserName,t1.RootIDBak,t1.TitleStyle,t1.PrintContent,t1.HtmlFlag,T2.UserLimit,T1.VisitIP,T1.RootMaxID,T1.RootMinID from LeadBBS_Announce as T1 left join LeadBBS_User as T2 on T1.UserID=T2.ID where t1.boardid=" & GBL_board_ID & " and t1.RootID>" & rd & " order by t1.RootID ASC"
			Case "nxt": SQL = "Select top 1 t1.ID,t1.RootID,t1.TopicType,t1.NeedValue,t1.ParentID,t1.ChildNum,t1.Title,t1.hits,t1.NotReplay,t1.Content,t1.UserName,t1.RootIDBak,t1.TitleStyle,t1.PrintContent,t1.HtmlFlag,T2.UserLimit,T1.VisitIP,T1.RootMaxID,T1.RootMinID from LeadBBS_Announce as T1 left join LeadBBS_User as T2 on T1.UserID=T2.ID where t1.boardid=" & GBL_board_ID & " and t1.RootID<" & rd & " order by t1.RootID DESC"
			Case Else: SQL = ""
		End Select
	End If

	If SQL <> "" Then
		Set Rs = con.ExeCute(SQL)
		GBL_DBNum = GBL_DBNum + 1
		If Not Rs.Eof Then
			Form_ParentID = cCur(Rs(0))
			'LMT_RootIDBak = Form_ParentID
			LMT_RootIDBak = cCur(Rs(11))
			LMT_RootID = cCur(Rs(1))
			Form_TopicType = Rs(2)
			Form_NeedValue = Rs(3)
			TParentID = cCur(Rs(4))
			ThisParentID = TParentID
			LMT_ChildNum = cCur(Rs(5))
			LMT_TopicName = Rs(6)
			'Rs(7) = cCur(Rs(7)) + 1
			Article_NotReplay = Rs(8)
			Topic_UserName = Rs(10) & ""
			RootIDBak = Rs(11)
			LMT_TopicTitleStyle = Rs(12)
			ac = Trim(Rs(16))
			If GetBinarybit(Rs(15),7) = 1 or submitflag <> "first" or request("repost") <> "1" Then
				'TmpContent = "此用户发言已经被管理员屏蔽，引用内容无效．"
			Else
				Select Case Rs(14)
					Case 0: TmpContent = GetReContent(ResumeCode(Rs(13)))
					Case 1: TmpContent = KillHTMLLabel(GetReContent(Left(Rs(13),500)))
					Case 2: 
							If LMT_DefaultEdit = 0 Then
								TmpContent = clearUbbcode(GetReContent(Rs(9)))
							Else
								TmpContent = clearUbbcode(GetReContent(Rs(9)))
							End If
					Case 3: 
							If LMT_DefaultEdit = 0 Then
								TmpContent = clearUbbcode(GetReContent(ResumeCode(Rs(13))))
							Else
								TmpContent = clearUbbcode(GetReContent(ResumeCode(Rs(13))))
							End If
							Form_HTMLFlag = 2
				End Select
				Do While Right(TmpContent,2) = VbCrLf
					TmpContent = Mid(TmpContent,1,len(TmpContent)-2)
				Loop
				If Len(TmpContent)>100 Then
					Form_Content = "[QUOTE][b]下面引用由[u]" & Topic_UserName & "[/u]发表的内容：[/b]" & VbCrLf & Left(TmpContent,100) & "...[/QUOTE]" & VbCrLf
				Else
					Form_Content = "[QUOTE][b]下面引用由[u]" & Topic_UserName & "[/u]发表的内容：[/b]" & VbCrLf & TmpContent & "[/QUOTE]" & VbCrLf
				End If
				ConvertFlag = 0
				If LMT_DefaultEdit = 0 Then Form_Content = UBB_Code(Form_Content)
				ConvertFlag = 1
			End If
			Form_RootMaxID = cCur(Rs(17))
			Form_RootMinID = cCur(Rs(18))
			Hits = cCur(Rs(7)) + 1
			Rs.Close
			Set Rs = Nothing
			If ac <> GBL_IPAddress or LMT_RefreshEnable = 1 Then
				Con.ExeCute("Update LeadBBS_Announce Set hits=" & Hits & ",VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
				Con.ExeCute("Update LeadBBS_Topic Set hits=" & Hits & ",VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
				GBL_DBNum = GBL_DBNum + 2
				If inStr(application(DEF_MasterCookies & "TopAncList"),"," & Form_ParentID & ",") Then
					UpdateAnnounceApplicationInfo Form_ParentID,5,Hits,0,0
				Else
					If inStr(application(DEF_MasterCookies & "TopAncList" & GBL_Board_BoardAssort),"," & Form_ParentID & ",") Then UpdateAnnounceApplicationInfo Form_ParentID,5,Hits,0,GBL_Board_BoardAssort
				End If
			End If
		Else
			Rs.Close
			Set Rs = Nothing
		End If
	End If

	If TParentID = -1 Then
		SQL = "Select top 1 T1.RootID,t1.TopicType,t1.NeedValue,t1.ParentID,t1.ChildNum,t1.Hits,t1.title,t1.NotReplay,t1.Content,t1.UserName,t1.RootIDBak,t1.BoardID,t1.TitleStyle,t1.PrintContent,t1.HtmlFlag,T2.UserLimit,T1.VisitIP,T1.RootMaxID,T1.RootMinID from LeadBBS_Announce as T1 left join LeadBBS_User as T2 on T1.UserID=T2.ID where T1.ID=" & Form_ParentID
		Set Rs = Con.ExeCute(SQL)
		GBL_DBNum = GBL_DBNum + 1
		If Rs.Eof Then
			Rs.Close
			Set Rs = Nothing
			GBL_CHK_TempStr = "错误,该主题不存在!<br>" & VbCrLf
			Exit Function
		Else
			If cCur(Rs(11)) <> GBL_board_ID Then
				Rs.Close
				Set Rs = Nothing
				GBL_CHK_TempStr = "错误,该主题不存在!<br>" & VbCrLf
				Exit Function
			Else
				LMT_RootID = Rs(0)
				'LMT_RootIDBak = Form_ParentID
				Form_TopicType = Rs(1)
				Form_NeedValue = Rs(2)
				TParentID = cCur(Rs(3))
				ThisParentID = TParentID
				LMT_ChildNum = cCur(Rs(4))
				'Rs(5) = cCur(Rs(5)) + 1
				LMT_TopicName = Rs(6)
				Article_NotReplay = Rs(7)
				RootIDBak = Rs(10)
				LMT_RootIDBak = cCur(RootIDBak)
				Topic_UserName = Rs(9)
				LMT_TopicTitleStyle = Rs(12)

				ac = Trim(Rs(16))
				If GetBinarybit(Rs(15),7) = 1 or submitflag <> "first" or request("repost") <> "1" Then
					'TmpContent = "此用户发言已经被管理员屏蔽，引用内容无效．"
				Else
					Select Case Rs(14)
						Case 0: TmpContent = GetReContent(ResumeCode(Rs(13)))
						Case 1: TmpContent = KillHTMLLabel(GetReContent(Left(Rs(13),500)))
						Case 2: 
								If LMT_DefaultEdit = 0 Then
									TmpContent = clearUbbcode(GetReContent(Rs(8)))
								Else
									TmpContent = clearUbbcode(GetReContent(Rs(8)))
								End If
						Case 3: 
								If LMT_DefaultEdit = 0 Then
									TmpContent = clearUbbcode(GetReContent(ResumeCode(Rs(13))))
								Else
									TmpContent = clearUbbcode(GetReContent(ResumeCode(Rs(13))))
								End If
								Form_HTMLFlag = 2
					End Select
					Do While Right(TmpContent,2) = VbCrLf
						TmpContent = Mid(TmpContent,1,len(TmpContent)-2)
					Loop
					If submitflag = "first" and request("repost") = "1" Then
						If Len(TmpContent)>100 Then
							Form_Content = "[QUOTE][b]下面引用由[u]" & Topic_UserName & "[/u]发表的内容：[/b]" & VbCrLf & VbCrLf & Left(TmpContent,100) & "...[/QUOTE]" & VbCrLf
						Else
							Form_Content = "[QUOTE][b]下面引用由[u]" & Topic_UserName & "[/u]发表的内容：[/b]" & VbCrLf & VbCrLf & TmpContent & "[/QUOTE]" & VbCrLf
						End If
						ConvertFlag = 0
						If LMT_DefaultEdit = 0 Then Form_Content = UBB_Code(Form_Content)
						ConvertFlag = 1
					End If
				End If
				Form_RootMaxID = cCur(Rs(17))
				Form_RootMinID = cCur(Rs(18))
				Hits = cCur(Rs(5)) + 1
				Rs.Close
				Set Rs = Nothing
				If ac <> GBL_IPAddress or LMT_RefreshEnable = 1 Then
					Con.ExeCute("Update LeadBBS_Announce Set hits=hits+1,VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
					Con.ExeCute("Update LeadBBS_Topic Set hits=hits+1,VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
					GBL_DBNum = GBL_DBNum + 2
					If TParentID = 0 and inStr(application(DEF_MasterCookies & "TopAncList"),"," & Form_ParentID & ",") Then
						UpdateAnnounceApplicationInfo Form_ParentID,5,Hits,0,0
					Else
						If TParentID = 0 and inStr(application(DEF_MasterCookies & "TopAncList" & GBL_Board_BoardAssort),"," & Form_ParentID & ",") Then UpdateAnnounceApplicationInfo Form_ParentID,5,Hits,0,GBL_Board_BoardAssort
					End If
				End If
			End If
		End If
	End If

	If TParentID > 0 Then
		SQL = "Select top 1 Title,Hits,ChildNum,ID,TitleStyle,NotReplay,ID,RootID,RootMaxID,RootMinID,UserName,TopicType,NeedValue from LeadBBS_Topic where ID=" & RootIDBak
		Set Rs = Con.ExeCute(SQL)
		GBL_DBNum = GBL_DBNum + 1
		If Rs.Eof Then
			Rs.Close
			Set Rs = Nothing
			GBL_CHK_TempStr = "错误,该主题已经删除!<br>" & VbCrLf
			Exit Function
		Else
			LMT_TopicName = Rs(0)
			LMT_ChildNum = cCur(Rs(2))
			LMT_RootIDBak = Rs(6)
			LMT_TopicTitleStyle = Rs(4)
			If Article_NotReplay = 0 Then Article_NotReplay = Rs(5)
			LMT_RootID = cCur(Rs(7))
			Form_RootMaxID = cCur(Rs(8))
			Form_RootMinID = cCur(Rs(9))
			Topic_UserName = Rs(10)
			Form_TopicType = Rs(11)
			Form_NeedValue = Rs(12)
			Rs.Close
			Set Rs = Nothing
		End If
	End If

	If Form_TopicType > 0 and Article_NotReplay = 0 and Form_TopicType <> 80 Then
		Form_NeedValue = cCur(Form_NeedValue)
		Select case Form_TopicType
			Case 2:
				If GBL_CHK_User <> "" Then
					If GBL_BoardMasterFlag < 5 Then
						Article_NotReplay = 1
						If submitflag <> "" Then GBL_CHK_TempStr = "错误,只有本版版主才能回复此帖!<br>" & VbCrLf
					End If
				Else
					Article_NotReplay = 1
				End If
			Case 4:
				If GBL_BoardMasterFlag < 4 Then
					Article_NotReplay = 1
					If submitflag <> "" Then GBL_CHK_TempStr = "错误,只有版主才能回复此帖!<br>" & VbCrLf
				End If
			Case 6:
				If GBL_CHK_User = "" or GetBinarybit(GBL_CHK_UserLimit,2) <> 1 Then
					Article_NotReplay = 1
					If submitflag <> "" Then GBL_CHK_TempStr = "错误,只有认证会员才能回复此帖!<br>" & VbCrLf
				End If
			Case 51:
				If GBL_CHK_Points < Form_NeedValue Then
					Article_NotReplay = 1
					If submitflag <> "" Then GBL_CHK_TempStr = "错误,需要" & DEF_PointsName & "" & Form_NeedValue & "以上才能回复此帖!<br>" & VbCrLf
				End If
			Case 53:
				If GBL_CHK_OnlineTime < Form_NeedValue*60 Then
					Article_NotReplay = 1
					If submitflag <> "" Then GBL_CHK_TempStr = "错误,需要经验" & Form_NeedValue & "以上才能回复此帖!<br>" & VbCrLf
				End If
			Case 55:
					If Form_NeedValue > 0 and Request("submitflag") <> "" Then
						If Form_NeedValue <> GBL_UserID and GBL_CHK_User <> Topic_UserName Then
							Article_NotReplay = 1
							GBL_CHK_TempStr = "此帖只允许发帖人和接收人回复"
						End If
					End If
		End Select
	End If

	Dim RootTopicNeedValue
	If Form_TopicType > 0 And Form_TopicType <> 80 and Request("submitflag") = "first" and ThisParentID = 0 and request("repost") = "1" Then
		RootTopicNeedValue = cCur(Form_NeedValue)
		RootTopicType = Form_TopicType
		Select case RootTopicType
			Case 1:
				If GBL_CHK_User <> "" Then
					If GBL_BoardMasterFlag < 5 Then
						GBL_CHK_TempStr = "此帖只有本版版主才能引用回复"
					End If
				Else
					GBL_CHK_TempStr = "此帖只有本版版主才能引用回复"
				End If
			Case 3:
				If GBL_BoardMasterFlag < 4 Then
					GBL_CHK_TempStr = "此帖只有版主才能引用回复"
				End If
			Case 5:
				If GBL_CHK_User = "" or GetBinarybit(GBL_CHK_UserLimit,2) <> 1 Then
					GBL_CHK_TempStr = "此帖只有认证会员才能引用回复"
				End If
			Case 7,54:
				If submitflag = "first" and request("repost") = "1" Then
					Article_NotReplay = 1
					GBL_CHK_TempStr = "错误,此帖不能引用回复!<br>" & VbCrLf
				End If
			Case 50:
				If GBL_CHK_Points < RootTopicNeedValue Then
					GBL_CHK_TempStr = "此帖需要" & DEF_PointsName & "" & RootTopicNeedValue & "才能引用回复"
				End If
			Case 52:
				If GBL_CHK_OnlineTime < RootTopicNeedValue*60 Then
					GBL_CHK_TempStr = "此帖需要经验" & RootTopicNeedValue & "才能引用回复"
				End If
			Case 55:
					If Form_NeedValue > 0 Then
						If Form_NeedValue <> GBL_UserID and GBL_CHK_User <> Topic_UserName Then
							Article_NotReplay = 1
							GBL_CHK_TempStr = "此帖只允许发帖人和接收人回复"
						End If
					End If
		End Select
	End If

End Function

Function UpdateUserLevel(UserID)

	Dim Temp_N,UserLevel,Points,OnlineTime,Save_UserLevel
	Dim Rs
	Set Rs = Con.ExeCute("Select top 1 UserLevel,AnnounceNum2,OnlineTime from LeadBBS_User where id=" & UserID)
	GBL_DBNum = GBL_DBNum + 1
	If Rs.Eof Then
		Rs.Close
		Set Rs = Nothing
		Exit Function
	End If
	UserLevel = Rs(0)
	Save_UserLevel = UserLevel
	Points = cCur(Rs(1))
	OnlineTime = cCur(Rs(2))
	Rs.Close
	Set Rs = Nothing

	For Temp_N = 0 To DEF_UserLevelNum
		'自动重新计算等级
		'If Points >= DEF_UserLevelPoints(Temp_N) Then UserLevel = Temp_N
		If Points >= DEF_UserLevelPoints(Temp_N) and Temp_N >= UserLevel Then UserLevel = Temp_N
	Next

	Randomize
	Rs = Fix(Rnd*1314)+1
	If Rs = 1314 Then
		Rs = 1
	Else
		Rs = 0
	End If

	If Save_UserLevel <> UserLevel or Rs = 1 Then
		con.ExeCute ("Update LeadBBS_User set UserLevel=" & UserLevel & ",CharmPoint=CharmPoint+" & Rs & " where id=" & UserID)
		GBL_DBNum = GBL_DBNum + 1
		UpdateSessionValue 15,Rs,1
	End If

End Function

Function UpdateBoardAnnounceNum(BoardList,TopicNum,AnnounceNum,TodayAnnounce,GoodNum,LastWriter,LastWriteTime,LastAnnounceID,LastTopicName)

	Dim SafeFlag
	SafeFlag = 0
	If GBL_Board_ForumPass <> "" or GetBinarybit(GBL_Board_BoardLimit,2) = 1 or GetBinarybit(GBL_Board_BoardLimit,7) = 1 Then SafeFlag = 1
	Dim SQL,N
	If BoardList = "" or (TopicNum = 0 and AnnounceNum = 0 and TodayAnnounce = 0 and GoodNum = 0) Then Exit Function
	SQL = "Update LeadBBS_Boards Set AnnounceNum=AnnounceNum+" & AnnounceNum & ",AnnounceNum_All=AnnounceNum_All+" & AnnounceNum
	If TopicNum <> 0 Then SQL = SQL & ",TopicNum=TopicNum+" & TopicNum
	If TopicNum <> 0 Then SQL = SQL & ",TopicNum_All=TopicNum_All+" & TopicNum
	If TodayAnnounce <> 0 Then  SQL = SQL & ",TodayAnnounce=TodayAnnounce+" & TodayAnnounce
	If TodayAnnounce <> 0 Then  SQL = SQL & ",TodayAnnounce_All=TodayAnnounce_All+" & TodayAnnounce
	If GoodNum <> 0 Then SQL = SQL & ",GoodNum=GoodNum+" & GoodNum
	If GoodNum <> 0 Then SQL = SQL & ",GoodNum_All=GoodNum_All+" & GoodNum
	If LastWriter <> "" Then SQL = SQL & ",LastWriter='" & Replace(LastWriter,"'","''") & "'"
	If cCur(LastWriteTime) > 0 Then SQL = SQL & ",LastWriteTime=" & LastWriteTime
	If LastTopicName <> "" Then SQL = SQL & ",LastTopicName='" & Replace(LastTopicName,"'","''") & "'"
	If SafeFlag = 1 or inStr(BoardList,",") = False Then
		If cCur(LastAnnounceID) > 0 Then SQL = SQL & ",LastAnnounceID=" & LastAnnounceID
		SQL = SQL & " where BoardID=" & GBL_Board_ID
		Con.ExeCute(SQL)
		GBL_DBNum = GBL_DBNum + 1
	Else
		If cCur(LastAnnounceID) > 0 Then SQL = SQL & ",LastAnnounceID=0"
		SQL = SQL & " where BoardID in(" & BoardList & ")"
		Con.ExeCute(SQL)
		Con.ExeCute("Update LeadBBS_Boards Set LastAnnounceID=" & LastAnnounceID & " where BoardID=" & GBL_Board_ID)
		GBL_DBNum = GBL_DBNum + 2
	End If
	BoardList = Split(BoardList,",")
	SQL = Ubound(BoardList,1)
	Dim Temp
	For N = 0 To SQL
		Temp = Application(DEF_MasterCookies & "BoardInfo" & BoardList(N))
		If isArray(Temp) = False Then
			ReloadBoardInfo(BoardList(N))
			Temp = Application(DEF_MasterCookies & "BoardInfo" & BoardList(N))
		End If
		If isArray(Temp) = True Then
			If (SafeFlag = 1 and GBL_Board_ID = cCur(BoardList(N))) or SafeFlag = 0 Then
				If TopicNum <> 0 Then
					UpdateBoardApplicationInfo BoardList(N),cCur(Temp(5,0))+TopicNum,5
					UpdateBoardApplicationInfo BoardList(N),cCur(Temp(29,0))+TopicNum,29
				End If
				If AnnounceNum <> 0 Then
					UpdateBoardApplicationInfo BoardList(N),cCur(Temp(6,0))+AnnounceNum,6
					UpdateBoardApplicationInfo BoardList(N),cCur(Temp(30,0))+AnnounceNum,30
				End If
				If TodayAnnounce <> 0 Then
					UpdateBoardApplicationInfo BoardList(N),cCur(Temp(18,0))+TodayAnnounce,18
					UpdateBoardApplicationInfo BoardList(N),cCur(Temp(31,0))+TodayAnnounce,31
				End If
				If GoodNum <> 0 Then
					UpdateBoardApplicationInfo BoardList(N),cCur(Temp(13,0))+GoodNum,13
					UpdateBoardApplicationInfo BoardList(N),cCur(Temp(32,0))+GoodNum,32
				End If
	
				If LastWriter <> "" Then UpdateBoardApplicationInfo BoardList(N),LastWriter,3
				If cCur(LastWriteTime) > 0 Then UpdateBoardApplicationInfo BoardList(N),Form_LastTime,4
				If SafeFlag = 1 or SQL = 0 or GBL_Board_ID = cCur(BoardList(N)) Then
					If cCur(LastAnnounceID) > 0 Then UpdateBoardApplicationInfo BoardList(N),LastAnnounceID,19
				Else
					If cCur(LastAnnounceID) > 0 Then UpdateBoardApplicationInfo BoardList(N),0,19
				End If
				If LastTopicName <> "" Then UpdateBoardApplicationInfo BoardList(N),LastTopicName,20
			End If
		End If
	Next
	'28,T1.ParentBoardStr,29.TopicNum_All,30.AnnounceNum_All,31.TodayAnnounce_All,32.GoodNum_All

End Function

Function CheckRndNumber

	If DEF_EnableAttestNumber = 0 Then
		CheckRndNumber = 1
		Exit Function
	End If

	Dim RndNumber
	RndNumber = Left(Session(DEF_MasterCookies & "RndNum") & "",4)
	If RndNumber = "" or isNumeric(RndNumber) = 0 Then
		'RndNumber = 0
		Randomize
		RndNumber = Fix(Rnd*9999)+1
		Session(DEF_MasterCookies & "RndNum") = RndNumber
	End If
	RndNumber = cCur(RndNumber)
	
	Dim ForumNumber
	ForumNumber = Left(Request.Form("ForumNumber"),4)
	If isNumeric(ForumNumber) = False Then ForumNumber = 0
	ForumNumber = Fix(cCur(ForumNumber))
	If RndNumber = ForumNumber and RndNumber > 0 Then
		CheckRndNumber = 1
	Else
		CheckRndNumber = 0
	End If
	Randomize
	Session(DEF_MasterCookies & "RndNum") = Fix(Rnd*9999)+1

End Function

Function DisplayLeadBBSEditor1
%>
<style type="text/css">
.Ico
{
	HEIGHT: 22px;
	WIDTH: 22px;
	CURSOR: hand
}
</style>

<Script Language=Javascript>
var BrowserInfo = new Object() ;
BrowserInfo.MajorVer = navigator.appVersion.match(/MSIE (.)/)[1] ;
BrowserInfo.MinorVer = navigator.appVersion.match(/MSIE .\.(.)/)[1] ;
BrowserInfo.IsIE55OrMore = BrowserInfo.MajorVer >= 6 || ( BrowserInfo.MajorVer >= 5 && BrowserInfo.MinorVer >= 5 ) ;

var btnDatas = new Array();

var bInitialized = false;
function document.onreadystatechange()
{
	if (document.readyState!="complete") return;
	if (bInitialized) return;
	bInitialized = true;

	var i, s, curr;

	if (LeadBBSFm.ContentFlag.value=="0") { 
		LeadBBSFm.ContentEdit.value = objContent.value;
		LeadBBSFm.ContentLoad.value = objContent.value;
		LeadBBSFm.ContentFlag.value = "1";
	}

	LEADEDT.document.designMode="On";
	LEADEDT.document.open();
	LEADEDT.document.write(bodyTag+LeadBBSFm.ContentEdit.value)
	LEADEDT.document.close();
	setLinkedField() ;
	LEADEDT.document.body.onpaste = onPaste ;
	LEADEDT.focus();
}

function setLinkedField() {
	if (! objContent) return ;
	var oForm = objContent.form ;
	if (!oForm) return ;
	oForm.attachEvent("onsubmit", AttachSubmit) ;
	if (! oForm.submitEditor) oForm.submitEditor = new Array() ;
	oForm.submitEditor[oForm.submitEditor.length] = AttachSubmit ;
	if (! oForm.originalSubmit) {
		oForm.originalSubmit = oForm.submit ;
		oForm.submit = function() {
			if (this.submitEditor) {
				for (var i = 0 ; i < this.submitEditor.length ; i++) {
					this.submitEditor[i]() ;
				}
			}
			this.originalSubmit() ;
		}
	}
	oForm.attachEvent("onreset", AttachReset) ;
	if (! oForm.resetEditor) oForm.resetEditor = new Array() ;
	oForm.resetEditor[oForm.resetEditor.length] = AttachReset ;
	if (! oForm.originalReset) {
		oForm.originalReset = oForm.reset ;
		oForm.reset = function() {
			if (this.resetEditor) {
				for (var i = 0 ; i < this.resetEditor.length ; i++) {
					this.resetEditor[i]() ;
				}
			}
			this.originalReset() ;
		}
	}
}

function AttachSubmit() {
	if (!bEditMode) setMode('EDIT');

	LeadBBSFm.ContentEdit.value = getHTML();
	objContent.value = LeadBBSFm.ContentEdit.value;

	var oForm = objContent.form ;
	if (!oForm) return ;

	for (var i=1;i<document.getElementsByName(sContentName).length;i++) {
		document.getElementsByName(sContentName)[i].value = "";
	}
} 

function AttachReset() {
	if (!bEditMode) setMode('EDIT');
	if(bEditMode){
		LEADEDT.document.body.innerHTML = LeadBBSFm.ContentLoad.value;
	}else{
		LEADEDT.document.body.innerText = LeadBBSFm.ContentLoad.value;
	}
}

function onPaste() {
	if (config.AutoDetectPasteFromWord && BrowserInfo.IsIE55OrMore) {
		var sHTML = GetClipboardHTML() ;
		var re = /<\w[^>]* class="?MsoNormal"?/gi ;
		if ( re.test( sHTML ) )
		{
			if ( confirm( "你要粘贴的内容好象是从Word中拷出来的，是否要先清除Word格式再粘贴？" ) )
			{
				cleanAndPaste( sHTML ) ;
				return false ;
			}
		}
	}
	else
		return true ;
}

function GetClipboardHTML() {
	var oDiv = document.getElementById("divTemp")
	oDiv.innerHTML = "" ;

	var oTextRange = document.body.createTextRange() ;
	oTextRange.moveToElementText(oDiv) ;
	oTextRange.execCommand("Paste") ;
	
	var sData = oDiv.innerHTML ;
	oDiv.innerHTML = "" ;
	
	return sData ;
}

function cleanAndPaste( html ) {
	html = html.replace(/<\/?SPAN[^>]*>/gi, "" );
	html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
	html = html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ;
	html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
	html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
	html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
	html = html.replace(/&nbsp;/, " " );
	var re = new RegExp("(<P)([^>]*>.*?)(<\/P>)","gi") ;	// Different because of a IE 5.0 error
	html = html.replace( re, "<span$2</span>" ) ;
	insertHTML( html ) ;
}

function insertHTML(html) {
	if (!validateMode()) return;
	if (LEADEDT.document.selection.type.toLowerCase() != "none")
		LEADEDT.document.selection.clear() ;
	LEADEDT.document.selection.createRange().pasteHTML(html) ; 
}

function getHTML() {
	if(bEditMode){
		return LEADEDT.document.body.innerHTML;
	}else{
		return LEADEDT.document.body.innerText;
	}
}

function PasteWord(){
	if (!validateMode()) return;
	LEADEDT.focus();
	if (BrowserInfo.IsIE55OrMore)
		cleanAndPaste( GetClipboardHTML() ) ;
	else if ( confirm( "此功能要求IE5.5版本以上，你当前的浏览器不支持，是否按常规粘贴进行？" ) )
		format("paste") ;
	LEADEDT.focus();
}

function PasteText(){
	if (!validateMode()) return;
	LEADEDT.focus();
	var sText = HTMLEncode( clipboardData.getData("Text") ) ;
	insertHTML(sText);
	LEADEDT.focus();
}

function validateMode() {
	if (bEditMode) return true;
	alert("需转换为编辑状态后再使用此功能！");
	LEADEDT.focus();
	return false;
}

function format(what,opt) {
	if (!validateMode()) return;
	LEADEDT.focus();
	if (opt=="RemoveFormat") {
		what=opt;
		opt=null;
	}

	if (opt==null) LEADEDT.document.execCommand(what);
	else LEADEDT.document.execCommand(what,"",opt);
	
	LEADEDT.focus();
}

function setMode(NewMode){
	document.onreadystatechange();
	if (NewMode!=sCurrMode){
		document.all["LEADEDT_CODE"].style.display = "none";
		document.all["LEADEDT_EDIT"].style.display = "none";
		document.all["LEADEDT_VIEW"].style.display = "none";
		document.all["LEADEDT_"+NewMode].style.display = "block";
		switch (NewMode){
		case "CODE":
			if (LEADEDT.document.designMode=="On") {
				LEADEDT.document.body.innerText=LEADEDT.document.body.innerHTML;
			}else {
				var temp=LEADEDT.document.body.innerHTML;
				LEADEDT.document.designMode="On";
				LEADEDT.document.open();
				LEADEDT.document.write(bodyTag);
				LEADEDT.document.body.innerText=temp;
				LEADEDT.document.close();
				temp=null;
			}
			bEditMode=false;
			break;
		case "EDIT":
			LEADEDT.document.body.disabled=false;
			if (LEADEDT.document.designMode=="On") {
				LEADEDT.document.body.innerHTML=LEADEDT.document.body.innerText;
			}else {
				var temp=LEADEDT.document.body.innerHTML;
				LEADEDT.document.designMode="On";
				LEADEDT.document.open();
				LEADEDT.document.write(bodyTag);
				LEADEDT.document.body.innerHTML=temp;
				LEADEDT.document.close();
				temp=null;
			}
			bEditMode=true;
			break;
		case "VIEW":
			var temp;
			if(bEditMode){
				temp = LEADEDT.document.body.innerHTML;
			}else{
				temp = LEADEDT.document.body.innerText;
			}
			LEADEDT.document.designMode="off";
			LEADEDT.document.open();
			LEADEDT.document.write(bodyTag+temp);
			LEADEDT.document.close();
			bEditMode=false;
			break;
		}
		sCurrMode=NewMode;
	}
	LEADEDT.focus();
}

function ShowDialog(url, width, height, optValidate) {
	if (optValidate) {
		if (!validateMode()) return;
	}
	LEADEDT.focus();
	var arr = showModalDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:no;status:no");
	LEADEDT.focus();
}

function HTMLEncode(text){
	text = text.replace(/&/g, "&amp;") ;
	text = text.replace(/"/g, "&quot;") ;
	text = text.replace(/</g, "&lt;") ;
	text = text.replace(/>/g, "&gt;") ;
	text = text.replace(/'/g, "&#146;") ;
	text = text.replace(/\ /g,"&nbsp;");
	text = text.replace(/\n/g,"<br>");
	text = text.replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;");
	return text;
}

function insert(what) {
	if (!validateMode()) return;
	LEADEDT.focus();
	var sel = LEADEDT.document.selection.createRange();

	switch(what){
	case "nowdate":
		var d = new Date();
		insertHTML(d.toLocaleDateString());
		break;
	case "nowtime":
		var d = new Date();
		insertHTML(d.toLocaleTimeString());
		break;
	case "br":
		insertHTML("<br>")
		break;
	case "code":
		insertHTML('[CODE]'+HTMLEncode(sel.text)+'[/CODE]');
		break;
	case "quote":
		insertHTML('[QUOTE]'+HTMLEncode(sel.text)+'[/QUOTE]');
		break;
	case "fly":
		insertHTML('[FLY]'+HTMLEncode(sel.text)+'[/FLY]');
		break;
	default:
		insertHTML("[face=" + what + ']' + sel.text + "[/face]");
		break;
	}
	sel=null;
}

var bEditMode=true;
var sCurrMode = "EDIT";
var bodyTag = "<head><style type=\"text/css\">body,a,table,div,span,td,th,input,select{font-size:9pt;font-family:\"宋体,Verdana,Arial\";Color:#000000;}</style><meta http-equiv=Content-Type content=\"text/html; charset=gb2312\"></head><BODY bgcolor=\"#FFFFFF\" MONOSPACE>" ;
var sContentName = "Form_Content" ;
var objContent = document.getElementsByName(sContentName)[0];

var config = new Object() ;
config.Version = "1.1.3" ;
config.ReleaseDate = "2003-12-11" ;
config.StyleName = "standard";
config.AutoDetectPasteFromWord = true;

function ds(a,b,c)
{
	document.write("<td width=23 align=center><img src=../images/null.gif width=23 height=2<br><span TITLE=\"" + a + "\" onclick=\"" + b + "\" class=GMI><IMG SRC=Edit/pic/" + c + ".gif width=22 height=22 class=Ico onclick=\"this.style.backgroundColor='#AAAAAA';\" onmouseover=\"this.style.backgroundColor='#CCCCCC';\" onmouseout=\"this.style.backgroundColor='';\"></span></td>");
}
function dt()
{
	document.write("<td><img src=edit/pic/line2.gif width=10 height=16 align=absmiddle></td><td>");
}
</Script>
<table border=0 cellpadding=0 cellspacing=0 width='500' HEIGHT='350' id=TB name=TB><tr><td>
<table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%'>
<tr><td>
<table border=0 cellpadding=0 cellspacing=0 style="BORDER-BOTTOM: #808080 1px solid;" width=100%>
<tr height=29><td>
<table border=0 cellpadding=0 cellspacing=0><tr height=29><td><img src=../images/null.gif width=2 height=2></td>
<td><SELECT onchange="format('FormatBlock',this[this.selectedIndex].value);this.selectedIndex=0" class=TBBG9>
	<option selected>段落样式
	<option value="&lt;P&gt;">普通
	<option value="&lt;ul&gt;">目录列表
	<option value="&lt;PRE&gt;">已编排格式
</SELECT></td>
<td><SELECT onchange="insert(this[this.selectedIndex].value);this.selectedIndex=0" class=TBBG9>
	<option selected>字体
	<option value="宋体">宋体
	<option value="黑体">黑体
	<option value="楷体_GB2312">楷体
	<option value="仿宋_GB2312">仿宋
	<option value="隶书">隶书
	<option value="幼圆">幼圆
	<option value="Arial">Arial
	<option value="Arial Black">Arial Black
	<option value="Arial Narrow">Arial Narrow
	<option value="Brush Script	MT">Brush Script MT
	<option value="Century Gothic">Century Gothic
	<option value="Comic Sans MS">Comic Sans MS
	<option value="Courier">Courier
	<option value="Courier New">Courier New
	<option value="MS Sans Serif">MS Sans Serif
	<option value="Script">Script
	<option value="System">System
	<option value="Times New Roman">Times New Roman
	<option value="Verdana">Verdana
	<option value="Wide Latin">Wide Latin
	<option value="Wingdings">Wingdings
</SELECT></td>
<td><SELECT onchange="format('fontsize',this[this.selectedIndex].value);this.selectedIndex=0" class=TBBG9>
	<option selected>字号
	<option value="7">一号
	<option value="6">二号
	<option value="5">三号
	<option value="4">四号
	<option value="3">五号
	<option value="2">六号
	<option value="1">七号
</SELECT></td>
<td><img src=../images/null.gif width=8 height=2></td>
<Script Language=Javascript>
ds("剪切","format('cut')","cut");
ds("复制","format('copy')","copy");
ds("常规粘贴","format('paste')","paste");
ds("纯文本粘贴","PasteText()","pastetext");
ds("从Word中粘贴","PasteWord()","pasteword");
ds("删除","format('delete')","delete");
ds("删除文字格式","format('RemoveFormat')","RemoveFormat");
dt();
ds("撤消","format('undo')","undo");
ds("恢复","format('redo')","redo");
</script>
</td></tr></table></td></tr></table>
<table border=0 cellpadding=0 cellspacing=0 style="BORDER-TOP:	#F8FCF8	1px solid;BORDER-BOTTOM: #808080 1px solid;" width=100%>
<tr height=29>
<td>
<table border=0 cellpadding=0 cellspacing=0><tr height=29><td><img src=../images/null.gif width=2 height=2></td>
<Script Language=Javascript>
ds("粗体","format('bold')","bold");
ds("斜体","format('italic')","italic");
ds("下划线","format('underline')","underline");
ds("中划线","format('StrikeThrough')","strikethrough");
dt();
ds("左对齐","format('justifyleft')","JustifyLeft");
ds("居中对齐","format('justifycenter')","JustifyCenter");
ds("右对齐","format('justifyright')","JustifyRight");
ds("两端对齐","format('JustifyFull')","JustifyFull");
dt();
ds("编号","format('insertorderedlist')","insertOLlist");
ds("项目符号","format('insertunorderedlist')","insertULlist");
dt();
ds("上标","format('superscript')","sup");
ds("下标","format('subscript')","sub");
dt();
ds("字体颜色","ShowDialog('edit/selcolor.htm?action=forecolor', 280, 250, true)","forecolor");
ds("字体背景颜色","ShowDialog('edit/selcolor.htm?action=backcolor', 280, 250, true)","backcolor");
ds("文字飞扬","insert('fly')","fly");
ds("文字发光","ShowDialog('edit/glow.htm', 350, 120, true)","glow");
ds("文字阴影","ShowDialog('edit/shadow.htm', 350, 120, true)","shadow");
dt();
ds("全部选中","format('SelectAll')","selectAll");
ds("取消选择","format('Unselect')","unselect");
</script>
</tr></table></td></tr></table>
<table border=0 cellpadding=0 cellspacing=0 style="BORDER-TOP:	#F8FCF8	1px solid;" width=100%>
<tr height=29><td>
<table border=0 cellpadding=0 cellspacing=0><tr height=29><td><img src=../images/null.gif width=2 height=2></td>
<Script Language=Javascript>
ds("插入或修改表格","ShowDialog('edit/table.htm', 350, 320, true)","table");
ds("插入或修改栏目框","ShowDialog('edit/fieldset.htm', 350, 170, true)","fieldset");
ds("插入水平尺","format('InsertHorizontalRule')","InsertHRule");
ds("插入或修改字幕","ShowDialog('edit/marquee.htm', 395, 120, true)","Marquee");
dt();
ds("插入或修改超级链接","format('CreateLink')","CreateLink");
ds("取消超级链接或标签","format('UnLink')","Unlink");
dt();
ds("插入或修改图片","ShowDialog('edit/img.htm', 350, 175, true)","img");
ds("插入Flash动画","ShowDialog('edit/flash.htm', 350, 170, true)","flash");
ds("插入媒体文件","ShowDialog('edit/media.htm', 350, 170, true)","Media");
ds("插入Real媒体文件","ShowDialog('edit/real.htm', 350, 170, true)","rm");
dt();
ds("插入特殊字符","ShowDialog('edit/symbol.htm', 350, 220, true)","symbol");
ds("插入表情图标","ShowDialog('emot.asp', 300, 180, true)","emot");
dt();
ds("引用样式","insert('quote')","quote");
ds("代码样式","insert('code')","code");
dt();
ds("插入当前日期","insert('nowdate')","date");
ds("插入当前时间","insert('nowtime')","time");
ds("插入换行符","insert('br')","br");
ds("插入段落","format('InsertParagraph')","p");
ds("检查长度","alert('发表的内容为'+LEADEDT.document.body.innerHTML.length+'文字，最长允许<%=DEF_MaxTextLength%>字')","length");
</script>
</tr></table>
</td></tr></table>

</td></tr>
<tr><td height='100%'>
	<table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%'>
	<tr><td height='100%'>
	<input type="hidden" name=ContentEdit value="">
	<input type="hidden" name=ContentLoad value="">
	<input type="hidden" name=ContentFlag value="0">
	<iframe ID="LEADEDT" MARGINHEIGHT="1" MARGINWIDTH="1" width="100%" height="100%" scrolling="auto"> 
	</iframe>
	</td></tr>
	</table>

</td></tr>


<tr><td height=20 valign=top>
	<TABLE border="0" cellPadding="0" cellSpacing="0" width="100%">
	<TR>

	<td align="left" valign="top" id='LEADEDT_CODE' style="display:none">
	<map name='LEADEDT_Map1'>
	<area shape="polygon" coords="50, 1, 46, 7, 50, 14, 90, 14, 95, 2" alt="编辑状态" onclick="setMode('EDIT')">
	<area shape="polygon" coords="128, 13, 134, 0, 96, 0, 93, 10, 96, 14" alt="预览状态" onclick="setMode('VIEW')">
	</map> <img SRC="Edit/pic/modecode.gif" style="cursor:hand" height="15" width="134" usemap='#LEADEDT_Map1' border="0"></td>

	<td align="left" valign="top" id='LEADEDT_EDIT'>
	<map name='LEADEDT_Map2'>
	<area shape="polygon" coords="5, 3, 12, 14, 43, 14, 49, 6, 43, 0" alt="代码状态" onclick="setMode('CODE')">
	<area shape="polygon" coords="97, 0, 94, 7, 98, 14, 127, 14, 134, 0" alt="预览状态" onclick="setMode('VIEW')">
	</map> <img SRC="Edit/pic/modeedit.gif" style="cursor:hand" height="15" width="134" usemap='#LEADEDT_Map2' border="0"></td>

	<td align="left" valign="top" id='LEADEDT_VIEW' style="display:none"><map name='LEADEDT_Map3'>
	<area shape="polygon" coords="3, 2, 10, 14, 41, 14, 50, 0" alt="代码状态" onclick="setMode('CODE')">
	<area shape="polygon" coords="87, 14, 91, 5, 87, 0, 50, 0, 46, 9, 49, 14" alt="编辑状态" onclick="setMode('EDIT')">
	</map> <img SRC="Edit/pic/modepreview.gif" style="cursor:hand" height="15" width="134" usemap='#LEADEDT_Map3' border="0"></td>
	<td align=right>
		<span style="cursor:hand" onclick="if(TB.height<1000)TB.height=parseInt(TB.height)+100;" title=增长编缉区>＋</span>
		<span style="cursor:hand" onclick="if(TB.height>300)TB.height=parseInt(TB.height)-100;" title=缩短编缉区><b>-</b></span>
		<span style="cursor:hand" onclick="TB.height=350;" title=恢复编缉区><b>=</b></span>&nbsp;</td>
	</TR>
	</Table>

</td></tr>


</table>
</td></tr></table>
<span id="divTemp" style="VISIBILITY: hidden; OVERFLOW: hidden; POSITION: absolute; WIDTH: 1px; HEIGHT: 1px"></span>
<%
End Function

sub Main

	initDatabase
	CheckisBoardMaster
	GBL_CHK_TempStr = ""
	Form_VoteFlag = Request("VoteFlag")
	GetRequestValue
	If Form_parentID > 0 Then Form_VoteFlag = ""
	GetTopicInfo
	'GBL_CHK_TempStr = ""

	If LMT_TopicTitleStyle >= 60 and GBL_BoardMasterFlag < 4 Then
		LMT_TopicNameNoHTML = "帖子等待审核中..."
		LMT_TopicName = "<font color=gray class=GrayFont>帖子等待审核中...</font>"
		'LMT_TopicTitleStyle = 1
		Article_NotReplay = 1
	Else
		If LMT_TopicTitleStyle = 1 Then
			LMT_TopicNameNoHTML = KillHTMLLabel(LMT_TopicName)
		Else
			LMT_TopicNameNoHTML = htmlencode(LMT_TopicName)
		End If
	End If
	LMT_TopicNameNoHTML_Temp = LMT_TopicNameNoHTML
	
	If strLength(LMT_TopicNameNoHTML_Temp)>DEF_BBS_DisplayTopicLength-6 Then
		LMT_TopicNameNoHTML_Temp = htmlencode(LeftTrue(LMT_TopicNameNoHTML_Temp,DEF_BBS_DisplayTopicLength-9)) & "..."
	Else
		LMT_TopicNameNoHTML_Temp = htmlencode(LMT_TopicNameNoHTML_Temp)
	End if
	If Request("submitflag")<>"" and Form_parentID > 0 Then
		CheckAccessLimit_TimeLimit
		LMT_TopicNameNoHTML_Temp = "回复：" & LMT_TopicNameNoHTML_Temp
		BBS_SiteHead DEF_SiteNameString & " " & DEF_BBS_Name,GBL_board_ID," &gt;&gt; 回复帖子"
	Else
		If LMT_TopicNameNoHTML_Temp = "" Then
			CheckAccessLimit_TimeLimit
			If Form_VoteFlag <> "" and Form_ParentID = 0 Then
				LMT_TopicNameNoHTML_Temp = "发表新投票"
			Else
				LMT_TopicNameNoHTML_Temp = "发表新帖子"
			End If
			BBS_SiteHead DEF_SiteNameString & " " & DEF_BBS_Name,GBL_board_ID," &gt;&gt; " & LMT_TopicNameNoHTML_Temp
		Else
			BBS_SiteHead DEF_SiteNameString & " " & DEF_BBS_Name,GBL_board_ID," &gt;&gt; 查看帖子"
		End If
	End If

	CheckAccessLimit
	If Request("Submitflag") <> "" or Form_parentID = 0 Then
		If Form_ParentID = 0 Then
			CheckBoardAnnounceLimit
		Else
			CheckBoardReAnnounceLimit
		End If
		CheckUserAnnounceLimit
	End If
	If Request("submitflag")="" and Form_parentID > 0 and GBL_CHK_TempStr = "" Then
	%>
	<table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=1 cellpadding=0 align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=<%If GBL_TableHeadString = "" Then
		Response.Write "TBone"
	Else
		Response.Write "TBthree"
	End If%>><tr><td>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr bgcolor=<%=DEF_BBS_Color%> class=TBthree><td colspan=2><img src=../images/null.gif width=2 height=2></td></tr>
	<tr bgcolor=<%=DEF_BBS_Color%> class=TBthree>
		<td height=20><%If GBL_TableHeadString = "" Then%>&nbsp;<%End If%><a href=../Announce/Announce2.asp?BoardID=<%=GBL_board_ID%>><img src=../images/<%=GBL_DefineImage%>newanc.gif width=60 height=17 border=0 align=absmiddle alt=新帖></a>
			<a href=../Announce/Announce2.asp?BoardID=<%=GBL_board_ID%>&VoteFlag=yes><img src=../images/<%=GBL_DefineImage%>newpoll.gif width=60 height=17 border=0 align=absmiddle alt=新投票></a>
			<a href=../Board/Board.asp?BoardID=<%=GBL_board_ID%>>讨论区</a> <a href=../Board/EBoard.asp?BoardID=<%=GBL_board_ID%>>精华区</a>
		</td>
		<td align=right>
			<a href=Announce2.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_parentID%>&ac=pre&rd=<%=LMT_RootID%>>上篇</a>
			<a href="javascript:this.location.reload();">刷新</a>
			<a href="announce.asp<%If Request.QueryString <> "" Then Response.Write "?" & htmlencode(Request.QueryString)%>">平板</a>
			<a href=Announce2.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_parentID%>&ac=nxt&rd=<%=LMT_RootID%>>下篇</a>
		</td>
	</tr>
	</table>
	</td></tr></table>
	<img src=../images/null.gif width=2 height=4><br><%End If
	If GBL_CHK_TempStr = "" Then
		If Request("submitflag") = "" Then
			Borad_DisplayAnnounceID
			GetRequestValue
			Form_NoUserUnderWriteFlag=1
			If Form_ParentID<>0 Then
				If Left(LMT_TopicName,3) <> "Re:" Then
					Form_Title = "Re:" & LMT_TopicNameNoHTML
				Else
					Form_Title = LMT_TopicNameNoHTML
				End If
				'Form_Title = ""
			End If
			DisplayAnnounceForm
			GBL_CHK_TempStr = ""
		Else%>
			<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td><%
			If Article_NotReplay = 0 and LMT_ChildNum > LMTDEF_MaxReAnnounce and DEF_EnableTreeView = 1 Then
				Response.Write "<p><br><font color=ff0000 class=RedFont><b>回复已经达到最大数目,不能再回复帖子,请另开主题．</b></font><br>"
				GBL_CHK_TempStr = " "
				Response.Write "</td></tr></table>"
			ElseIf Article_NotReplay = 1 and Request("submitflag") = "first" Then
				Response.Write "<p><br><font color=ff0000 class=RedFont><b>此帖处于锁定状态，不允许回复．</b></font><br>"
				GBL_CHK_TempStr = " "
				Response.Write "</td></tr></table>"
			Else
				If CheckAnnouceValue = 1 Then
					If SaveAnnounceValue = 1 Then
						Response.Write "</td></tr></table>"
						DisplayAnnounceAccessfull
					Else
						If Request("submitflag") <> "first" Then
							Response.Write "<font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
							GBL_CHK_TempStr = " "
						End If
						Response.Write "</td></tr></table>"
						DisplayAnnounceForm
					End If
				Else
					If Request("submitflag") <> "first" Then
						Response.Write "<font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
						GBL_CHK_TempStr = " "
					End If
					Response.Write "</td></tr></table>"
					DisplayAnnounceForm
				End If
			End If
		End If
		UpdateOnlineUserAtInfo GBL_board_ID,GBL_Board_BoardName & "→" & LMT_TopicNameNoHTML_Temp
	Else
		Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td><br><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font><br></td></tr></table>"
	End If
	CloseDatabase
	If GBL_CHK_TempStr <> "" Then
		Response.Write "<hr size=1 align=center width=" & DEF_BBS_ScreenWidth & ">"
	End If
	SiteBottom
	If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

End Sub

Main
%>