<%@ page autoeventwireup="true" inherits="_N25_Role_lookset, App_Web_m37mpoil" language="C#" %>

<!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/StyleSheet.css" rel="stylesheet" type="text/css" />
    <link href="../css/GridView.css" rel="stylesheet" />
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../css/pager.css" rel="stylesheet" type="text/css" />

    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>

    <script src="../jquery-1.5.js" type="text/javascript"></script>

    <link href="../window/_css/window.css" rel="stylesheet" type="text/css" />

    <script language="javascript" src="../window/message/jquery.message.js" type="text/javascript"></script>

    <script language="javascript" src="../window/jquery/jquery.min.js" type="text/javascript"></script>

    <script language="javascript" src="../window/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>

    <script language="javascript" src="../window/jquery.bgiframe.pack.js" type="text/javascript"></script>

    <link href="../window/_css/jqueryui/blitzer/jquery-ui-1.8.12.custom.css" rel="stylesheet"
        type="text/css" />
    <link href="../alert/jquery.alert.css" rel="stylesheet" type="text/css" />

    <script src="../alert/jquery.easydrag.js" type="text/javascript"></script>

    <script src="../alert/jquery.alert.js" type="text/javascript"></script>

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

    <script type="text/javascript">

    
       function ll_show(t)
       {
     
      var div_show= document.getElementById (t);
      div_show.style.display="block";
         var show=document.getElementById ("show_"+t);
      var hide=document.getElementById ("hide_"+t);
      show.style.display="none";
      hide.style.display="block";
       
       }
           function ll_hide(t)
       {
      
      var div_show= document.getElementById (t);
      var show=document.getElementById ("show_"+t);
      var hide=document.getElementById ("hide_"+t);
      show.style.display="block";
      hide.style.display="none";
      
      div_show.style.display="none";
       
       
       }
       //----------------
        function selectCheckBoxes(domId,value,p) { 
    
    if (p.checked==true)
    {
    p.value=true;
      var div_show= document.getElementById (domId);
          div_show.style.display="block";
    }
    else
    
    {
   p.value=false;
    
    }
    
    
        var inputs = document.getElementById(domId).getElementsByTagName("input"); 
        
        for(var i = 0; i < inputs.length; i++) { 
            if (inputs[i].type == 'checkbox') { 
                inputs[i].checked=value; 
                inputs[i].value=value;
                
            } 
        } 
    } 

       
       //-----------------------------------
       function list_chick(p,id)
       {
       
       if (p.checked==true)
       {
      // alert(id);
           p.value=true;    
      
           var div_show= document.getElementById (id);
          div_show.style.display="block";
       //   var ck=document.getElementById("ck_"+id);
         // ck.checked=true; 
            
          var ckb = document.getElementsByName("ck_"+id);
        for(var i=0;i<ckb.length;i++){
           
               ckb[i].checked = true;
           
              
        }
  var ckc = document.getElementsByName("child_"+id);
        for(var i=0;i<ckc.length;i++){
           
               ckc[i].checked = true;
      
        }
          

          
        }
        else
        {
        
      
          var ckb = document.getElementsByName("ck_"+id);
        for(var i=0;i<ckb.length;i++){
           
               ckb[i].checked = false;
           
              
        }
         var ckc = document.getElementsByName("child_"+id);
        for(var i=0;i<ckc.length;i++){
           
               ckc[i].checked = false;
      
        }
          p.value=false;
        //alert('未选中!!');
        }
              
       }
       //--------------------------------------------------
         function list_chick_1(p,partid,mainid)
       {
       
       if (p.checked==true)
       {
    //   alert(partid+"---"+mainid);
        
      
           p.value=true;
        var zoor_ck=document.getElementById ("zoor_"+partid);
        zoor_ck.checked=true;
        zoor_ck.value=true;
        
//  var ckc = document.getElementsByName("child_"+partid);
//        for(var i=0;i<ckc.length;i++){
//           if (ckc[i].id=="child_"+mainid)
//           {
//               ckc[i].checked = true;
//               ckc[i].value=true;
//      }
//        }
   var inputs = document.getElementById(partid).getElementsByTagName("input"); 
      
        for(var i = 0; i < inputs.length; i++) 
        
        { 
            if (inputs[i].type == 'checkbox') { 
                if (inputs[i].id=="child_"+mainid )
                {
                
               inputs[i].checked=true;
                inputs[i].value=true;
                }
                            
                
                
               
            } 
        } 


          

          
        }
        else
        {
        
        
        
       
//         var ckc = document.getElementsByName("child_"+partid);
//        for(var i=0;i<ckc.length;i++){
//              if (ckc[i].id=="child_"+mainid)
//           {
//               ckc[i].checked = false;
//               ckc[i].value=false;
//           }
//        }
          var inputs = document.getElementById(partid).getElementsByTagName("input"); 
      
        for(var i = 0; i < inputs.length; i++) 
        
        { 
            if (inputs[i].type == 'checkbox') { 
                if (inputs[i].id=="child_"+mainid )
                {
                
               inputs[i].checked=false;
                inputs[i].value=false;
                }
                            
                
                
               
            } 
        } 
          
          var flage=0;
//          var ck=document.getElementsByName ("ck_"+partid);
//            for(var i=0;i<ck.length;i++){
//              if (ck[i].checked==false)
//           {
//             flage=0;
//           }else
//           {
//           flage=1;
//           break;
//           }
//        }

var inputs1 = document.getElementById(partid).getElementsByTagName("input"); 
 
  for(var i = 0; i < inputs1.length; i++) 
        
        { 
            if (inputs1[i].type == 'checkbox') { 
               
                if (inputs1[i].checked==true)
                {
                flage=1;
                break;
                }
                else
                {
                flage=0;
                }
                
                
               
               
            } 
        } 


          if (flage==0)
            {
            var zoor_ck=document.getElementById ("zoor_"+partid);
        zoor_ck.checked=false;
        zoor_ck.value=false;
          }
           p.value=false;
        //alert('未选中!!');
        }
             
       }
       
       
       //--------------------------------
       
       function child_check(p,partid,mainid)
       {
     
       if (p.checked==true)
       {
       p.value=true;
       var zoor_ck=document.getElementById ("zoor_"+partid);
        zoor_ck.checked=true;
        zoor_ck.value=true;
         var ck=document.getElementById ("ck_"+mainid);
        ck.checked=true;
        ck.value=true;
       
       }
       else 
       
       {
       p.value=false;
       var k=0;
       
         var inputs = document.getElementById(partid).getElementsByTagName("input"); 
      
        for(var i = 0; i < inputs.length; i++) 
        
        { 
            if (inputs[i].type == 'checkbox') { 
                if (inputs[i].id=="child_"+mainid &&  inputs[i].checked==true)
                {
                k=1;
                break;
                }
                else
                {
                k=0;
                }
               
            } 
        } 
      
       
//         var ckc = document.getElementsByName("child_"+partid);
//        for(var i=0;i<ckc.length;i++)
//            {
//             if (ckc[i].id=="child_"+mainid)
//           {
//            if( ckc[i].checked==true)
//            {
//            k=1;
//            break;
//            }
//            else
//            {
//            k=0;
//            }
//            }
//            
//            }
            if (k==0)//未选中状态
            {
            
         var ck=document.getElementById ("ck_"+mainid);
        ck.checked=false;
        ck.value=false;
           
            } 
       
            
            
            
//          var ck=document.getElementsByName ("ck_"+partid+"_"+mainid);
//          alert(ck.length)
//            for(var i=0;i<ck.length;i++){
//              if (ck[i].checked==false)
//           {
//             flage=0;
//           }else
//           {
//           flage=1;
//           break;
//           }
//        }
        var flage=0;

 var inputs1 = document.getElementById(partid).getElementsByTagName("input"); 
 
  for(var i = 0; i < inputs1.length; i++) 
        
        { 
            if (inputs1[i].type == 'checkbox') { 
               
                if (inputs1[i].checked==true)
                {
                flage=1;
                break;
                }
                else
                {
                flage=0;
                }
                
                
               
               
            } 
        } 


          if (flage==0)
            {
            var zoor_ck=document.getElementById ("zoor_"+partid);
        zoor_ck.checked=false;
        zoor_ck.value=false;
          }
            
       
       
         
       
       
       }
      // alert(partid+"----"+mainid);
       
       }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div class="title">
            <asp:Label ID="lblList" runat="server" Text="角色设置查看"></asp:Label>
        </div>
        
        <table border="0" cellpadding="0" cellspacing="0" class="table" width="100%">
            <tr>
                <td align="right" class="line" style="width: 130px">
                    角色名字：
                </td>
                <td align="left" class="line">
                    <asp:TextBox ID="RoleName" runat="server" CssClass="text1" Width="158"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 130px">
                    角色描述：
                </td>
                <td align="left">
                    <asp:TextBox ID="RoleDetail" runat="server" CssClass="text1"   Rows="6" TextMode="MultiLine"  Width="280"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" class="line" style="width: 130px">
                    排序：
                </td>
                <td align="left" class="line">
                    <asp:TextBox ID="Rol_sort" CssClass="text1" runat="server" Width="158"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" class="line" style="width: 130px">
                    权限列表：
                </td>
                <td align="left" class="line">
                    <div id="div_1" style="text-align: left">
                    </div>
                </td>
            
            </tr>
            <tr  >
            <td>
            
            </td>
            <td>
                
                <asp:Button ID="Button2" runat="server" CssClass="button_b" Text="返回" OnClick="Button2_Click" />
                
            </td>
            </tr>
            
            
        </table>
      
       
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        </asp:UpdatePanel>
        <div id="message" class="window_message" style="position: absolute; left: 42%; top: 35%;
            display: none">
            <img alt="正在处理请稍等...." src="../images/loading.gif">正在处理请稍等....
        </div>
    </form>
<asp:Label ID="l2" runat="server" ></asp:Label> 
</body>
</html>
