function SetCategory(FormName, FieldName, CheckField)
{
	if(!document.forms[FormName])
		return;
	if(document.forms[FormName].elements[CheckField].checked==true){
	  var CheckValue=true;
	} else {
	  var CheckValue=false;
	}
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}

function SetAll( FormName, CheckField ){
  el = document.forms[FormName].elements;
  if(document.forms[FormName].elements[CheckField].checked==true){
    var CheckValue=true;
  } else {
    var CheckValue=false;
  }
  for (i=0;i < el.length;i++) {
    if(el[i].type.toLowerCase()=="checkbox"){
      el[i].checked = CheckValue;
    }
  }
}
