function getRadioValue (radioButtonOrGroup) {
  var value = null;
  if (radioButtonOrGroup.length) { // group 
    for (var b = 0; b < radioButtonOrGroup.length; b++)
      if (radioButtonOrGroup[b].checked)
        value = radioButtonOrGroup[b].value;
  }
  else if (radioButtonOrGroup.checked)
    value = radioButtonOrGroup.value;
  return value;
}

function checkRadioControl(strFieldName,strMessage){
 var objFormField = document.asq_form.elements[strFieldName];
 intControlLength = objFormField.length;
 bolSelected = false;
 for (i=0;i<intControlLength;i++){
      if(objFormField[i].checked){
                bolSelected = true;
                break;
      }
 }     
 if(! bolSelected){
      alert("Please select one option for " + strMessage + "!");
      return false;
 }else{
      return true;
 }
}
function hasSelection(strField, strMessage){
	if (strField.selectedIndex == 0){
		alert("Please make a selection from the " + strMessage + "!");
		strField.focus();
		return false;
	}
	return true;
}
function isInteger(val){
	var new_msg = true;
	inputStr = val.toString();
	for (var i = 0; i < inputStr.length; i++){
		var oneChar = inputStr.charAt(i);			
		if ((oneChar < "0" || oneChar > "9") && oneChar != "/"){	
			new_msg = false;
		}
	}
	return (new_msg);
}
function isNotEmpty(InputObj, strMessage){
	if (InputObj.value == ""){
		alert("Please enter the required information for " + strMessage + "!");
		InputObj.focus();
		return false;
	}
	return true;
}
