/* Validates that the email address is in the proper format */
function validate_email(field,alerttxt) {
  with (field) {
      apos=value.indexOf("@")
      dotpos=value.lastIndexOf(".")
      if (apos<1||dotpos-apos<2) { 
		 		 alert(alerttxt);
		    return false;
    	} else {
    		 return true;
    	}
  }
}
			
/* Validates whether something has been entered for this field */
function validate_entered(field,alerttxt,act_length,min_length) {
  with (field) {
	  if (value==null||value==""||act_length<min_length) {
			 alert(alerttxt);
			 return false;
		} else {
			 return true
		}
  }
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
