<%@ page language="C#" autoeventwireup="true" inherits="WebAdmin_ArticleAdd, 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 id="Head1" runat="server">
    <title>文章添加</title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/css.css" media="screen"/>
    <script type="text/javascript" language="javascript" src="js/topHead.js"></script>
    <script src="js/checked.js" type="text/javascript"></script>
    <link href="css/tipswindown.css" type="text/css" rel="stylesheet" />
    <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">
        var $=jQuery;
        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 resizeEditor2(name,size) {   
	        var newheight = parseInt(document.getElementById(name).style.height) + size;
	        if(newheight >= 60) {   
		        document.getElementById(name).style.height = newheight + 'px';   
	        }   
        } 
        function validate(){
            var flag=true;
            if(document.getElementById("txt_title").value==""){
                document.getElementById("msg_title").innerHTML="<span class='msg_submit'>文章标题不能为空！</span>";
                flag=false;
            }else{
                document.getElementById("msg_title").innerHTML="";
            }
            return flag;
        }
        function maxCount(){
            var tt=document.getElementById("TextArea2");

            if(tt.value.length>200){
                tt.value=tt.value.substring(0, 200);
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" onsubmit="return validate()">
        <script>header(5,0,"images/");</script>
        <div class="blank clearfix"></div>
        <!--功能区-->
        <div class="tabmenus mainwidth">
            <ul>
                <li><a href="ArticleList.aspx"><span>文章管理</span></a></li>
                <li><a href="ArticleSelect.aspx"><span>文章查询</span></a></li>
                <li class="current"><a href="articleadd.aspx"><span>文章添加</span></a></li>
            </ul>
        </div>
        <div class="tab-mainbody">
            <div class="tab-mainbody2">
                <div class="functionHandleArea clearfix">
                    <input id="Button2" type="button"  runat="server" class="btn-app" onserverclick="Button1_ServerClick"/>
                    <input type="image" name="Submit" title=" 重填 " onClick="reset();return false;" src="images/bt_res.gif" align="absmiddle" />
                    <input type="image" title=" 返回 " onclick="history.back();return false;" src="images/bt_bak.gif" align="absmiddle" /></div>
                <div id="datalist">
                    <table cellspacing="0" border="0" id="list" style="width: 100%; border-collapse: collapse;">
                    <!-- table 导航 -->
                        <tr>
                            <th class="td_right td_left" colspan="2" align=left >文章添加</th>
                        </tr>
                        <tr>
                            <td style="width:10%" >
                                类别
                            </td>
                            <td style="width:90%">
                               <select id="Select1" runat="server">                            
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td style="width:10%" >
                                标题
                            </td>
                            <td style="width:90%">
                               <input type="text" runat="server" id="txt_title" class="input" style="width:500px" /><span id="msg_title"></span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                内容
                            </td>
                            <td>
                                <FCKeditorV2:FCKeditor ID="fck" runat="server" BasePath="~/images/js/fckeditor/" Height="200px" Width="650px"></FCKeditorV2:FCKeditor>
                                    <a  href="javascript:resizeEditor('fck',-100)"><img style="margin-top:4px" src="images/bt_close.gif" border='0'></a>
                                    &nbsp;<a href="javascript:resizeEditor('fck',150)"><img style="margin-top:4px" src="images/bt_open.gif" border='0'></a>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                提要：
                            </td>
                            <td>
                                <textarea id="TextArea2" cols="60" class="input-textarea"  style="height:60px;margin-bottom:4px" runat="server" onkeyup="maxCount()"  onkeydown="maxCount()"></textarea>&nbsp;&nbsp;<em>少于200字</em><br />
                                <a href="javascript:resizeEditor2('TextArea2',-20)"><img src="images/bt_close.gif" border='0'></a>
                                <a href="javascript:resizeEditor2('TextArea2',20)"><img src="images/bt_open.gif" border='0'></a>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                来源：
                            </td>
                            <td>
                                <input type="text" runat="server" id="txt_source" class="input" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                图文：
                            </td>
                            <td>
                                <input type=file runat="server" id="file1" class="input"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                头条
                            </td>
                            <td>
                                <input id="Checkbox1" type="checkbox"  runat="server"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                推荐
                            </td>
                            <td>
                                <input id="Checkbox2" type="checkbox"  runat="server"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                浏览次数：
                            </td>
                            <td>
                                <input type="text" runat="server" id="txt_count" class="input" value="0"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                提交时间：
                            </td>
                            <td>
                                <input type="text" id="txt_time" class="texttime"  runat=server onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',skin:'whyGreen',autoPickDate:'null'})" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                审核：
                            </td>
                            <td>
                                <input id="Checkbox3" type="checkbox" checked runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="list-foot">
                                <input id="Button1" type="button"  runat="server" class="btn-app" onserverclick="Button1_ServerClick"/>
                            </td>
                        </tr>
                    </table>
                    <script type="text/javascript">tdshowm("list");</script>
                    <script type="text/javascript">
                        var fc='<%=returnValue %>';
                        var i = 2;
                        if(fc=="true"){
                            tipsWindown("提示","text:操作成功！","250","60","true","2000","true","");
                            setInterval("fun()", 1000);
                        }
                        if(fc=="false"){
                            tipsWindown("提示","text:操作失败！","250","60","true","3000","true","");
                        }
                        if(fc=="no")
                        {
                           tipsWindown("提示","text:内容不能为空！","250","60","true","3000","true",""); 
                        }
                        function fun() {
                            if (i == 1) {
                                window.location.href="ArticleList.aspx";
                            }
                            i--;
                        }
                    </script>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
