echo "<input type=\"hidden\" name=\"groupName\" id=\"groupName\"  value=\"" . $group->name . "\" />";
       echo '<script type="text/javascript"><!--
 
 function select_all(name, value) {
   formblock = document.getElementById("readWrite");
   forminputs = formblock.getElementsByTagName("input");
   for (i = 0; i < forminputs.length; i++) {
     // regex here to check name attribute
     var regex = new RegExp(name, "i");
     if (regex.test(forminputs[i].getAttribute("name"))) {
       forminputs[i].checked = value;
     }
   }
 }
 //--></script>';
       $paginas = $groups->getAllMainPagesWithGroup($group->id);
       if (isset($paginas)) {
           echo "<table id='the-list-x' width='100%' cellpadding='3' cellspacing='3'>";
           echo "<tr class=\"thead\">";
           echo "<th scope='col' rowspan='2'>Page</th>";
           echo "<th scope='col' colspan='3'>Exclusive Access</th>";
           echo "</tr>";
           echo "<tr class=\"thead\">";
           echo "<th scope='col' style='width:7em'>Read</th>";
           echo "<th scope='col' style='width:7em'>Write</th>";
           echo "</tr>";
           $alt = true;
           pagesByParent($paginas, $alt, $groups, $group->id);
           echo "<tr >";
           echo "<td scope='col'>&nbsp;</td>";
           echo "<td scope='col' style='text-align:center;'>" . "<a href='#' onclick='select_all(\"pages_read\", true);'>All</a>" . " / <a href='#' onclick='select_all(\"pages_read\", false);'>None</a></td>";