<!--#include file="Conn.asp"-->
<!--#include file="Check_Login.asp"-->
<!--#include file="Inc/Function.asp"-->
<head>
<!--#include file="Robots.asp"-->
<link href="skins/css/main.css" rel="stylesheet" type="text/css" />
<script language="Javascript">
function openScript(url, width, height){
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}
function openem()
{ 
openScript('Up1.asp',460,220); 
}
</script>
<style type="text/css">
<!--
.back_southidc {BACKGROUND-IMAGE:url('image/titlebg.gif');COLOR:000000;}
.table_southidc {BACKGROUND-COLOR: A4B6D7;}
.tr_southidc {BACKGROUND-COLOR: ECF5FF;}
-->
</style>
</head>
<body>


<%
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("SmallClassName"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

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

function AddItem(strFileName){
  document.myform.IncludePic.checked=true;
  document.myform.DefaultPicUrl.value=strFileName;
  document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
  document.myform.DefaultPicList.selectedIndex+=1;
  if(document.myform.UploadFiles.value==''){
	document.myform.UploadFiles.value=strFileName;
  }
  else{
    document.myform.UploadFiles.value=document.myform.UploadFiles.value+"|"+strFileName;
  }
}

function CheckForm()
{
    if (editor.EditMode.checked==true)
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
    else
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML; 

	if (document.myform.title.value.length == 0) {
		alert("新闻标题没有填写.");
		document.myform.title.focus();
		return false;
	}
	if (document.myform.BigClassName.value.length == 0) {
		alert("新闻大类没有选");
		document.myform.BigClassName.focus();
		return false;
	}
	
		if (document.myform.user.value.length == 0) {
		alert("新闻发布人没有填写");
		document.myform.user.focus();
		return false;
	}
	return true;
}
</script>


<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top">
	<table width="96%" border="0" cellpadding="2" cellspacing="1" bgcolor="#C4D8ED" class="table_southidc">
        <form method="POST" name="myform" onSubmit="return CheckForm();" action="News_save.asp?action=Add" target="_self">
          <tr> 
            <td height="30" colspan="3" align="center"><strong>增加新闻</strong></td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td width="77" height="25" align="right"><font color="#FF0000">*</font>新闻标题：</td>
            <td colspan="2"> <input name="title" type="text" class="input" size="50" maxlength="200"></td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="25" align="center"><font color="#FF0000">*</font>新闻类别：</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="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
                <option selected value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
                <%
			dim selclass
		    selclass=rs("BigClassName")
        	rs.movenext
		    do while not rs.eof
			%>
                <option value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
                <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
              </select> <select name="SmallClassName">
                <option value="" selected>不指定小类</option>
                <%
			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("SmallClassName")%>"><%=rs("SmallClassName")%></option>
                <% rs.movenext
				do while not rs.eof%>
                <option value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>
                <%
			    	rs.movenext
				loop
			end if
	        rs.close
			%>
                <%
			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="right"><font color="#FF0000">*</font>首页图片：</td>
            <td width="248"><input name="FirstImageName" type="text" id="FirstImageName" size="40">
            </td><td width="340"><iframe style="top:2px" id="UploadFiles" src="../Upload_scxia.asp?PhotoUrlID=7" frameborder=0 scrolling=no width="300" height="25"></iframe></td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="25" align="right" valign="top"><font color="#FF0000">*</font>新闻内容：</td>
            <td colspan="2" align="center" valign="top"> <input type="hidden" id="content" name="content" value="<%=Content%>" style="display:none" />
	   <iframe ID="eWebEditor1" src="Southidceditor/ewebeditor.asp?id=content&style=southidc" frameborder="0" scrolling="no" width="550" HEIGHT="450"></iframe></td>
          </tr>
          
          <tr bgcolor="#ECF5FF">
            <td height="25" align="right">编辑选项：</td>
            <td colspan="2"><input id="SavePic" type="checkbox" value="1" name="SavePic" />
              <label for="savepic">&nbsp;远程存图&nbsp;</font></label>
              <input type="checkbox" id="dellink" name="dellink" value="1">
            <label for="dellink">除去内容中的超级链接</label></td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="25" align="right"><font color="#FF0000">*</font>发布人：</td>
            <td colspan="2"> <input name="user" type="text" class="input" value="<%=session("AdminName")%>" size="30"></td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="25" align="right">首页推荐：</td>
            <td colspan="2"> <input type="radio" name="ok" value="Yes" style="border:0px">
              是 
              <input name="ok" type="radio" value="No" checked style="border:0px">
              否 　<font color="#FF0000">（只有推荐的新闻才能在首页显示！）</font></td>
          </tr>
          <tr> 
            <td height="30" align="right" bgcolor="#ECF5FF">录入时间：</td>
            <td height="30" colspan="2" align="left" bgcolor="#ECF5FF">              <input name="AddDate" type="text" id="AddDate" value="<%=date()%>" maxlength="50">            </td>
          </tr>
          <tr> 
            <td height="30" colspan="3" align="center" bgcolor="#ECF5FF"> <input type="submit" name="Submit" value="提交" class="button">
              　 
              <input type="reset" name="Submit" value="重置" class="button"> </td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>
