function doselectAll(theBox,name){
  xState=theBox.checked;
  elm=theBox.form.elements;
  for(i=0;i<elm.length;i++)
   if(elm[i].type=="checkbox" && elm[i].name==name)
     elm[i].checked=xState;
}