function CheckAll (pendingform, state)
{
  var counter = 0;
  while (pendingform.elements[counter] != null)
  {
    if (("checkbox".indexOf(pendingform.elements[counter].type)) != -1)
    {
      if (pendingform.elements[counter].checked != state)
      {
        pendingform.elements[counter].checked = state;
      }
    }
    counter++;
  }
  return false;
}
