<%@ page language="C#" autoeventwireup="true" inherits="WebAdmin_Commodity_type_add, LebiMall" %>
<!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>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript" src="js/Common.js"></script>
    <script type="text/javascript" src="js/checked.js"></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 src="js/topHead.js" type="text/javascript"></script>
    <script type="text/javascript">
            var $=jQuery;
            function cleckTrue(){
                var flag = true;
                if(!checkTxt_name()){
                     flag = false;
                }
                if(!checkTxt_sort()){
                     flag = false;
                }
                if(!checkTxt_bt()){
                     flag = false;
                }
                
                return flag;
            }
            function checkTxt_name(){
                if(document.getElementById("txt_name").value==""){
                    document.getElementById("lbltxt_name").innerHTML="<span class='msg_submit'>类型名称不能为空！</span>";
                    return false;
                }
                else{
                    document.getElementById("lbltxt_name").innerHTML="";
                    return true;
                }
            }
            function checkTxt_sort(){
                 if(document.getElementById("txt_sort").value==""){
                    document.getElementById("lbltxt_sort").innerHTML="<span class='msg_submit'>分类排序不能为空！</span>";
                     return false;
                }else{
                    document.getElementById("lbltxt_sort").innerHTML="";
                     return true;
                }
            }
            function checkTxt_bt(){
                if(document.getElementById("txt_bt").value==""){
                      document.getElementById("lbltxt_bt").innerHTML="<span class='msg_submit'>类别标题不能为空！</span>";
                      return false;
                }else{
                     document.getElementById("lbltxt_bt").innerHTML="";
                      return true;
                }
            }
            
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <input type="hidden" name="hidsort" id="hidsort" />
        <script>header(2,1,"images/");</script>
   
    <!--面包屑-->
    <div class="blank clearfix"></div>
    
    <!--功能区-->
    <div class="tabmenus mainwidth">
        <ul>
            <li><a href="CommonityType.aspx"><span>类别管理</span></a></li>
            <li class="current"><a href="Commodity_type_Add.aspx"><span>类别添加</span></a></li>
        </ul>
    </div>
    <div class="tab-mainbody">
        <div class="tab-mainbody2">
        <div class="functionHandleArea clearfix">
             <input type="image" border="0" title=" 保存 " onclick="cleckTrue();return false;" src="images/bt_app.gif"
                align="absmiddle" onserverclick="Image1_ServerClick">
            <input type="image" name="Submit" title=" 重填 " onclick="reset();return false;" src="images/bt_res.gif"
                align="absmiddle">
            <input type="image" border="0" title=" 返回 " runat="server" src="images/bt_bak.gif" align="absmiddle" id="Image2" onserverclick="Image2_ServerClick">
        </div>
        <div id="datalist">
                <table cellpadding="0" cellspacing="0"  width="100%" id="list">
                    <tr>
                        <th>
                            添加商品类别</th>
                        <th>
                            <span class="title_r" id="msg_sub"></span>
                            <script type="text/javascript">
                                var i = 2;
                                var f="<%=returnValue %>";
                                 if(f=="true"){
                                        tipsWindown('操作结果','text:操作成功！','250','60','true','2000','true','text');
                                        <% Session["returnValue"]= null; %>
                                        setInterval("fun()", 1000);
                                    }
                                    if(f=="false"){
                                        tipsWindown('操作结果','text:操作失败！','250','60','true','2000','true','text');
                                        <% Session["returnValue"]= null; %>
                                    }
                                function fun() {
                                    if (i == 1) {
                                        window.location.href="CommonityType.aspx";
                                    }
                                    i--;
                                }
                        </script>
                        </th>
                    </tr>
                    <tr >
                        <td width="15%" >
                            类型名称：
                        </td>
                        <td >
                            <input type="text" runat="server" id="txt_name" class="input" onblur="checkTxt_name();" /><span
                                id="lbltxt_name"></span>
                        </td>
                    </tr>
                    <tr >
                        <td >
                            所属分类
                        </td>
                        <td >
                            <asp:TextBox ID="txtHeadID" Enabled="false" class="input" runat="server" MaxLength="150" AutoPostBack="True"
                                ReadOnly="True">一级分类</asp:TextBox>
                            <asp:HiddenField ID="hftxtHeadID" runat="server" Value="0" />
                            <input id="btnGetCatagory" type="button" onclick="OpenDialogArticleCategory('txtHeadID')"
                                value="" class="btn-choose" /><span id="img" style="display: none;"><img src="images/043.gif" /></span>
                        </td>
                    </tr>
                    <tr >
                        <td >
                            首页显示：
                        </td>
                        <td>
                            <input type="radio" id="istrue" runat="server" checked name="shou"/>是
                            <input type="radio" id="isfalse" name="shou" runat="server"/>否
                        </td>
                    </tr>
                    <tr >
                        <td >
                            分类排序：
                        </td>
                        <td >
                            <input type="text" runat="server" id="txt_sort" size="5" class="input" value="0" onkeyup="value=value.replace(/[^\d]/g,'')"
                                onblur="value=value.replace(/[^\d]/g,''),checkTxt_sort();" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />
                            <span id="lbltxt_sort" ></span>
                        </td>
                    </tr>
                    <tr >
                        <td >
                           关键字
                        </td>
                        <td >
                            <input type="text" runat="server" id="txt_bt" class="input"  value="" onblur="checkTxt_bt();" />
                            <span id="lbltxt_bt"></span>
                        </td>
                    </tr>
                    <tr >
                        <td >
                            描述：
                        </td>
                        <td  >
                            <textarea id="txt_ms" runat="server" style="height:100px; width:400px;" class="input-textarea" ></textarea>
                            <span id="lbltxtDescript" ></span> <span id="spdescript"></span><br />
                            <input type="image" src="images/bt_close.gif" onclick="javascript:resizeEditor2('txt_ms',-50);return false;" />
                            <input type=image src="images/bt_open.gif" onclick="javascript:resizeEditor2('txt_ms',50);return false;" />

                            <span id="lbltxt_ms"></span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"  class="list-foot">
                        <input type="image" border="0" title=" 保存 " onclick="return cleckTrue();" runat="server"  src="images/bt_app.gif"
                                align="absmiddle" id="Image1" onserverclick="Image1_ServerClick">
                           
                        </td>
                    </tr>
                </table>
                <script type="text/javascript">tdshowm("list");</script>
            </div>
        </div></div>
    </form>
</body>
</html>
