<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="newsadd.aspx.cs"
    Inherits="FangPage.Admin.newsadd" %>
<%@ Register Assembly="FangPage.Control" Namespace="FangPage.Control" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>发布文章</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="styles/style.css" type="text/css" rel="stylesheet">
    <style type="text/css">
        body
        {
            background-image: url(images/main_bg.gif);
            background-repeat: repeat-x;
            background-color: #CEE7FC;
        }
     </style>

    <script language="javascript" type="text/javascript" src="../plugins/calendar/WdatePicker.js"></script>

    <script language="javascript" type="text/javascript" src="js/ajax.js"></script>

    <script language="javascript" type="text/javascript" src="js/main.js"></script>

    <script language="javascript" type="text/javascript">
		function SelectColor(what){
	        var dEL = document.all("d_"+what);
	        var sEL = document.all("s_"+what);
	        var url = "dialog/selcolor.htm?color="+encodeURIComponent(dEL.value);
	        var arr = showModalDialog(url,window,"dialogWidth:200px;dialogHeight:280px;help:no;scroll:no;status:no");
	        if (arr) {
		        dEL.value=arr;
		        sEL.style.backgroundColor=arr;
	             }
        }
        
		function SearchDoc(){
	        var ret = window.showModalDialog("attachimglist.aspx?aidlist="+$("attachments").value,"","dialogWidth:630px;status:no;status:no;dialogHeight:635px;scrollbars:no");
	        try
	        {
	            if(ret.filename!=""){          
		            $("DefaultPic").value=ret.filename;
		            $("titleimg").src=ret.sfilename;
	            }
	        }
	        catch(e){}
        }
        
        function UploadDoc(){
	        var ret = window.showModalDialog("uploadfile.aspx?type=image&sortid=<%=sortid%>","","dialogWidth:450px;status:no;status:no;dialogHeight:200px;scrollbars:no");
	        try
	        {
	            if(ret.aid!="")
	            {
	              if ($("attachments").value!=""){
				       $("attachments").value = $("attachments").value + ",";
			      }
			      $("attachments").value = $("attachments").value + ret.aid;
	            }
	            
	            if(ret.filename!=""){
		            $("DefaultPic").value=ret.filename;
		            $("titleimg").src=ret.sfilename;
	            }
	        }
	        catch(e){}
        }
        
        function SearchFile(){
	        var ret = window.showModalDialog("attachimglist.aspx?aidlist="+$("attachments").value,"","dialogWidth:630px;status:no;status:no;dialogHeight:635px;scrollbars:no");
	        try
	        {
	            if(ret.filename!=""){          
		            $("file").value=ret.filename;
		            $("fileimg").src=ret.sfilename;
	            }
	        }
	        catch(e){}
        }
        
       
        function UploadFile(){
	        var ret = window.showModalDialog("uploadfile.aspx?type=file&sortid=<%=sortid%>","","dialogWidth:450px;status:no;status:no;dialogHeight:200px;scrollbars:no");
	        try
	        {
	            if(ret.aid!="")
	            {
	              if ($("attachments").value!=""){
				       $("attachments").value = $("attachments").value + ",";
			      }
			      $("attachments").value = $("attachments").value + ret.aid;
	            }
	            
	            if(ret.filename!=""){
		            $("file").value=ret.filename;
		            $("fileimg").src=ret.sfilename;
	            }
	        }
	        catch(e){}
        }
        
    </script>

    <meta content="MSHTML 6.00.3790.0" name="GENERATOR">
</head>
<body leftmargin="5" topmargin="5" rightmargin="5" bottommargin="5" onload="document.form1.title.focus();">
    <form id="form1" runat="server">
    <div>
        <table class="TdBg" cellspacing="1" cellpadding="0" width="100%" border="0">
            <tbody>
                <tr valign="middle">
                    <td class="Tdimg" style="padding-left: 10px" height="28" colspan="2">
                        <img height="18" src="images/bbs_find.gif" width="18" align="absMiddle" border="0">
                        <strong>当前位置：<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> » 发布文章
                        </strong>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        文章标题：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <cc1:TextBox ID="title" runat="server" Width="300">
                        </cc1:TextBox>
                        颜色:<input style="width: 62px" type="hidden" id="d_color" size="7" name="d_color"
                            value="#000000" runat="server" /><img border="0" src="images/rect.gif" width="18"
                                style="cursor: hand" id="s_color" onclick="SelectColor('color')" align="absmiddle" />
                        &nbsp;&nbsp;加粗:<asp:CheckBox ID="strong" runat="server" />
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        副&nbsp;标&nbsp;题&nbsp;：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <cc1:TextBox ID="subtitle" runat="server" Width="300">
                        </cc1:TextBox>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        关&nbsp;键&nbsp;字&nbsp;：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <cc1:TextBox ToolTip="输入关键字可以提高搜索引擎的收录，多个关键字请用英文逗号(,)隔开" ID="keyword" runat="server" Width="300">
                        </cc1:TextBox>
                    </td>
                </tr>
                <tr class="TdBgL" id="showtype" style="display: none;">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        所属分类：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <cc1:DropDownList ID="typeid" runat="server">
                        </cc1:DropDownList>
                        &nbsp;&nbsp;<a href="sorttypemanage.aspx?sortid=<%=sortid%>&url=newsadd.aspx">添加分类</a>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        文章选项：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <asp:CheckBox ID="istop" runat="server" Text="置顶" /><asp:CheckBox ID="isindex"
                            runat="server" Text="首页显示" ToolTip="ID:1" /><asp:CheckBox ID="isrec"
                                runat="server" Text="推荐" ToolTip="ID:2" /><asp:CheckBox ID="isfocus"
                                    runat="server" Text="焦点" ToolTip="ID:3" /><asp:CheckBox ID="isnews" runat="server"
                                        Text="要闻" ToolTip="ID:4" /><asp:CheckBox ID="isimgnews" runat="server"
                                            Text="图片新闻" ToolTip="ID:5" /><asp:CheckBox ID="isopen" runat="server"
                                                Text="首弹" ToolTip="ID:6" /><asp:CheckBox ID="isotherurl" runat="server" Text="外部链接" />
                    </td>
                </tr>
                <tr class="TdBgL" id="showotherurl" style="display: none;">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        外部链接：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <cc1:TextBox ID="otherurl" runat="server" Width="300">
                        </cc1:TextBox>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 3px; padding-left: 40px; padding-bottom: 3px; padding-top: 3px"
                        height="22" align="left" colspan="2">
                        文章内容：
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px;
                        height: 355px;" colspan="2">
                        <input type="hidden" id="attachments" name="attachments" runat="server" />
                        <textarea id="Content" name="Content" style="display: none" runat="server"></textarea>
                        <iframe id="eWebEditor1" src="../editor/ewebeditor.aspx?id=Content&style=coolblue&sortid=<%=sortid%>&attachmentsid=attachments"
                            frameborder="0" scrolling="no" width="100%" height="350"></iframe>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        文章摘要：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <textarea id="desc" name="desc" runat="server" style="width: 99%" rows="4"></textarea>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        标题图片：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                       <asp:CheckBox ID="allowimg" runat="server" Text="是否使用标题图片" />
                       <table style="margin-top: 1px; margin-bottom: 1px" cellspacing="0" cellpadding="0"align="left" border="0">
                        <tr id="showimg" style="display: none;">
                        <td width="160">
                       <table style="margin-top: 1px; margin-bottom: 1px" cellspacing="0" cellpadding="0"
                            width="160" align="center" border="0">
                            <tbody>
                                <tr>
                                    <td title="如果留空将自动选择第一张图片" style="border-right: #ccc 1px solid; border-top: #ccc 1px solid; border-left: #ccc 1px solid;
                                        border-bottom: #ccc 1px solid; cursor: hand" bgcolor="#f7f7f7" height="129" onclick="SearchDoc()"
                                        colspan="2">
                                        <div align="center">
                                            <img id="titleimg" alt="标题图片" style="max-height: 105px; max-width: 140px;" onerror="this.src='images/none.gif'"
                                                src="" border="0"></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="padding-left: 5px" height="22" align="center">
                                        <a href="javascript:SearchDoc()">选择</a>
                                    </td>
                                    <td style="padding-left: 5px" height="22" align="center">
                                        <a href="javascript:UploadDoc()">上传</a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </td></tr></table>
                        <input type="hidden" id="DefaultPic" name="DefaultPic" runat="server" />
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        标题附件：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <asp:CheckBox ID="allowfile" runat="server" Text="是否使用标题附件" />
                        <table style="margin-top: 1px; margin-bottom: 1px" cellspacing="0" cellpadding="0" align="left" border="0">
                        <tr id="showfile" style="display: none;" >
                        <td width="160">
                        <table style="margin-top: 1px; margin-bottom: 1px" cellspacing="0" cellpadding="0"
                                width="160" align="center" border="0">
                        <tbody>
                            <tr>
                                <td title="如果留空将自动选择第一个附件" style="border-right: #ccc 1px solid; border-top: #ccc 1px solid; border-left: #ccc 1px solid;
                                    border-bottom: #ccc 1px solid; cursor: hand" bgcolor="#f7f7f7" height="129" onclick="SearchFile()"
                                    colspan="2">
                                    <div align="center">
                                        <img id="fileimg" alt="标题附件" style="max-height: 105px; max-width: 140px;" onerror="this.src='images/none.gif'"
                                            src="" border="0"></div>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding-left: 5px" height="22" align="center">
                                    <a href="javascript:SearchFile()">选择</a>
                                </td>
                                <td style="padding-left: 5px" height="22" align="center">
                                    <a href="javascript:UploadFile()">上传</a>
                                </td>
                            </tr>
                        </tbody>
                       </table>
                       </td></tr></table>
                       <input type="hidden" id="file" name="file" runat="server" />
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        来&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;源&nbsp;：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <cc1:TextBox ID="res" runat="server">
                        </cc1:TextBox>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        作&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;者&nbsp;：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <cc1:TextBox ID="author" runat="server">
                        </cc1:TextBox>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        发布时间：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <cc1:TextBox ID="postdatetime" runat="server"></cc1:TextBox>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;辑&nbsp;：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <cc1:TextBox ID="editor" runat="server"></cc1:TextBox>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        文章属性：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <asp:CheckBox ID="Hidden" runat="server" Text="隐藏文章" />&nbsp;&nbsp;<asp:CheckBox ID="allowcomment" runat="server"
                                                    Text="允许评论" />&nbsp;&nbsp;<asp:CheckBox ID="copy" runat="server"
                                                    Text="禁止复制" />
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td height="35" style="width: 100px">
                        &nbsp;
                    </td>
                    <td style="padding-left: 10px">
                        <cc1:Button ID="Button1" runat="server" OnClick="Button1_Click" />&nbsp;&nbsp;
                        <button class="ManagerButton" type="button" onclick="javascript:window.location.href='<%=returnurl %>?sortid=<%=sortid%>';">
                            <img src="images/arrow_undo.gif" />返 回</button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>

    <script language="javascript" type="text/javascript">
	     document.getElementById("s_color").style.backgroundColor=document.getElementById("d_color").value;
	     showtypediv();
	     showimgdiv();
	     showfilediv();
	     
	     function showtypediv()
         {
            var istype=<%=istype%>;
            
            if(istype==1)
            {
	            showtype.style.display='block';
            }
            else
            {
                showtype.style.display='none';
            }
         } 
         
	     function showotherurldiv()
         {
            if(form1.isotherurl.checked==true)
            {
	            showotherurl.style.display='block';
            }
            else
            {
                showotherurl.style.display='none';
            }
         } 
         
         function showimgdiv()
         {
            if(form1.allowimg.checked==true)
            {
	            showimg.style.display='block';
            }
            else
            {
                showimg.style.display='none';
            }
         } 
         
         function showfilediv()
         {
            if(form1.allowfile.checked==true)
            {
	            showfile.style.display='block';
            }
            else
            {
                showfile.style.display='none';
            }
         } 
         
         
    </script>

    </form>
</body>
</html>
