<%@ page language="C#" autoeventwireup="true" inherits="general_SystemManage_RoleRights_Edit, CrmCommand" %>

<!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>
    <script>

var MENU_ID_ARRAY = new Array();

MENU_ID_ARRAY[0]="01";
MENU_ID_ARRAY[1]="02";
MENU_ID_ARRAY[2]="03";
MENU_ID_ARRAY[3]="05";
MENU_ID_ARRAY[4]="09";
MENU_ID_ARRAY[5]="20";
MENU_ID_ARRAY[6]="30";


function check_all(menu_all,MENU_ID)
{

 for (i=0;i<document.all(MENU_ID).length;i++)
 {
   if(menu_all.checked)
      document.all(MENU_ID).item(i).checked=true;
   else
      document.all(MENU_ID).item(i).checked=false;
 }

 if(i==0)
 {
   if(menu_all.checked)
      document.all(MENU_ID).checked=true;
   else
      document.all(MENU_ID).checked=false;
 }
  CheckAll();
}
function mysubmit()
{
  func_id_str="";

  //一级菜单数量
  for(j=1;j<=7;j++)
  {
    menu_id=MENU_ID_ARRAY[j-1]+'';

    for(i=0;i<document.all(menu_id).length;i++)
    {
        el=document.all(menu_id).item(i);
        if(el.checked)
        {  val=el.value;
           func_id_str+=val + ",";
        }
    }

    if(i==0)
    {
        el=document.all(menu_id);
        if(el.checked)
        {  val=el.value;
           func_id_str+=val + ",";
        }
    }
  }
 
  //document.getElementById("lblFuncIdStr").value = func_id_str;

}


 function CheckAll()
{
    document.getElementById("lblFuncIdStr").value ="";
    var objForm = document.forms["form1"];
    var objLen = objForm.length;
    for (var iCount = 0; iCount < objLen; iCount++)
    {
		if (objForm.elements[iCount].type == "checkbox")
		{
		  
		   if(objForm.elements[iCount].checked)
		   {
		       
		     
 		        document.getElementById("lblFuncIdStr").value =document.getElementById("lblFuncIdStr").value+ objForm.elements[iCount].value+",";
 		      
//		        if(document.getElementById(chkid).checked)
//		        {
//			         objForm.elements[iCount].checked = true;
//			    }
//			    else
//			    {
//					  objForm.elements[iCount].checked = false;
//			    }
            }
	
			
		}
		
    }
}
</script>
</head>
<body class="bodycolor" topMargin="5" >
    <form id="form1" runat="server">
   <div id="pnlMain">
	
				<TABLE class="small" cellSpacing="0" cellPadding="3" width="100%" border="0">
					<TR>
						<TD class="Big"><IMG height="20" src="../images/notify_new.gif" width="22" align="absMiddle"><SPAN class="big3">
								编辑角色权限 - （<asp:Label ID="LblDept" runat="server" Text=""></asp:Label>）</SPAN>&nbsp;&nbsp;
								
						</TD>
					</TR>
					<TR>
						<TD class="Big"></TD>
					</TR>
				</TABLE>
				<TABLE class="small" cellSpacing="1" cellPadding="3" border="0">
					<TR>
						<TD align="left">
							<table border="0" cellspacing="1" class="small" cellpadding="2" align="center">
<tr>
  <td  valign="top">
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
  </td>
  <td  valign="top">
<asp:Literal ID="Literal2" runat="server"></asp:Literal>
  </td>
  <td  valign="top">
<asp:Literal ID="Literal3" runat="server"></asp:Literal>
  </td>
  <td  valign="top">
<asp:Literal ID="Literal4" runat="server"></asp:Literal>
  </td>
  <td  valign="top">
<asp:Literal ID="Literal5" runat="server"></asp:Literal>
  </td>
  <td  valign="top">
<asp:Literal ID="Literal6" runat="server"></asp:Literal>
  </td>
  <td  valign="top">
<asp:Literal ID="Literal7" runat="server"></asp:Literal>
  </td>
</tr>
</table>
</TD>
					</TR>
					<TR>
						<TD class="TableControl" align="center">
						<input name="lblFuncIdStr" runat=server  id="lblFuncIdStr" type="hidden" /><asp:Button ID="ButUpdate"
                            runat="server" Text="确定" OnClientClick="mysubmit();"  CssClass="BigButton" OnClick="ButUpdate_Click" />&nbsp;&nbsp;
							<INPUT class="BigButton" onclick="javascript:history.go(-1);" type="button" value="返回">
						</TD>
					</TR>
				</TABLE>
			
</div>
    </form>
</body>
</html>
