<!--#include file="../../Inc/conn.asp"-->
<!--#include file="../admin.asp"-->
<!-- #include file="../Inc/Head.asp" -->
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass_New order by SmallClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassID"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.SmallClass.length = 0; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.SmallClass.options[document.myform.SmallClass.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    

function CheckForm()
{

	if (document.myform.title.value.length == 0) {
		alert("信息标题没有填写.");
		document.myform.title.focus();
		return false;
	}
		if (document.myform.Author.value.length == 0) {
		alert("信息发布人没有填写");
		document.myform.Author.focus();
		return false;
	}
		if (document.myform.ComeFrom.value.length == 0) {
		alert("信息来源没有填写");
		document.myform.ComeFrom.focus();
		return false;
	}	
	if (eWebEditor1.eWebEditor.document.body.innerHTML == ''){
		alert("信息内容不能为空！");
		eWebEditor1.eWebEditor.focus();
		return false;
	}
	return true;
}

function SetDropDownPic(url){
	document.myform.UploadFiles.value=document.myform.UploadFiles.value + url +"|";
	document.myform.IncludePic.value="1";
}
</script>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table_southidc">
  <form name="myform" method="post" action="News_save.asp" onSubmit="return CheckForm();">
    <tr>
      <td height="30" colspan="3" align="center" class="blod">增加信息</td>
    </tr>
    <tr bgcolor="#ECF5FF">
      <td width="161" height="25" align="center">信息标题：</td>
      <td colspan="2"><input name="title" type="text" class="input" size="30"></td>
    </tr>
    <tr bgcolor="#ECF5FF">
      <td height="25" align="center">信息类别：</td>
      <td colspan="2"><%		
        sql = "select * from BigClass_New"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
        <select name="BigClass" size="1" id="BigClass" onChange="changelocation(document.myform.BigClass.options[document.myform.BigClass.selectedIndex].text)">
          <option selected value="<%=trim(rs("BigClassID"))%>"><%=trim(rs("BigClassName"))%></option>
          <%
			dim selclass
		    selclass=rs("BigClassName")
        	rs.movenext
		    do while not rs.eof
			%>
          <option value="<%=trim(rs("BigClassID"))%>"><%=trim(rs("BigClassName"))%></option>
          <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
        </select>
        <select name="SmallClass" id="SmallClass">
          <%
			sql="select * from SmallClass_New where BigClassName='" & selclass & "'"
			rs.open sql,conn,1,1
			if not(rs.eof and rs.bof) then
			%>
          <option value="<%=rs("SmallClassID")%>"><%=rs("SmallClassName")%></option>
          <% rs.movenext
				do while not rs.eof%>
          <option value="<%=rs("SmallClassID")%>"><%=rs("SmallClassName")%></option>
          <%
			    	rs.movenext
				loop
			end if
	        rs.close
			%>
			<option value="">不指定小类</option>
          <%
			ranNum=int(9*rnd)+10
			iddata=month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum
			%>
        </select></td>
    </tr>
    <tr bgcolor="#ECF5FF">
      <td height="25" align="center">发 布 人：</td>
      <td colspan="2"><input name="Author" type="text" id="auther" value="本站">
        <span class="TableRow1">
        <select name=font2 onChange="Author.value=this.value;">
          <option selected value="">选择作者</option>
          <option value='佚名'>佚名</option>
          <option value='本站'>本站</option>
          <option value='不详'>不详</option>
          <option value='未知'>未知</option>
          <option value='admin'>admin</option>
        </select>
      </span></td>
    </tr>
    <tr bgcolor="#ECF5FF">
      <td height="25" align="center">信息来源：</td>
      <td colspan="2"><input name="ComeFrom" type="text" id="ComeFrom" value="网络">
        <span class="TableRow1">
        <select name=font1 onChange="ComeFrom.value=this.value;">
          <option selected value="">选择来源</option>
          <option value='本站原创'>本站原创</option>
          <option value='本站整理'>本站整理</option>
          <option value='不详'>不详</option>
          <option value='转载'>转载</option>
        </select>
      </span></td>
    </tr>
    <tr bgcolor="#ECF5FF">
      <td height="25" align="center" valign="top">信息内容：</td>
      <td colspan="2" valign="top">
      
      <textarea name="content" id='content' style="display:none"></textarea>  
<iframe id="eWebEditor1" src="/eWebEditor7/ewebeditor.htm?id=content&style=standard650&skin=office2003" frameborder="0" scrolling="no" width="600" height="350"></iframe> 
      
      
          </td>
    </tr>
    <tr>
      <td height="30" align="center" bgcolor="#ECF5FF"><span class="tr_southidc">首页图片：</span></td>
      <td width="334" height="30" bgcolor="#ECF5FF"><span class="tr_southidc">
        <input name="DefaultPicUrl" type="text" id="DefaultPicUrl" value="images/Nopic.jpg" size="30" maxlength="120" />
      </span></td>
      <td width="545" bgcolor="#ECF5FF"><span class="tr_southidc">
        <input type="button" name="Submit22" value="直接从上传图片中选择" onClick="window.open('../SelectPic.asp','','status=no,scrollbars=yes,top=300,left=200,width=396,height=254');" />
        <input name="Submit222" type="button" value="上传图片"  onClick="window.open('../../inc/mx_upload_flash.asp?formname=myform&editname=DefaultPicUrl&uppath=UploadFiles/Arcitle&filelx=jpg','','status=no,scrollbars=no,top=300,left=200,width=420,height=136')">
      </span></td>
    </tr>
    <tr>
      <td height="30" align="center" bgcolor="#ECF5FF"><span class="tr_southidc">是否推荐：</span></td>
      <td height="30" colspan="2" align="left" bgcolor="#ECF5FF"><input name="Elite" type="checkbox" id="Passed" value="yes">是<font color="#0000FF">（如果选中的话将在首页做为图片信息显示）</font></td>
    </tr>
    <tr>
      <td height="30" align="center" bgcolor="#ECF5FF"><span class="tr_southidc">发布时间：</span></td>
      <td height="30" colspan="2" align="left" bgcolor="#ECF5FF"><span class="tr_southidc">
        <input name="PostTime" type="text" id="PostTime" value="<%=Now()%>" size="30" maxlength="120" />
      </span><font color="#0000FF">（为了避免出错，尽量不要更改。格式：<%=Now()%>）</font></td>
    </tr>
    <tr>
      <td height="30" colspan="3" align="center" bgcolor="#ECF5FF"><input type="submit" name="Submit" value="确认添加" class="input">
        
        &nbsp;
        <input type="button" name="Submit2" value="返回上一页" class="input" onClick="history.go(-1);">
        <input name="Act" type="hidden" id="Act" value="Add">        <input name="UploadFiles" type="hidden" id="UploadFiles" />
        <span class="tr_southidc">
        <input name="IncludePic" type="hidden" id="IncludePic" value="0" />
        </span></td>
    </tr>
  </form>
</table>
<!-- #include file="../Inc/Foot.asp" -->