function RadioChecked(name) {
	// Check an option on radio is selected [Form must have more than 1 option defined]
	var iIndex;
	var oField = form1[name];
	for (iIndex = 0; iIndex < oField.length; iIndex++) {
		if (oField[iIndex].checked)
      			return (true);
	}
	return false;
}

function RadioValue(name) {
	// Return value of Radio Button
	var iIndex;
	var oField = form1[name];
	for (iIndex = 0; iIndex < oField.length; iIndex++) {
		if (oField[iIndex].checked)
      			return oField[iIndex].value;
	}
	return "";
}

function EMailValid(name) {

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-0123456789_.@";
	sField = form1[name].value;

	// Remove leading spaces
	for (i = 0; i < sField.length; i++) {
		if (sField.charAt(i) != ' ') break;
	}
	sField = sField.substr(i, sField.length - i);

	// Remove trailing spaces
	for (i = sField.length - 1; i >= 0; i--) {
		if (sField.charAt(i) != ' ') break;
	}
	sField = sField.substr(0, i + 1);
	
	if (sField.length == 0) return ("empty");
	if (sField.indexOf("@") == -1) return ("missing '@'");
	if (sField.indexOf(".") == -1) return ("missing '.'");

	// Check the remainder of the string for valid characters
	for (i = 0;  i < sField.length;  i++) {
	  	ch = sField.charAt(i);
	  	for (j = 0;  j < checkOK.length;  j++)
	  		if (ch == checkOK.charAt(j)) break;
		if (j == checkOK.length) {
	  		//alert("The " + sDescript + " field contains an invalid character at position " + (i + 1) + "[code: " + ch.charCodeAt(0) + ", len: " + sField.length + "]");
	  		return("invalid character at position " + (i + 1));
		}
	}

	return ("");
}
