function CheckEMail(email) {

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-0123456789_.@";

	// Remove trailing spaces
	for (i = email.length - 1; i >= 0; i--) {
	  	ch = email.charAt(i);
		if (ch != ' ') break;
	}
	email = email.substr(0, i + 1);
	
	if (email.length == 0) return  true;
	if (email.indexOf("@") == -1) false;
	if (email.indexOf(".") == -1) false;

	// Check the remainder of the string for valid characters
	for (i = 0;  i < email.length;  i++) {
	  	ch = email.charAt(i);
	  	for (j = 0;  j < checkOK.length;  j++)
	  		if (ch == checkOK.charAt(j)) break;
		if (j == checkOK.length) {
			return false;
		}
	}

	return true;
}

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 "";
}
