function checkUncheckAll(theElement){
  var theForm = theElement.form, z = 0;
  for(z=0; z<theForm.length;z++){
    if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
      theForm[z].checked = theElement.checked;
    }
  }
}

function checkUncheckAllBlock(theElement, blockNr){
  var theForm = theElement.form
  var z = 0;
  var itemBlockAttribute;
  var itemBlockValue;
  for(z=0; z<theForm.length; z++){
    itemBlockAttribute = theForm[z].attributes.getNamedItem("block");
    if(itemBlockAttribute != null) itemBlockValue = itemBlockAttribute.nodeValue;
    if( itemBlockValue == blockNr ) theForm[z].checked = theElement.checked;
  }
}