/////////////////////////////
//
//Generic registration form check.
//
	function RegVal(theForm) {
		if (theForm.rformSocName.value == ("")) {
			alert ("Please enter your Society Name.");
			theForm.rformSocName.focus();
			return (false);
		}
		if (theForm.rformContact.value == "") {
			alert ("Please enter your Name.");
			theForm.rformContact.focus();
			return (false);
		}
		if (theForm.rformEmail.value.length < 5 || theForm.rformEmail.value.indexOf("@") < 1) {
			alert ("Please enter your Email Address.");
			theForm.rformEmail.focus();
			return (false);
		}
		if (theForm.rformPosn.value == "") {
			alert ("Please enter your Position within the Society or Club.");
			theForm.rformPosn.focus();
			return (false);
		}
		if (theForm.rformAddress.value == "") {
			alert ("Please enter your Address.");
			theForm.rformAddress.focus();
			return (false);
		}
		if (theForm.rformCity.value == "") {
			alert ("Please enter your Postal City or Town.");
			theForm.rformCity.focus();
			return (false);
		}
		if (theForm.rformPostCode.value == "") {
			alert ("Please enter your Zip or Post Code.");
			theForm.rformPostCode.focus();
			return (false);
		}
		if (theForm.rformCountyState.value == "") {
			alert ("Please enter your State, County or Province.");
			theForm.rformCountyState.focus();
			return (false);
		}
		if (theForm.rformCountry.value == "") {
			alert ("Please enter your Country of residence.");
			theForm.rformCountry.focus();
			return (false);
		}
		li=theForm.rformLogin.value;
		if (li.length < 6 || li.length > 20 || li.indexOf(".") > -1) {
			alert ("Please enter a Login that is between 6 and 20 characters in length using alpha-numeric characters only.");
			theForm.rformLogin.value = "";
			theForm.rformLogin.focus();
			return (false);
		}
		pw=theForm.rformPW.value;
		if (pw.length < 6 || pw.length > 20 || pw.indexOf(".") > -1) {
			alert ("Please enter a Password that is between 6 and 20 characters in length using alpha-numeric characters only.");
			theForm.rformPW.value = "";
			theForm.formConfirm.value = "";
			theForm.rformPW.focus();
			return (false);
		}
		if (pw != theForm.formConfirm.value) {
			alert("The Password field does not correspond\nwith the Confirm Password field.\n\n" +
			"Please re-enter both and try again.");
			theForm.rformPW.value = "";
			theForm.formConfirm.value = "";
			theForm.rformPW.focus();
			return (false);
		}
		if (theForm.name == "SocietyReg") {
			if(confirm("Please check your registration details carefully; if" +
			" any\nof the listed items are incorrect then click the Cancel\nbutton to make" +
			" the required changes.\n\n" +
			"Society Name:		" + theForm.rformSocName.value + "\n" +
			"Your Name:		" + theForm.rformContact.value + "\n" +
			"Email Address:		" + theForm.rformEmail.value + "\n" +
			"Your Position:		" + theForm.rformPosn.value + "\n" +
			"Society Contact Address:\n			" + theForm.rformAddress.value + "\n" +
			"City or Town:		" + theForm.rformCity.value + "\n" +
			"Zip or Post Code:		" + theForm.rformPostCode.value + "\n" +
			"State or County:		" + theForm.rformCountyState.value + "\n" +
			"Country:			" + theForm.rformCountry.value + "\n" +
			"Telephone:		" + theForm.formPhone.value + "\n" +
			"Site Log-In:		" + theForm.rformLogin.value)) {
				return (true);
			}
			else {
				return(false);
			}
		}
	}

/////////////////////////////
//
//Login form check.
//
	function SocLogVal(theForm) {
		if (theForm.rformLogin.value == "") {
			alert ("Please enter a Login.");
			theForm.rformLogin.focus();
			return (false);
		}
		if (theForm.rformPW.value == "") {
			alert ("Please enter your Password.");
			theForm.rformPW.focus();
			return (false);
		}
		return (true);
	}

/////////////////////////////
//
//Forgotton login & Password Form Check.
//
	function flpw(theForm) {
		if (theForm.rformEmail.value == "" || theForm.rformEmail.value.indexOf("@")==-1) {
			alert ("Please enter a valid email address.");
			theForm.rformEmail.focus();
			return (false);
		}
	}

/////////////////////////////
//
//Admin Login form check.
//
	function AdminLogVal(theForm) {
		if (theForm.rformAdminPW.value == "") {
			alert ("Please enter Your Admin Password!");
			theForm.rformAdminPW.focus();
			return (false);
		}
	}

/////////////////////////////
//
//Login form check.
//
	function loginhelp() {
		open("loghlp.html", "Log_In_Help", "Height=400,Width=400,status=no,toolbar=no,menubar=no,location=no");
	}

/////////////////////////////
//
//Set focus to login box.
//
	function loginfocus() {
		document.SocLogIn.rformLogin.focus();
	}

/////////////////////////////
//
//Set admin login focus to Admin PW box.
//
	function adminloginfocus() {
		document.AdminLogIn.rformAdminPW.focus();
	}