<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/Upload_Setup.asp -->
<!-- #include file=../inc/Ubbcode.asp -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=../inc/Limit_Fun.asp -->
<!-- #include file=inc/MakeAnnounceTop.asp -->
<!--#include file="xgcity_community_head.asp" -->
<%
dim Assort_id
Assort_id=0
%>
<script>
if(self!=top){top.location=self.location;}
function switchSysBar(){
if (switchPoint.innerText==3){
switchPoint.innerText=4
document.all("frmTitle").style.display="none"
}else{
switchPoint.innerText=3
document.all("frmTitle").style.display=""
}}
</script>
<table border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%">
<tbody>
  <tr>
    <td height="100%" align="left" vAlign="top" noWrap id="frmTitle">
    <iframe frameBorder="0" id="carnoc" name="carnoc" scrolling="no" src="../left.asp?Assort_id=<%=Assort_id%>" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 92px; Z-INDEX: 2">
    </iframe>    </td>
    <td style="WIDTH: 9pt" >
    <table border="0" cellPadding="0" cellSpacing="0" height="100%">
	<tbody>
      <tr>
        <td style="HEIGHT: 100%" onclick="switchSysBar()" background="../images/left/bg.gif" style=CURSOR:hand; title=开启/关闭左边导航栏>
<font style=COLOR:#ffffff;CURSOR:hand;FONT-FAMILY:Webdings;FONT-SIZE:9pt;>
<SPAN id=switchPoint>3</SPAN></font></td>
      </tr>
	  </tbody>
    </table>
    </td>
    <td align="left" valign="top" style="WIDTH: 100%">
<%
DEF_BBS_HomeUrl = "../"

Dim Form_EditAnnounceID,Form_BoardID,Form_RootID,Form_ParentID
Dim Form_Title,Form_Content,Form_FaceIcon,Form_ndatetime
Dim Form_Length,Form_UserName,Form_UserID,Form_HTMLFlag,Form_UnderWriteFlag
Dim Form_NoUserUnderWriteFlag,Form_NotReplay
Dim Form_PrintContent,Form_GoodAssort,Form_GoodAssort_Old
Dim Form_TopicType,Form_NeedValue,Form_TitleStyle,Form_Topictype_Old,Form_TitleStyle_Old,Form_Title_Old
Form_TitleStyle = 0

Dim Form_VoteType,Form_VoteItem,Form_Vote_ExpireDay,VoteFlag,Form_VoteType_Old
VoteFlag = 0

Dim LMT_TopicName,LMT_TopicNameNoHTML,LMT_TopicTitleStyle,LMT_RootIDBak,LMT_TopicNameNoHTML_Temp
Form_HTMLFlag = 2

const PageSplitNum = 10

Dim LMT_DefaultEdit
LMT_DefaultEdit = DEF_UbbDefaultEdit

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

Dim LMT_MaxTextLength,SupervisorFlag,VoteGetData,VoteNumber
SupervisorFlag = CheckSupervisorUserName
If SupervisorFlag = 0 Then
	LMT_MaxTextLength = DEF_MaxTextLength
Else
	LMT_MaxTextLength = DEF_MaxTextLength * 4
End If

Function DisplayAnnounceForm

%>

<script language=javascript>
<!--

	var ValidationPassed = true;
	var EFlag = <%=LMT_DefaultEdit%>;
	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 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><%
				Response.Write "编辑帖子："  & LMT_TopicNameNoHTML_Temp%></font></b></td>
		</tr>
		<form action=EditAnnounce.asp method=post name=LeadBBSFm onSubmit="submitonce(this);return ValidationPassed;">
		<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 class=fminpt maxlength=20 name=Form_User value="<%=htmlencode(Form_UserName)%>" size="20" readonly>
							<input name=submitflag value="slzOowl_kdO8mso2" type=hidden>
							<input name=LMT_DefaultEdit value="<%=LMT_DefaultEdit%>" type=hidden>
							<input name=BoardID value="<%=Form_BoardID%>" type=hidden>
							<input name=ID value="<%=Form_EditAnnounceID%>" type=hidden>
							<%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>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>*帖子名称</td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<%
				If VoteFlag = 0 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">
						<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%>
				<select name="Form_TitleStyle">
					<option value=0<%If Form_TitleStyle = 0 Then Response.Write " selected"%>>样式</option><%If GBL_BoardMasterFlag >= 9 or Form_TitleStyle_Old = 1 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 VoteFlag = 1 Then%>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>*投票选项
			<p>每行一个投票选项，不能减少选项，可增加选项最多到<br><%=DEF_VOTE_MaxNum%>个，可修改选项
			<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%> width="<%=DEF_BBS_LeftTDWidth%>" valign="top" class=TBBG1> <br>
				<table border="0" cellspacing="0" cellpadding="0" align="center">
				<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 SupervisorFlag = 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="<%=DEF_BBS_HomeUrl%>User/Help/Ubb.asp" target=_blank>内容支持插入ＵＢＢ标签，使用方法请参考帮助</a></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="<%=DEF_BBS_HomeUrl%>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_TopicType <> 80 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';">
								<%If Form_Topictype_Old <> 54 Then%><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"%>>只限指定社员能查看此帖：<%End If%>
								<%If Form_TopicType_Old = 54 or (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%>
								<%If Form_Topictype_Old <> 54 Then%><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"%>>仅认证社员才能回复<%End If%>
							</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 type="checkbox" class=fmchkbox name="Form_UnderWriteFlag" value="checkbox"<%If Form_UnderWriteFlag=1 Then Response.Write " checked"%>>
					</td>
					<td>显示签名</td>
					<td>
						&nbsp;<input type="checkbox" class=fmchkbox 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="<%=DEF_BBS_HomeUrl%>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

	Form_EditAnnounceID = Left(Request("ID"),14)
	If isNumeric(Form_EditAnnounceID) = 0 Then Form_EditAnnounceID = 0
	Form_EditAnnounceID = cCur(Form_EditAnnounceID)
	
	Form_BoardID = GBL_board_ID
	
	If Request("submitflag")="slzOowl_kdO8mso2" 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 SupervisorFlag = 1 and GBL_UserID > 0 Then
			Form_HTMLFlag=1
		Else
			Form_HTMLFlag=0
		End If
	Else
		Form_HTMLFlag = 2
	End If
	
	Form_Content = Request.Form("Form_Content")
	
	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_NoUserUnderWriteFlag = Request("Form_NoUserUnderWriteFlag")
	If Form_NoUserUnderWriteFlag="checkbox" Then
		Form_NoUserUnderWriteFlag = 1
	Else
		Form_NoUserUnderWriteFlag = 0
	End If
	
	Form_NotReplay = Request("Form_NotReplay")
	If Form_NotReplay <> "" Then 
		Form_NotReplay = 1
	Else
		Form_NotReplay = 0
	End If
	
	If IsNull(Form_TopicType) Then Form_TopicType= 0
	If IsNull(Form_NeedValue) Then Form_NeedValue = 0

	If Form_ParentID=0 and Form_Topictype_Old <> 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_Old = 54 Then Form_Topictype = 54
		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 = 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
		Form_NeedValue = 0
		If Form_Topictype_Old <> 80 Then Form_TopicType = 0
	End If

	Form_TitleStyle = Left(Request.Form("Form_TitleStyle"),14)
	Form_GoodAssort = Left(Request.Form("Form_GoodAssort"),14)
	
	Form_UnderWriteFlag = Request("Form_UnderWriteFlag")
	If Form_UnderWriteFlag="checkbox" Then
		Form_UnderWriteFlag = 1
	Else
		Form_UnderWriteFlag = 0
	End If
	
	If VoteFlag = 1 Then
		Form_VoteItem = Trim(Request.Form("Form_VoteItem"))
		Form_Vote_ExpireDay = Left(Trim(Request.Form("Form_Vote_ExpireDay")),14)
		Form_VoteType = Left(Trim(Request.Form("Form_VoteType")),14)
	End If
	Form_TitleStyle = Left(Request.Form("Form_TitleStyle"),14)

End Function

Function Borad_CheckAnnounceIDExist(ID)

	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 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 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

Function ResumeCode(Tstr)

	Dim str
	str = Tstr
	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,"<br>",VbCrLf & " ")
	Str = Replace(str,"<br>",VbCrLf)
	Str = Replace(str,"&nbsp;"," ")
	str = Replace(str,"&gt;",">")
	Str = Replace(str,"&lt;","<")
	ResumeCode = Str

End Function

Function Borad_CheckBoardIDExist(ID)

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

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,ID2)

	If ID = ID2 Then Exit Sub
	Dim TArray,N,Num,NN,ExitN
	TArray = Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID & "_TI")
	If isArray(TArray) = False Then
		CheckGoodAssort = 0
		Exit Sub
	End If
	Num = Ubound(TArray,2)
	NN = 0
	ExitN = 3
	If ID = 0 or ID2 = 0 Then ExitN = 1
	For N = 0 To Num
		If ID = cCur(TArray(0,N)) Then
			If cCur(TArray(2,N)) = -1 Then
				TArray(3,N) = 0
				TArray(4,N) = 0
			Else
				TArray(2,N) = cCur(TArray(2,N)) - 1
				TArray(3,N) = 0
				TArray(4,N) = 0
			End If
			NN = NN + 1
			If NN >= ExitN Then Exit For
		End If
		If ID2 = cCur(TArray(0,N)) Then
			If cCur(TArray(2,N)) <> 0 Then
				If cCur(TArray(2,N)) = -1 Then
					TArray(2,N) = 1
					TArray(3,N) = 0
					TArray(4,N) = 0
				Else
					TArray(2,N) = cCur(TArray(2,N)) + 1
					TArray(3,N) = 0
					TArray(4,N) = 0
				End If
			End If
			TArray(2,N) = 0
			NN = NN + 1
			If NN >= ExitN Then Exit For
		End If
	Next
	If NN > 0 Then
		Application.Lock
		Application(DEF_MasterCookies & "BoardInfo" & GBL_board_ID & "_TI") = TArray
		Application.UnLock
	End If

End Sub

Function CheckAnnouceValue

	GBL_CHK_TempStr = ""
	If GBL_CHK_LastWriteTime < DEF_WriteEventSpace Then
		GBL_CHK_TempStr = GBL_CHK_TempStr & "您在修改资料的过程中提交得太频，请稍候再作提交! <br>" & VbCrLf
		GBL_CHK_Flag = 0
		Exit Function
	End If

	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 = Form_TitleStyle_Old
		If Form_TitleStyle >= 60 Then Form_TitleStyle = Form_TitleStyle - 60
		If Form_TitleStyle <> Form_TitleStyle_Old and (clng(Form_TitleStyle) + 60) <> cCur(Form_TitleStyle_Old) Then
			Form_TitleStyle = 0
		End If
	Else
		Form_TitleStyle = fix(cCur(Form_TitleStyle))
		If Form_TitleStyle < 0 or Form_TitleStyle > 4 Then Form_TitleStyle = 0
	End If
	If Form_TitleStyle = 1 and GBL_BoardMasterFlag <9 and ((Form_TitleStyle_Old <> 1 and Form_TitleStyle_Old <> 61) or Form_Title <> Form_Title_Old) then Form_TitleStyle = 0
	If Form_TitleStyle_Old >= 60 Then Form_TitleStyle = Form_TitleStyle + 60

	If cCur(Form_ParentID) <> 0 or (GBL_CHK_CachetValue <= 1 and GBL_BoardMasterFlag <= 4) or isNumeric(Form_GoodAssort) = 0 Then
		Form_GoodAssort = Form_GoodAssort_Old
	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
		If (GBL_UserID>0 and SupervisorFlag = 1) Then
			If Len(Form_Content)>LMT_MaxTextLength*4 Then
				GBL_CHK_TempStr = "错误，帖子内容不能超过" & LMT_MaxTextLength*4 & "字节.<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
		Else
			GBL_CHK_TempStr = "错误，帖子内容不能超过" & LMT_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
	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 GBL_UserID<1 Then
		GBL_CHK_TempStr = "密码或社员名错误。<br>" & VbCrLf
		CheckAnnouceValue = 0
		Exit Function
	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_EditAnnounceID)=0 Then Form_EditAnnounceID=0
	Form_EditAnnounceID = cCur(Form_EditAnnounceID)
	If Borad_CheckAnnounceIDExist(Form_EditAnnounceID) = 0 Then
		GBL_CHK_TempStr = "发生错误，要编辑的帖子不存在，可以是刚删除或其它原因.<br>" & VbCrLf
		CheckAnnouceValue = 0
		Exit Function
	End If
	
	If Trim(Form_Title & "") = "" Then
		GBL_CHK_TempStr = "错误，请填写帖子名称.<br>" & VbCrLf
		CheckAnnouceValue = 0
		Exit Function
	End If

	If len(Form_Title)>255 Then
		GBL_CHK_TempStr = "错误，帖子名称太长.<br>" & VbCrLf
		CheckAnnouceValue = 0
		Exit Function
	End If
	
	If Trim(Form_Content) = "" and (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 VoteFlag = 1 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 Len(TempURL(Loop_N)) > 48 Then
					GBL_CHK_TempStr = "错误，投票选项内容太长，不能超过24字.<br>" & VbCrLf
					Form_VoteItem = Form_VoteItem_Old
					CheckAnnouceValue = 0
					Exit Function
				ElseIf 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 or Temp < VoteNumber Then
			GBL_CHK_TempStr = "修改的投票选项不能减少，原来的投票共有" & VoteNumber & "个选项.<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
		
		If Form_VoteType = 0 and Form_VoteType_Old = 1 Then
			GBL_CHK_TempStr = "错误，投票类型不能由多选票改为单选票.<br>" & VbCrLf
			Form_VoteItem = Form_VoteItem_Old
			CheckAnnouceValue = 0
			Exit Function
		End If
	End If

	Form_Title = UBB_FiltrateBadWords(Form_Title)

	'If Left(Form_Title,3) = "Re:" and htmlencode(Form_Title) <> "Re:" & LMT_TopicNameNoHTML and Form_ParentID <> 0 Then Form_Title = Mid(Form_Title,4)
	'Form_Title = Replace(Replace(Form_Title,chr(13),""),chr(10),"")

	Form_Length = Len(Form_Content)
	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 = ""
		ElseIf 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 SaveEditAnnounceValue

	Dim MaxAnnounceID,MaxRootID
	Form_NoUserUnderWriteFlag = cCur(Form_NoUserUnderWriteFlag)
	Form_UnderWriteFlag = cCur(Form_UnderWriteFlag)
	Dim SQL,Rs

	'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 SupervisorFlag = 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 SupervisorFlag = 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

	Dim PollString,PollNum
	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
			PollNum = 1
		ElseIf inStr(Form_content,"[/rm]") or inStr(Form_content,"[/RM]") Then
			PollNum = 2
		ElseIf inStr(Form_content,"[/flash]") or inStr(Form_content,"[/FLASH]") Then
			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
			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
			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
			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
			PollNum = 9
		ElseIf inStr(Form_content,"[/img") or inStr(Form_content,"[/IMG") Then
			PollNum = 4
		ElseIf inStr(Form_content,"[/url]") or inStr(Form_content,"[/URL]") Then
			PollNum = 5
		End If
		PollString = ",PollNum=" & PollNum
	ElseIf Form_TopicType <> 80 and Form_TopicType <> 54 Then
		PollString = ",PollNum=0"
	End If

	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
		MaxRootID = 1
	Else
		MaxRootID = Rs(0)
		If isNull(MaxRootID) or MaxRootID="" Then MaxRootID=1
		MaxRootID = cCur(MaxRootID)
	End If
	Rs.Close
	Set Rs = Nothing

	Dim New_Form_RootID
	New_Form_RootID = Form_RootID

	Rem 置顶的帖子编辑一次, 就帖到最顶
	If Form_ParentID=0 and GBL_BoardMasterFlag >= 5 and Form_RootID > DEF_BBS_TOPMinID Then
		'If Form_RootID < cCur(Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID)(11,0)) Then
			Set Rs = Con.ExeCute("Select Max(RootID) from LeadBBS_Topic Where BoardID=" & GBL_Board_ID)
			GBL_DBNum = GBL_DBNum + 1
			If Rs.Eof Then
				New_Form_RootID = DEF_BBS_TOPMinID+1
			Else
				New_Form_RootID = Rs(0)
				If isNull(New_Form_RootID) or New_Form_RootID="" Then New_Form_RootID = DEF_BBS_TOPMinID+1
				New_Form_RootID = cCur(New_Form_RootID)+1
				If New_Form_RootID<DEF_BBS_TOPMinID Then New_Form_RootID=DEF_BBS_TOPMinID
			End If
			Rs.Close
			Set Rs = Nothing
			SQL = " Update LeadBBS_Announce Set RootID=" & New_Form_RootID & " where ID=" & LMT_RootIDBak
			con.Execute(SQL)
			GBL_DBNum = GBL_DBNum + 1
			SQL = " Update LeadBBS_Topic Set RootID=" & New_Form_RootID & " where ID=" & LMT_RootIDBak
			con.Execute(SQL)
			GBL_DBNum = GBL_DBNum + 1
		'End If
	End If
	If New_Form_RootID<> Form_RootID Then
		UpdateBoardValue(Form_BoardID)
	End If

	SQL = "Update LeadBBS_Announce set Title='" & Replace(Form_Title,"'","''") & "',Content='" & Replace(Form_Content,"'","''") & "',PrintContent='" & Replace(Form_PrintContent,"'","''") & "',FaceIcon=" & Form_FaceIcon & ",htmlflag=" & Form_htmlflag & ",NotReplay=" & Form_NotReplay & ",UnderWriteFlag=" & Form_UnderWriteFlag &_
	",TopicType=" & Form_TopicType & ",NeedValue=" & Form_NeedValue & ",TitleStyle=" & Form_TitleStyle & ",Length=" & Form_Length & ",GoodAssort=" & Form_GoodAssort & PollString
	If SupervisorFlag = 0 and (Form_UserID <> GBL_UserID or DateDiff("s",RestoreTime(Form_ndatetime),DEF_Now) > DEF_EditAnnounceDelay) Then SQL = SQL & ",OtherInfo='这个贴子最后由" & Replace(GBL_CHK_User,"'","''") & "在" & DEF_Now & "编辑过" & "'"
	SQL = SQL & " where ID=" & Form_EditAnnounceID
	con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	If Form_ParentID = 0 Then
		SQL = "Update LeadBBS_Topic set Title='" & Replace(Form_Title,"'","''") & "',FaceIcon=" & Form_FaceIcon & ",NotReplay=" & Form_NotReplay &_
		",TopicType=" & Form_TopicType & ",NeedValue=" & Form_NeedValue & ",TitleStyle=" & Form_TitleStyle & ",Length=" & Form_Length & ",GoodAssort=" & Form_GoodAssort & PollString
		SQL = SQL & " where ID=" & Form_EditAnnounceID
		con.ExeCute(SQL)
		GBL_DBNum = GBL_DBNum + 1
	End If
	If inStr(application(DEF_MasterCookies & "TopAncList"),"," & Form_EditAnnounceID & ",") Then
		UpdateAnnounceApplicationInfo LMT_RootIDBak,2,Form_Title,0,0
		UpdateAnnounceApplicationInfo LMT_RootIDBak,3,Form_FaceIcon,0,0
		UpdateAnnounceApplicationInfo LMT_RootIDBak,14,Form_TopicType,0,0
		UpdateAnnounceApplicationInfo LMT_RootIDBak,16,Form_TitleStyle,0,0
		UpdateAnnounceApplicationInfo LMT_RootIDBak,6,Form_Length,0,0
		If PollString <> "" Then UpdateAnnounceApplicationInfo LMT_RootIDBak,15,PollNum,0,0
	Else
		If inStr(application(DEF_MasterCookies & "TopAncList" & GBL_Board_BoardAssort),"," & Form_EditAnnounceID & ",") Then
			UpdateAnnounceApplicationInfo LMT_RootIDBak,2,Form_Title,0,GBL_Board_BoardAssort
			UpdateAnnounceApplicationInfo LMT_RootIDBak,3,Form_FaceIcon,0,GBL_Board_BoardAssort
			UpdateAnnounceApplicationInfo LMT_RootIDBak,14,Form_TopicType,0,GBL_Board_BoardAssort
			UpdateAnnounceApplicationInfo LMT_RootIDBak,16,Form_TitleStyle,0,GBL_Board_BoardAssort
			UpdateAnnounceApplicationInfo LMT_RootIDBak,6,Form_Length,0,GBL_Board_BoardAssort
			If PollString <> "" Then If PollString <> "" Then UpdateAnnounceApplicationInfo LMT_RootIDBak,15,PollNum,0,GBL_Board_BoardAssort
		End If
	End If

	ChangeGoodAssort Form_GoodAssort_Old,Form_GoodAssort

	'on error resume next

	If Form_ParentID = 0 Then
		If Form_TitleStyle = 1 Then
			LMT_TopicNameNoHTML = KillHTMLLabel(Form_Title)
		Else
			LMT_TopicNameNoHTML = Form_Title
		End If
		UpdateBoardLastAnnounce
	End If
	if err Then
		SaveEditAnnounceValue = 0
		GBL_CHK_TempStr = "错误，服务器太忙或您的文档大太，请重新提交表单!<br>" & VbCrLf
	Else
		SaveEditAnnounceValue = 1
	End If
	
	Rem 下面保存投票选项
	Dim TempURL,Loop_N
	If VoteFlag = 1 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))
		TempURL = Split(Form_VoteItem,VbCrLf)
		For Loop_N = 0 to VoteNumber
			Con.ExeCute("Update [LeadBBS_VoteItem] Set VoteType=" & Form_VoteType & ",VoteName='" & Replace(UBB_FiltrateBadWords(TempURL(Loop_N)),"'","''") & "',ExpiresTime=" & Form_Vote_ExpireDay & " where ID=" & VoteGetData(3,Loop_N))
			GBL_DBNum = GBL_DBNum + 1
		Next
		For Loop_N = VoteNumber + 1 to Ubound(TempURL,1)
			Con.ExeCute("insert into [LeadBBS_VoteItem](AnnounceID,VoteType,VoteName,ExpiresTime) values(" & Form_EditAnnounceID & "," & Form_VoteType & ",'" & Replace(UBB_FiltrateBadWords(TempURL(Loop_N)),"'","''") & "'," & Form_Vote_ExpireDay & ")")
			GBL_DBNum = GBL_DBNum + 1
		Next
	End If

End Function

sub UpdateBoardLastAnnounce

	Dim Rs,SQL
	Set Rs = Server.CreateObject("ADODB.RecordSet")
	Dim LastAnnounceID
	LastAnnounceID = cCur(Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID)(19,0))

	If LastAnnounceID = Form_EditAnnounceID or LastAnnounceID = LMT_RootIDBak Then
		con.ExeCute("Update LeadBBS_Boards Set LastTopicName='" & Replace(LMT_TopicNameNoHTML,"'","''") & "' where BoardID=" & Form_BoardID)
		GBL_DBNum = GBL_DBNum + 1
		UpdateBoardApplicationInfo Form_BoardID,LMT_TopicNameNoHTML,20
	End If

End sub

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 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;已经成功编辑版面“<%=GBL_Board_BoardName%>”中的帖子，您可以选择以下操作：</font></td>
		</tr>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightestColor%> colspan="2" class=TBBG9>
			<br>&nbsp;本页面将在5秒后自动返回您所编辑的主题，可以继续选择以下操作：<br>
				<ul>
				<meta http-equiv=refresh content="5;URL=announce.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_EditAnnounceID%>">
					<li><a href=<%=DEF_BBS_HomeUrl%>index.asp>返回首页</a><br>
					<li>返回<a href=<%=DEF_BBS_HomeUrl%>Board/Board.asp?BoardID=<%=GBL_board_ID%>><%=GBL_Board_BoardName%></a>社区<br>
					<li>到<a href=announce.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_EditAnnounceID%>>刚编辑的主题</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 GetTopicInfo

	If GBL_UserID < 1 Then
		GetTopicInfo = 0
		GBL_CHK_TempStr = "错误, 游客不能编辑帖子!<br>" & VbCrLf
		Exit Function
	End If

	Dim Rs,SQL,submitflag
	submitflag = Request("submitflag")

	SQL = "Select RootID,Title,BoardID,RootIDBak,TitleStyle,ParentID,HTMLFlag,PrintContent,Content,FaceIcon,ndatetime,Length,UserName,UserID,UnderWriteFlag,NotReplay,TopicType,NeedValue,GoodAssort from LeadBBS_Announce where ID=" & Form_EditAnnounceID
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	If Rs.Eof Then
		LMT_RootIDBak = 0
		Rs.Close
		Set Rs = Nothing
		GBL_CHK_TempStr = "错误,该主题不存在!<br>" & VbCrLf
		Exit Function
	Else
		Form_BoardID = cCur(Rs("BoardID"))
		Form_UserID = cCur(Rs("UserID"))
		If Form_BoardID <> GBL_Board_ID Then
			LMT_RootIDBak = 0
			GBL_CHK_TempStr = "错误,该主题不存在!<br>" & VbCrLf
			Rs.close
			Set Rs = Nothing
			Exit function
		End If

		If GBL_BoardMasterFlag < 5 and Form_UserID <> GBL_UserID Then
			GetTopicInfo = 0
			GBL_CHK_TempStr = "错误, 您没有权限编辑此帖!<br>" & VbCrLf
			Rs.Close
			Set Rs = Nothing
			Exit Function
		End If

		Form_ParentID = cCur(Rs("ParentID"))
		Form_RootID = cCur(Rs("RootID"))
		Form_Title = Rs("Title")
		Form_Title_Old = Form_Title
		Form_HTMLFlag = cCur(Rs("HTMLFlag"))

		Form_FaceIcon = cCur(Rs("FaceIcon"))
		Form_ndatetime = cCur(Rs("ndatetime"))
		Form_UserName = Rs("UserName")
		Form_UnderWriteFlag = Rs("UnderWriteFlag")
		Form_NotReplay = Rs("NotReplay")
		Form_Topictype = Rs("TopicType")
		Form_Topictype_Old = Form_Topictype
		Form_NeedValue = Rs("NeedValue")
		Form_TitleStyle = Rs("TitleStyle")
		Form_TitleStyle_Old = Form_TitleStyle
		If Form_TitleStyle >= 60 Then Form_TitleStyle = Form_TitleStyle - 60
		Form_GoodAssort = cCur(Rs("GoodAssort"))
		Form_GoodAssort_Old = Form_GoodAssort
		If isNull(Form_Topictype) Then Form_Topictype = 0
		If isNull(Form_NeedValue) Then Form_NeedValue = 0
		
		LMT_TopicName = Form_Title
		LMT_RootIDBak = cCur(RS("RootIDBak"))
		LMT_TopicTitleStyle = Rs("TitleStyle")

		If Form_Topictype = 55 and cCur(Form_NeedValue) > 0 Then
			Form_NeedValue = GetUserName(Form_NeedValue)
			If Form_NeedValue <> GBL_CHK_User and GBL_UserID <> Form_UserID Then
				GBL_CHK_TempStr = "隐私帖子不允许他人编辑。<br>" & VbCrLf
				Rs.Close
				Set Rs = Nothing
				GetTopicInfo = 0
				Exit Function
			End If
		End If
		If DEF_EditAnnounceExpires > 0 and GBL_BoardMasterFlag < 4 and DateDiff("s",RestoreTime(Form_ndatetime),DEF_Now) > DEF_EditAnnounceExpires Then
			GBL_CHK_TempStr = "此帖子已经超过了允许编辑的最大期限。<br>" & VbCrLf
			Rs.Close
			Set Rs = Nothing
			GetTopicInfo = 0
			Exit Function
		End If
		
		Select Case Form_HTMLFlag
			Case 0: Form_Content = ResumeCode(Rs("PrintContent"))
			Case 1: If SupervisorFlag = 0 Then
						Rs.Close
						Set Rs = Nothing
						GBL_CHK_TempStr = "此帖子为HTML格式，仅限管理员编辑修改。<br>" & VbCrLf
						GetTopicInfo = 0
						Exit Function
					End If
					Form_Content = Rs("PrintContent")
			Case 2: Form_Content = Rs("Content")
					If Len(Form_Content) > DEF_MaxTextLength and SupervisorFlag = 0 Then
						Rs.Close
						Set Rs = Nothing
						GBL_CHK_TempStr = "此帖子内容过长，无法完成编辑。<br>" & VbCrLf
						GetTopicInfo = 0
						Exit Function
					End If
					If LMT_DefaultEdit = 0 Then
						ConvertFlag = 0
						Form_Content = Ubb_Code(Form_Content)
						ConvertFlag = 1
					End If
			Case 3: 
					If LMT_DefaultEdit = 1 Then
						Form_Content = ResumeCode(Rs("PrintContent"))
					Else
						Form_Content = Rs("PrintContent")
					End If
					Form_HTMLFlag = 2
			Case Else: Form_Content = ResumeCode(Rs("PrintContent"))
					Form_HTMLFlag = 0
		End Select
		Rs.close
		Set Rs = Nothing
	End If
	
	If Form_ParentID <> 0 Then
		SQL = "Select top 1 Title,BoardID,ID,TitleStyle from LeadBBS_Topic where ID=" & LMT_RootIDBak & " order by ID ASC"
		Set Rs = Con.ExeCute(SQL)
		If Rs.Eof Then
			LMT_RootIDBak = 0
			Rs.Close
			Set Rs = Nothing
			GBL_CHK_TempStr = "错误,该主题不存在!<br>" & VbCrLf
			Exit Function
		End If
		If Form_BoardID <> GBL_Board_ID Then
			LMT_RootIDBak = 0
			GBL_CHK_TempStr = "错误,该主题不存在!<br>" & VbCrLf
			Rs.close
			Set Rs = Nothing
			Exit function
		Else
			LMT_TopicName = Rs("Title")
			LMT_RootIDBak = cCur(RS("ID"))
			LMT_TopicTitleStyle = Rs("TitleStyle")
			If isNull(LMT_RootIDBak) then LMT_RootIDBak = 0
			Rs.Close
			Set Rs = Nothing
		End If
	End If

	If GBL_BoardMasterFlag >= 7 and Form_Topictype = 80 and Form_ParentID = 0 Then VoteFlag = 1
	If VoteFlag = 1 Then
		SQL = "Select top " & DEF_VOTE_MaxNum & " VoteName,VoteType,ExpiresTime,ID from LeadBBS_VoteItem where AnnounceID=" & Form_EditAnnounceID
		Set Rs = Con.ExeCute(SQL)
		If Not Rs.Eof Then VoteGetData = Rs.GetRows(DEF_VOTE_MaxNum)
		Rs.Close
		Set Rs = Nothing
		VoteNumber = 0
		Form_VoteType = 0
		Form_VoteType_Old = 0
		Form_Vote_ExpireDay = 0
		If isArray(VoteGetData) Then
			VoteNumber = Ubound(VoteGetData,2)
			Form_VoteType = VoteGetData(1,0)
			If Form_VoteType = True or Form_VoteType = 1 Then
				Form_VoteType = 1
			Else
				Form_VoteType = 0
			End If
			Form_VoteType_Old = Form_VoteType
			If cCur(VoteGetData(2,0)) = 0 Then
				Form_Vote_ExpireDay = 0
			Else
				Form_Vote_ExpireDay = DateDiff("d",DEF_Now,RestoreTime(VoteGetData(2,0)))
			End If
			Form_VoteItem = VoteGetData(0,0)
			For SQL = 1 to VoteNumber
				Form_VoteItem = Form_VoteItem & VbCrLf & VoteGetData(0,SQL)
			Next
		End If
	End If

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">
	<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">
	<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">
	<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+'文字，最长允许<%=LMT_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" ID="ContentEdit" name=ContentEdit value="">
	<input type="hidden" ID="ContentLoad" name=ContentLoad value="">
	<input type="hidden" ID="ContentFlag" 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

	Form_EditAnnounceID = Left(Request("ID"),14)
	If isNumeric(Form_EditAnnounceID) = 0 Then Form_EditAnnounceID = 0
	Form_EditAnnounceID = cCur(Form_EditAnnounceID)

	'GetRequestValue
	GetTopicInfo

	If LMT_TopicTitleStyle = 1 Then
		LMT_TopicNameNoHTML = KillHTMLLabel(LMT_TopicName)
	Else
		LMT_TopicNameNoHTML = htmlencode(LMT_TopicName)
	End If
	Temp = LMT_TopicNameNoHTML
	Dim Temp
	If Temp = "" Then
		Temp = "编辑帖子"
	Else
		If strLength(Temp)>DEF_BBS_DisplayTopicLength-5 Then
			LMT_TopicNameNoHTML_Temp = htmlencode(LeftTrue(Temp,DEF_BBS_DisplayTopicLength-8)) & "..."
			Temp = "编辑：" & LMT_TopicNameNoHTML_Temp
		Else
			LMT_TopicNameNoHTML_Temp = htmlencode(Temp)
			Temp = "编辑：" & LMT_TopicNameNoHTML_Temp
		End if
	End If
	BBS_SiteHead DEF_SiteNameString & " " & DEF_BBS_Name,GBL_board_ID," &gt;&gt; 编辑帖子"
	UpdateOnlineUserAtInfo GBL_board_ID,GBL_Board_BoardName & "→" & Temp
	
	CheckAccessLimit
	CheckAccessLimit_TimeLimit
	CheckBoardModifyLimit
	CheckUserModifyLimit

	If Request("submitflag")="" and Form_EditAnnounceID > 0 Then
	%>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
	<tr bgcolor=<%=DEF_BBS_Color%> class=TBthree class=TBthree>
		<td height=20><img src=../images/null.gif width=2 height=3><br>&nbsp;<a href=../Announce/Announce2.asp?BoardID=<%=GBL_board_ID%>><b>发表新帖</b></a>
			<a href=../Board/Board.asp?BoardID=<%=GBL_board_ID%>>讨论区</a> <a href=../Board/EBoard.asp?BoardID=<%=GBL_board_ID%>>精华区</a>
			返回帖子[<a href="announce.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_EditAnnounceID%>">平板</a>,<a 
			href="announce2.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_EditAnnounceID%>">树形</a>]
		</td>
	</tr>
	</table><img src=../images/null.gif width=2 height=4><br><%End If
	If GBL_CHK_TempStr <> "" Then
		Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td><br><b><font color=ff0000 class=RedFont>" & GBL_CHK_TempStr & "</font></b></br></td></tr></table>"
	Else
		If Request("submitflag")<>"slzOowl_kdO8mso2" Then
			DisplayAnnounceForm
		Else
			GetRequestValue
			If CheckAnnouceValue = 1 Then
				If SaveEditAnnounceValue = 1 Then
					If SupervisorFlag = 0 Then
						Con.ExeCute("Update LeadBBS_User Set LastWriteTime=" & GetTimeValue(DEF_Now) & " where ID=" & GBL_UserID)
						GBL_DBNum = GBL_DBNum + 1
						UpdateSessionValue 13,GetTimeValue(DEF_Now),0
					End If
					DisplayAnnounceAccessfull
				Else%>
					<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td><%
					Response.Write "<font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
					Response.Write "</td></tr></table>"
					DisplayAnnounceForm
				End If
			Else%>
				<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td><%
				Response.Write "<font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
				Response.Write "</td></tr></table>"
				DisplayAnnounceForm
			End If
		End If
	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
%>
 </td>
  </tr>
  </tbody>
</table>
<script>
if(window.screen.width<'1024'){switchSysBar()}
</script>
<!--#include file="../stat.asp" -->
