<!--#include file="../common/conn.asp"-->
<%
'检查用户权限
call checkuser(GetQueryString("WindowName"))
%>

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE>
BODY {
	FONT-SIZE: 9pt
}
TABLE {
	FONT-SIZE: 9pt
}
TH {
	FONT-WEIGHT: 500; FONT-SIZE: 9pt
}
A:link {
	COLOR: #dd006f; TEXT-DECORATION: none
}
A:visited {
	TEXT-DECORATION: none
}
A:active {
	TEXT-DECORATION: none
}
A:hover {
	COLOR: #9933ff; TEXT-DECORATION: underline
}

</STYLE>
 <%

 tmpid=GetVariable("id")
  
 if tmpid="" then
	 title=""
	 author=Session("RealName")
	 original=""
	 content=""
	 classid=GetQueryString("class")
 else
 	'取指定ID的新闻出来编辑
	strSQL="select * from web_news where ID=" & tmpid
	 
	 set rs=server.CreateObject ("ADODB.Recordset")
	 rs.open strSQL,conn,1,1
	 tmpid=trim(rs("ID"))
	 title=Server.HTMLEncode(trim(rs("nTitle")))
	 author=trim(rs("nAuthor"))
	 original=trim(rs("nOriginal"))
	 content=Server.HTMLEncode(trim(rs("nHtmlText")))
	 classid=trim(rs("nClass"))
	 rs.close
 end if

	HtmlEditContent = content
	EditorHeight = "90%"
	

%>
<script language="JavaScript" src="../../common/JS_CheckForm.js"></script>
<script language="JavaScript">

function CheckForm(form){
	if(!Checkselect(form.selClass, "分类")) return false;
	if(form.Title.value==""){
		alert("请填写标题！　")
		return false;
	}
		
}


</script>

<title>发表<%=GetQueryString("WindowName")%></title></head>
<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0">
<form action="save.asp?mnid=<%=GetQueryString("mnid")%>&WindowName=<%=GetQueryString("WindowName")%>" method="post" name="newform" target="BackFrame" id="newform" onSubmit="return CheckForm(this)">
  <table width="100%" height="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#336600">
    <tr> 
      <td height="26" colspan="2" bgcolor="#669900"> <font color="#FFFFFF">::发表<%=GetQueryString("WindowName")%></font></td>
    </tr>
    <tr bgcolor="#eeeeee">
      <td height="26" align="right">新闻分类：</td>
      <td height="26"> <select name="selClass" id="selClass">
	  <option value="">请选择...</option>
          <%Sql="select id,c_name,c_code from web_news_class where mn_id="&GetVariable("mnid")&" order by c_code"
        set rsclass=conn.execute(sql)
        Do While Not rsclass.eof
			Level=(Len(rsclass(2))/4-1)*3
			Response.Write "<option value="""&rsclass(0)&""""
			Response.Write ">"
			If Len(rsclass(2))>4 Then Response.Write "├"
			Response.Write String(Level,"-")
			Response.Write rsclass(1)&"</option>"
			rsclass.movenext
		Loop
		rsclass.close%>
        </select></td>
    </tr>
    <tr bgcolor="#eeeeee"> 
      <td width="11%" height="26" align="right">标　题：</td>
      <td height="26"> 
        <input name="Title" type="text" class=bginput id="Title" value="<%=title%>" size="50" maxlength="100">
        (必填) 
        <input name="newid" type="hidden" id="newid" value="<%=tmpid%>" >
      </td>
    </tr>
    <tr bgcolor="#F9F9F9"> 
      <td height="26" align="right">作　者：</td>
      <td height="26"> 
        <input name="Author" type="text" class=bginput id="Author" value="<%=author%>"></td>
    </tr>
    <tr bgcolor="#eeeeee"> 
      <td height="26" align="right">来　源：</td>
      <td height="26"> 
        <input name="Original" type="text" class=bginput id="Original" value="<%=original%>"></td>
    </tr>
    <tr align="center" bgcolor="#D4D0C8"> 
      <td height="100%" colspan="2" valign="middle"> 
        <table width="100%" height="100%" border=1 cellpadding="0" cellspacing="0"  bordercolor=gray >
          <tr> 
            <td align=center> 
			 <textarea name="content" style="display:none"><%=HtmlEditContent%></textarea><input type="hidden" name="content1">
                    <iframe ID="eWebEditor1" src="../editor/ewebeditor.asp?id=content&style=standard" frameborder="0" scrolling="no" width="100%" HEIGHT="100%">
                    </iframe>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr align="center" bgcolor="#eeeeee"> 
      <td height="40" colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="5">
          <tr> 
            <td align="center"> <input name="submit1" type=submit class=button value="　保　存　" >
              　 
              <input name="YL" type=button class=button value="　关　闭　" onClick="window.close()"></td>
          </tr>
        </table></td>
    </tr>
  </table>
  
</form>
<iframe name="BackFrame" width="0" height="0" src="about:blank"></iframe>
<script language="JavaScript">
	SelectValue(document.newform.selClass,"<%=classid%>");
</script>
</body>
</html>