<!--
function ValidateInput(form) {

//----------------------------------------------------
// The ValidateInput function is called when the user
// clicks the Submit button. Before the values are
// submitted, this function makes sure that
// entries have entered correctly.
//
// returns: returns true if all entries are valid
//			Outputs an alert box if errors are found, then returns false.
//----------------------------------------------------

	var LB = "\n"; // Line Break
	var msghdr = "Your form contains the following errors:" + LB + LB;
	var valmissing = "Entry missing in: ";
	var valincorrect = "Invalid entry in: ";
	var missingmsg = "";
	var incorrectmsg ="";
	var msg;



	var validName = /^[-a-z\s\.\']+$/i;
	var validCity =/^[-a-z\s\.\']+$/i;
	var validAddr =/^[-a-z0-9\s\.\#\(\)\,\']+$/i;
	var validZipcode = /(^\d{5}$)|(^\d{5}-\d{4}$)/;
	var validPhone = /((\(\d{3}\) ?)|(\d{3}[- \.]))?\d{3}[- \.]\d{4}$/;
	var validEmail = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;

//------------------------------------- Name --------------------------------------
	if (!form.firstName.value) missingmsg = missingmsg + "First Name" + LB;
		else { 
		if (!validName.test(form.firstName.value))
			 incorrectmsg = incorrectmsg + "First Name" + LB;
		}
	if (!form.lastName.value) missingmsg = missingmsg + "Last Name" + LB;
		else {
		if (!validName.test(form.lastName.value))
			 incorrectmsg = incorrectmsg + "Last Name" + LB;
		}

//------------------------------------- Address --------------------------------------
	if (!form.addr1.value) missingmsg = missingmsg + "Address 1" + LB;
		else { 
		if (!validAddr.test(form.addr1.value))
			 incorrectmsg = incorrectmsg + "Address 1" + LB;
		}
	if (form.addr2.value)
		if (!validAddr.test(form.addr2.value))
		 incorrectmsg = incorrectmsg + "Address 2" + LB;

//------------------------------------- City --------------------------------------
	if (!form.city.value) missingmsg = missingmsg + "City" + LB;
		else {
		if (!validCity.test(form.city.value))
			incorrectmsg = incorrectmsg + "City" + LB;
		}

//------------------------------------- Zip code --------------------------------------
// Make sure that the user enters a zip code and that it is valid: either 5 digits or 5 digits, a dash, and 4 more digits.
	if (!form.zipcode.value) missingmsg = missingmsg + "Zip Code" + LB;
		else {
		if (!validZipcode.test(form.zipcode.value))
			incorrectmsg = incorrectmsg + "Zip Code" + LB;
		}

//------------------------------------- Email --------------------------------------
	if (!form.email.value) missingmsg = missingmsg + "Email" + LB;
		else {
			if (!validEmail.test(form.email.value))
				incorrectmsg = incorrectmsg + "Email" + LB;
		}

//------------------------------------- Day Phone --------------------------------------
	if (form.dayphone.value) 
		if (!validPhone.test(form.dayphone.value))
			incorrectmsg = incorrectmsg + "Day Phone" + LB;	

//------------------------------------- Eve Phone --------------------------------------
	if (form.evephone.value) 
		if (!validPhone.test(form.evephone.value))
			incorrectmsg = incorrectmsg + "Evening Phone" + LB;
	
//------------------------------------- Cell Phone --------------------------------------
	if (form.cellphone.value) 
		if (!validPhone.test(form.cellphone.value))
			incorrectmsg = incorrectmsg + "Cell Phone" + LB;
	

//--------------------------------- Display Alert box ---------------------------------
// Display an alert if any of the input is missing:
 	if ((missingmsg.length > 0) || (incorrectmsg.length > 0)) {
		msg = msghdr;
		if (missingmsg.length > 0) msg += valmissing + LB + missingmsg;
		if (incorrectmsg.length > 0) msg += LB + valincorrect + LB + incorrectmsg
		alert(msg);
		return false;
	}
   return true;
}

function ValidateEmail(form) {

//----------------------------------------------------
// The ValidateEmail function is called when the user
// clicks the Submit button. Before the values are
// submitted, this function makes sure that
// the email address has been entered correctly.
//
// returns: returns true if all entries are valid
//			Outputs an alert box if errors are found, then returns false.
//----------------------------------------------------

	var LB = "\n"; // Line Break
	var msghdr = "Your entry contains the following errors:" + LB + LB;
	var valmissing = "Entry missing in: ";
	var valincorrect = "Invalid entry in: ";
	var missingmsg = "";
	var incorrectmsg ="";
	var msg;

	var validEmail = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
	
//------------------------------------- Email --------------------------------------
	if (!form.email.value) missingmsg = missingmsg + "Email" + LB;
		else {
			if (!validEmail.test(form.email.value))
				incorrectmsg = incorrectmsg + "Email" + LB;
		}
	

//--------------------------------- Display Alert box ---------------------------------
// Display an alert if any of the input is missing:
 	if ((missingmsg.length > 0) || (incorrectmsg.length > 0)) {
		msg = msghdr;
		if (missingmsg.length > 0) msg += valmissing + LB + missingmsg;
		if (incorrectmsg.length > 0) msg += LB + valincorrect + LB + incorrectmsg
		alert(msg);
		return false;
	}
   return true;
}

function ValidateAllowed(form) {

//----------------------------------------------------
// The ValidateAllowed function is called when the user
// clicks the Submit button. Before the values are
// submitted, this function makes sure that
// the allowed group for restricted enrollment has been entered correctly.
//
// returns: returns true if all entries are valid
//			Outputs an alert box if errors are found, then returns false.
//----------------------------------------------------

	var LB = "\n"; // Line Break
	var msghdr = "Your entry contains the following errors:" + LB + LB;
	var valmissing = "Entry missing in: ";
	var valincorrect = "Invalid entry in: ";
	var missingmsg = "";
	var incorrectmsg ="";
	var msg;

	var validAllowed =/^[-a-z0-9\s\.\#\(\)\,\']+$/i;

	
//------------------------------------- Allowed Group --------------------------------------
	if (!form.allowedGroup.value) missingmsg = missingmsg + "Allowed Group" + LB;
		else {
			if (!validAllowed.test(form.allowedGroup.value))
				incorrectmsg = incorrectmsg + "Allowed Group" + LB;
		}
	

//--------------------------------- Display Alert box ---------------------------------
// Display an alert if any of the input is missing:
 	if ((missingmsg.length > 0) || (incorrectmsg.length > 0)) {
		msg = msghdr;
		if (missingmsg.length > 0) msg += valmissing + LB + missingmsg;
		if (incorrectmsg.length > 0) msg += LB + valincorrect + LB + incorrectmsg
		alert(msg);
		return false;
	}
   return true;
}

function ValidateClass(form) {

//----------------------------------------------------
// The ValidateClass function is called when the user
// clicks the Submit button. Before the values are
// submitted, this function makes sure that
// entries have entered correctly.
//
// returns: returns true if all entries are valid
//			Outputs an alert box if errors are found, then returns false.
//----------------------------------------------------

	var LB = "\n"; // Line Break
	var msghdr = "Your form contains the following errors:" + LB + LB;
	var valmissing = "Entry missing in: ";
	var valincorrect = "Invalid entry in: ";
	var missingmsg = "";
	var incorrectmsg ="";
	var msg;



	var validDate = /^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])/;
	var validTime = /^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?/;
	var validLocation =/^[-a-z0-9\s\.\#\(\)\,\']+$/i;
	var validMaxSize = /^\d+/;


//------------------------------------- Dates --------------------------------------
	if (!form.startDate.value) missingmsg = missingmsg + "Start Date" + LB;
		else { 
		if (!validDate.test(form.startDate.value))
			 incorrectmsg = incorrectmsg + "Start Date" + LB;
		}
	if (!form.endDate.value) missingmsg = missingmsg + "End Date" + LB;
		else {
		if (!validDate.test(form.endDate.value))
			 incorrectmsg = incorrectmsg + "End Date" + LB;
		}
//------------------------------------- Times --------------------------------------
	if (!form.startTime.value) missingmsg = missingmsg + "Start Time" + LB;
		else { 
		if (!validTime.test(form.startTime.value))
			 incorrectmsg = incorrectmsg + "Start Time" + LB;
		}
	if (!form.endTime.value) missingmsg = missingmsg + "End Time" + LB;
		else {
		if (!validTime.test(form.endTime.value))
			 incorrectmsg = incorrectmsg + "End Time" + LB;
		}

//------------------------------------- Location --------------------------------------
	if (!form.location.value) missingmsg = missingmsg + "Location" + LB;
		else { 
		if (!validLocation.test(form.location.value))
			 incorrectmsg = incorrectmsg + "Location" + LB;
		}

//------------------------------------- maxSize --------------------------------------
	if (!form.maxSize.value) missingmsg = missingmsg + "Maximum Size" + LB;
		else {
		if (!validMaxSize.test(form.maxSize.value))
			incorrectmsg = incorrectmsg + "Maximum Size" + LB;
		}
	

//--------------------------------- Display Alert box ---------------------------------
// Display an alert if any of the input is missing:
 	if ((missingmsg.length > 0) || (incorrectmsg.length > 0)) {
		msg = msghdr;
		if (missingmsg.length > 0) msg += valmissing + LB + missingmsg;
		if (incorrectmsg.length > 0) msg += LB + valincorrect + LB + incorrectmsg
		alert(msg);
		return false;
	}
   return true;
}

function ValidateFee(form) {

//----------------------------------------------------
// The ValidateFee function is called when the user
// clicks the Submit button. Before the values are
// submitted, this function makes sure that
// the fee paid has been entered correctly.
//
// returns: returns true if all entries are valid
//			Outputs an alert box if errors are found, then returns false.
//----------------------------------------------------

	var LB = "\n"; // Line Break
	var msghdr = "Your entry contains the following errors:" + LB + LB;
	var valmissing = "Entry missing in: ";
	var valincorrect = "Invalid entry in: ";
	var missingmsg = "";
	var incorrectmsg ="";
	var msg;

	var validFee = /^\d+/;
	
//------------------------------------- Fee Paid --------------------------------------
	if ((!form.feePaid.value) && (!form.feeWaived.value)) missingmsg = missingmsg + "Fee Paid" + LB;
		else if (!form.feeWaived.value) {
			if (!validFee.test(form.feePaid.value))
				incorrectmsg = incorrectmsg + "Fee Paid" + LB;
		}
	

//--------------------------------- Display Alert box ---------------------------------
// Display an alert if any of the input is missing:
 	if ((missingmsg.length > 0) || (incorrectmsg.length > 0)) {
		msg = msghdr;
		if (missingmsg.length > 0) msg += valmissing + LB + missingmsg;
		if (incorrectmsg.length > 0) msg += LB + valincorrect + LB + incorrectmsg
		alert(msg);
		return false;
	}
   return true;
}

function ValidateCourse(form) {

//----------------------------------------------------
// The ValidateCourse function is called when the user
// clicks the Submit button. Before the values are
// submitted, this function makes sure that
// entries have entered correctly.
//
// returns: returns true if all entries are valid
//			Outputs an alert box if errors are found, then returns false.
//----------------------------------------------------

	var LB = "\n"; // Line Break
	var msghdr = "Your form contains the following errors:" + LB + LB;
	var valmissing = "Entry missing in: ";
	var valincorrect = "Invalid entry in: ";
	var missingmsg = "";
	var incorrectmsg ="";
	var msg;

	var validCourse =/^[-a-z0-9\s\.\#\(\)\,\']+$/i;
	var validYearsValid = /^\d{1,2}$/;
	var validMinAge = /^\d{1,2}$/;



//------------------------------------- Course Nmae --------------------------------------
	if (!form.courseName.value) missingmsg = missingmsg + "Course Name" + LB;
		else { 
		if (!validCourse.test(form.courseName.value))
			 incorrectmsg = incorrectmsg + "Course Name" + LB;
		}

//------------------------------------- Year Valid --------------------------------------
	if (!form.yearsValid.value) missingmsg = missingmsg + "Years until recertification" + LB;
		else { 
		if (!validYearsValid.test(form.yearsValid.value))
			incorrectmsg = incorrectmsg + "Years until recertification" + LB;
		}

//------------------------------------- Min Age --------------------------------------
	if (form.minAge.value) {
		if (!validMinAge.test(form.minAge.value))
			incorrectmsg = incorrectmsg + "Minimum age" + LB;
		}
	

//--------------------------------- Display Alert box ---------------------------------
// Display an alert if any of the input is missing:
 	if ((missingmsg.length > 0) || (incorrectmsg.length > 0)) {
		msg = msghdr;
		if (missingmsg.length > 0) msg += valmissing + LB + missingmsg;
		if (incorrectmsg.length > 0) msg += LB + valincorrect + LB + incorrectmsg
		alert(msg);
		return false;
	}
   return true;
}

function ValidateFee(form) {

//----------------------------------------------------
// The ValidateFee function is called when the user
// clicks the Submit button. Before the values are
// submitted, this function makes sure that
// the fee paid has been entered correctly.
//
// returns: returns true if all entries are valid
//			Outputs an alert box if errors are found, then returns false.
//----------------------------------------------------

	var LB = "\n"; // Line Break
	var msghdr = "Your entry contains the following errors:" + LB + LB;
	var valmissing = "Entry missing in: ";
	var valincorrect = "Invalid entry in: ";
	var missingmsg = "";
	var incorrectmsg ="";
	var msg;

	var validFee = /^\d+/;
	
//------------------------------------- Fee Paid --------------------------------------
	if ((!form.feePaid.value) && (!form.feeWaived.value)) missingmsg = missingmsg + "Fee Paid" + LB;
		else if (!form.feeWaived.value) {
			if (!validFee.test(form.feePaid.value))
				incorrectmsg = incorrectmsg + "Fee Paid" + LB;
		}
	

//--------------------------------- Display Alert box ---------------------------------
// Display an alert if any of the input is missing:
 	if ((missingmsg.length > 0) || (incorrectmsg.length > 0)) {
		msg = msghdr;
		if (missingmsg.length > 0) msg += valmissing + LB + missingmsg;
		if (incorrectmsg.length > 0) msg += LB + valincorrect + LB + incorrectmsg
		alert(msg);
		return false;
	}
   return true;
}

function ValidateCouncil(form) {

//----------------------------------------------------
// The ValidateCouncil function is called when the user
// clicks the Submit button. Before the values are
// submitted, this function makes sure that
// the allowed group for restricted enrollment has been entered correctly.
//
// returns: returns true if all entries are valid
//			Outputs an alert box if errors are found, then returns false.
//----------------------------------------------------

	var LB = "\n"; // Line Break
	var msghdr = "Your entry contains the following errors:" + LB + LB;
	var valmissing = "Entry missing in: ";
	var valincorrect = "Invalid entry in: ";
	var missingmsg = "";
	var incorrectmsg ="";
	var msg;

	var validCouncil =/^[-a-z\s\.\(\)\,\']+$/i;

	
//------------------------------------- Council --------------------------------------
	if (!form.councilName.value) missingmsg = missingmsg + "Council Name" + LB;
		else {
			if (!validCouncil.test(form.councilName.value))
				incorrectmsg = incorrectmsg + "Council Name" + LB;
		}
	

//--------------------------------- Display Alert box ---------------------------------
// Display an alert if any of the input is missing:
 	if ((missingmsg.length > 0) || (incorrectmsg.length > 0)) {
		msg = msghdr;
		if (missingmsg.length > 0) msg += valmissing + LB + missingmsg;
		if (incorrectmsg.length > 0) msg += LB + valincorrect + LB + incorrectmsg
		alert(msg);
		return false;
	}
   return true;
}
//-->

