<%@ page language="C#" autoeventwireup="true" inherits="WebAdmin_CommonityType_up, 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>
    <link href="css/common.css" rel="stylesheet" type="text/css" />
    <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" language="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(!checktxtNameId()){
                     flag = false;
                }
                if(!checktxtSearch()){
                     flag = false;
                }
                if(!checktxtOrder()){
                     flag = false;
                }
                
                return flag;
            }
            function checktxtNameId(){
                if(document.getElementById("txtNameId").value==""){
                    document.getElementById("lbltxtNameId").innerHTML="<span class='msg_submit'>分类名称不能为空！</span>";
                    return false;
                }
                else{
                   document.getElementById("lbltxtNameId").innerHTML="";
                   return true;
                } 
            }
            function checktxtSearch(){
                 if(document.getElementById("txtSearch").value==""){
                    document.getElementById("lbltxtSearch").innerHTML="<span class='msg_submit'>分类关键字不能为空！</span>";
                     return false;
                }
                else{
                   document.getElementById("lbltxtSearch").innerHTML="";
                    return true;
                }
            }
            function checktxtOrder(){
                if(document.getElementById("txtOrder").value==""){
                      document.getElementById("lbltxtOrder").innerHTML="<span class='msg_submit'>分类排序不能为空！</span>";
                      return false;
                }
                else{
                   document.getElementById("lbltxtOrder").innerHTML="";
                   return true;
                }
            }
            
            function resizeEditor2(id,size){
                 var newheight = parseInt(document.getElementById(id).style.height, 10)+size;   
	             if(newheight >= 60) {   
		        document.getElementById(id).style.height = newheight + 'px';   
	            }  
            }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <input type="hidden" id="hidId" runat="server" />
        <script>header(2,1,"images/");</script>
   
    <!--面包屑-->
    <div class="blank clearfix"></div>
    
    <!--功能区-->
   <div class="tabmenus mainwidth">
        <ul>
            <li class="current"><a href="CommonityType.aspx"><span>类别管理</span></a></li>
            <li><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" id="image4" runat="server" border="0" title=" 保存 " onclick="return cleckTrue();" 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 id="list" cellpadding="0" cellspacing="0" runat="server">
                    <tr>
                        <th>
                            编辑商品类别</th>
                        <th>
                            <span class="title_r" id="msg_sub"></span>
                            <script type="text/javascript">
                                var i = 2;
                                var f="<%=Session["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%"  valign="middle">
                            <asp:Label ID="Label1" runat="server" Text="分类名称：" /></td>
                        <td  align="left" valign="middle" style="color: red;">
                            <asp:TextBox ID="txtNameId" runat="server" CssClass="input" MaxLength="50" Text="" onblur="checktxtNameId();" /><span
                                id="spname"></span> <span id="lbltxtNameId" ></span></td>
                    </tr>
                    <tr >
                        <td   valign="middle">
                            <asp:Label ID="Label3" runat="server" Text="所属分类：" /></td>
                        <td  align="left" valign="middle" style="color: red;">
                            <asp:TextBox ID="txtHeadID" Enabled="false" CssClass="input" runat="server" MaxLength="150" AutoPostBack="True"
                                Width="180px" ReadOnly="True">一级分类</asp:TextBox>
                            <asp:HiddenField ID="hftxtHeadID" runat="server" Value="0" />
                            
                            <input id="btnGetCatagory" type="button" onclick="OpenDialogArticleCategory('txtHeadID')"
                                value="" class="btn-choose" <% if(count>0){ %> disabled="disabled" <%} %>/><span id="img" style="display: none;"><img src="images/043.gif" /></span></td>
                    </tr>
                    <tr >
                        <td  height="30"  valign="middle">
                            <asp:Label ID="Label4" runat="server" Text="分类关键字：" /></td>
                        <td  align="left" style="color: red;" valign="middle">
                            <asp:TextBox ID="txtSearch" runat="server"  CssClass="input" MaxLength="100" onblur="checktxtSearch()"></asp:TextBox>
                            <span id="lbltxtSearch" ></span> <span id="spsearch"></span>
                        </td>
                    </tr>
                    <tr >
                        <td   valign="middle">
                            首页显示</td>
                        <td  align="left" valign="middle">
                            <input type="radio" id="istrue" runat="server" name="shou"/>是
                            <input type="radio" id="isfalse" name="shou" runat="server"/>否
                        </td>
                    </tr>
                    <tr >
                        <td  height="30"  valign="middle">
                            <asp:Label ID="Label6" runat="server" Text="分类排序：" /></td>
                        <td  align="left" style="color: red;" valign="middle">
                            &nbsp;<input type="text" id="txtOrder" class="input" value="1000" runat="server" size="5" onkeyup="value=value.replace(/[^\d]/g,'')"
                                onblur="value=value.replace(/[^\d]/g,''),checktxtOrder();" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />&nbsp;
                            <span id="lbltxtOrder" ></span> <span id="sporder"></span>
                        </td>
                    </tr>
                    <tr >
                        <td  height="30"  valign="middle">
                            <asp:Label ID="Label5" runat="server" Text="分类描述：" /></td>
                        <td  align="left" style="color: red;" valign="middle">
                            <textarea id="txtDescript" class="input-textarea" runat="server" style="height:100px; width:400px;"></textarea>
                            <span id="lbltxtDescript" ></span> <span id="spdescript"></span><br />
                            <input type="image" src="images/bt_close.gif" onclick="javascript:resizeEditor2('txtDescript',-50);return false;" />
                            <input type=image src="images/bt_open.gif" onclick="javascript:resizeEditor2('txtDescript',50);return false;" />

                        </td>
                    </tr>
                    <tr >
                        <td class="list-foot" colspan="2"> 
                             <input type="image" border="0" title="保存" runat="server"  onclick="return cleckTrue();" 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>
