/*this function retrieves the value of a radio button on a given form*/
function getRadioValue(formname, radioname) {
	var radiobuttons = document[formname][radioname];

  if (radiobuttons) {
  	if (radiobuttons.length == undefined) {
  		return radiobuttons.value
  	} else  {
      for (i=0;i<radiobuttons.length;i++){
          if (radiobuttons[i].checked) {
              return radiobuttons[i].value;
          }
      }
    }
  }
}

/*this function sets the value of a radio button on a given form*/
function setRadioValue(formname, radioname, radiovalue) {
  var radiobuttons = document[formname][radioname];

  if (radiobuttons) {
    for (i=0;i<radiobuttons.length;i++){
      var tmp = radiobuttons[i].value;
      if (tmp == radiovalue) {
        radiobuttons[i].checked = true;
      }
    }
  }
}

/*this function retrieves the value of a select list on a given form*/
function getSelectListValue(formname, selectname) {
  var theMenu = document[formname][selectname];

  if (theMenu) {
    var selecteditem = theMenu.selectedIndex;
    return theMenu.options[selecteditem].value;
  }
}

/*this function sets the value of a select list on a given form*/
function setSelectListValue(formname, selectname, selectvalue) {
  var theMenu = document[formname][selectname];

  if (theMenu) {
    for (i=0;i<theMenu.options.length;i++){
      var tmp = theMenu.options[i].value;
      if (tmp == selectvalue) {
        theMenu.selectedIndex = i;
      }
    }
  }
}

/**
* Method is called when a user checks or unchecks a single checkbox.
*/
function checkBoxClick(objCurrentCheckBox, strCheckAllName) {
  var objCheckAll = eval("document.forms[0]." + strCheckAllName);

  if (objCheckAll) {
    if (!objCurrentCheckBox.checked) {
      objCheckAll.checked = false;
    }
  }
}
