function checkUncheckAll(theElement) {
         //documentation for this script at http://www.shawnolson.net/a/693/
     var theForm = theElement.form, z = 0;
     while (theForm[z].type == 'checkbox' && theForm[z].name != 'checkall') {
      theForm[z].checked = theElement.checked;
      z++;
     }
}

 