<%@ page language="C#" autoeventwireup="true" inherits="WebAdmin_NoticeListEdit, LebiMall" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!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 runat="server">
    <title>编辑公告</title>
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <link href="css/tipswindown.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" language="javascript" src="js/topHead.js"></script>
    <script type="text/javascript" src="js/checked.js"></script>
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/tipswindown.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>

    <script type="text/javascript">
 //展开与合并
    function resizeEditor(name,size) {   
	    var newheight = parseInt(document.getElementById(name +"___Frame").style.height, 10) + size;   
	    if(newheight >= 150) {   
		    document.getElementById(name +"___Frame").style.height = newheight + 'px';   
	    }   
    } 
    //验证标题是否为空
        function validate(){
            if(document.getElementById("txt_title").value==""){
                 document.getElementById("msg_tm").innerHTML="<span class='msg_submit'>产品推荐上限不能为空！</span>";
                 return false;
            }else
            {
                   document.getElementById("msg_tm").innerHTML="";
                   return true;
            }  
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <script>header(5,4,"images/");</script>
        <div class="blank clearfix">
        </div>
        <script type="text/javascript">
            var $=jQuery;
            var f="<%=returnValue %>";
            var i=2;
            if(f=="true"){
                tipsWindown('操作结果','text:操作成功！','250','100','true','2000','true','text');
                setInterval("fun()", 1000);
            }
            if(f=="false"){
                tipsWindown('操作结果','text:操作失败！','250','100','true','2000','true','text');
            }
            function fun() {
                if (i == 1) {
                    window.location.href="NoticeList.aspx";
                }
                i--;
            }
        </script>
        <div class="tabmenus mainwidth">
            <ul>
                <li><a href="NoticeList.aspx"><span>信息管理</span></a></li>
                <li><a href="HelpCenter.aspx"><span>信息添加</span></a></li>
                <li class="current"><a href="NoticeListEdit.aspx"><span>信息编辑</span></a></li>
                <li><a href="NoticeTypeList.aspx"><span>类别管理</span></a></li>
            </ul>
        </div>
        <div class="tab-mainbody">
            <div class="tab-mainbody2">
                <div class="functionHandleArea clearfix">
                    <input type="hidden" id="hid_checkbox" name="hid_checkbox" />
                    <input type="hidden" id="hid_page" name="hid_page" />
                    <input type="hidden" id="hid_type" name="hid_type" />
                    <input id="Button1" type="button" runat="server" class="btn-app" onserverclick="btnSubmit_ServerClick" />
                    <input type="button" name="Submit" class="btn-res"  onclick="reset();return false;" align="absmiddle" />
                    <input type="button" class="btn-bak" onclick="history.back();return false;"  align="absmiddle" />
            </div>
                <div id="datalist">
                <table cellspacing="0" width="100%" cellpadding="0" id="list">
                    <tr>
                        <th style="height: 28px" colspan="2">
                            编辑公告信息</th> 
                    </tr>
                    <tr>
                        <td style="width:15%">
                            标题：
                        </td>
                        <td style="width:85%">
                            <input type="text" id="txt_title" runat="server" class="input" size="60" />&nbsp;<span id="msg_tm"></span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            内容：
                        </td>
                        <td>
                            <FCKeditorV2:FCKeditor ID="fck" runat="server" ToolbarSet="Mall2" BasePath="js/fckeditor/"
                                Height="200px" Width="600px">
                            </FCKeditorV2:FCKeditor>
                            <a href="javascript:resizeEditor('fck',-100)">
                                <img src="images/bt_close.gif" border='0'></a>&nbsp;<a href="javascript:resizeEditor('fck',150)"><img
                                    src="images/bt_open.gif" border='0'></a>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            类型：
                        </td>
                        <td>
                            <select id="type_id" name="type" onchange="javascript:chang(this);">
                                <%
                                    for (int j = 0; j < dstype.Tables[0].Rows.Count; j++)
                                    {
                                %>
                                <%
                                        
                                    if (typeid == dstype.Tables[0].Rows[j]["id"].ToString())
                                    {
                                %>
                                <option id='<%=dstype.Tables[0].Rows[j]["id"] %>_id' value="<%=dstype.Tables[0].Rows[j]["id"] %>"
                                    selected>
                                    <%=dstype.Tables[0].Rows[j]["Tname"]%>
                                </option>
                                <%}
                                  else
                                  {
                                %>
                                <option id='<%=dstype.Tables[0].Rows[j]["id"] %>_di' value="<%=dstype.Tables[0].Rows[j]["id"] %>">
                                    <%=dstype.Tables[0].Rows[j]["Tname"]%>
                                </option>
                                <%
                                    }

                                } %>
                            </select>

                            <script>
                            function chang(obj){
                                document.getElementById("hid_id").value=obj.value;
                            }
                            </script>

                            <input type="hidden" id="hid_id" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            是否显示：
                        </td>
                        <td>
                            <input type="radio" runat="server" id="show" name="isshow" checked />是
                            <input type="radio" runat="server" id="noshow" name="isshow" />否
                        </td>
                    </tr>
                    <tr>
                        <td>
                            提交时间：
                        </td>
                        <td>
                            <input type="text" id="txt_submittime" runat="server" class="texttime" style="width:120px;" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',skin:'whyGreen',autoPickDate:'null'})" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="list-foot">
                            <input id="btnSubmit" type="button" class="btn-app" runat="server" onserverclick="btnSubmit_ServerClick" />
                        </td>
                    </tr>
                </table>

                <script type="text/javascript">tdshowm("list");</script>

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