


function getCheckedRadioVal(question_name) {
		val = '0';
		q = document.getElementsByName(question_name);
		$A(q).each( function(input) {
			if (input.checked) val=input.value;
		} );
		return val;
}

function hasBeenAnswered(question_name) {
		q = document.getElementsByName(question_name);
		retval = false;
		$A(q).each( function(input) {
			if (input.checked) retval=true;
		} );
		return retval;
}

function isValidEmail(email) {
	var error = "";
	var emailFilter=/^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(email))) {
		return false; 
	} else {
		var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
		if (email.match(illegalChars)) {
			return false;
		} else {
			return true;
		}
	}
	return true;    
}
		
function processFormChecks(erCnt,erMsg) {
	if (erCnt>0) {
		if (erCnt==1) {
			erMsgPrefix="There was an error:\n\n";
			erMsgSuffix="\nPlease correct the error and resubmit the form.";
		} else {
			erMsgPrefix="There were "+erCnt+" errors:\n\n";
			erMsgSuffix="\nPlease correct the errors and resubmit the form.";
		}
		alert(erMsgPrefix+erMsg+erMsgSuffix+"           ");
		return false;
	} else {
		return true;
	}
}


