function validate() {
	
	theform = document.contactus;
	
	if (theform.email.value != theform.emailConfirm.value)
		{
		alert('The email addresses you entered do not match, please try again.');
		return false;
		}
	/*
	theform.FirstName.required = true;
	theform.FirstName.requiredError = 'The First Name field must be filled in.';
	
	theform.LastName.required = true;
	theform.LastName.requiredError = 'The Last Name field must be filled in.';
	*/
	theform.message.required = true;
	theform.message.requiredError = 'Please type your message in the space provided.';
	
//	theform.ContactReason.required = true;
//	theform.ContactReason.requiredError = 'Please select a primary reason for contacting us.';
//	theform.ContactReason.disallowEmptyValue = true;
//	theform.ContactReason.disallowEmptyValueError = 'Please select a primary reason for contacting us.';
	
	theform.email.required = true;
	theform.email.requiredError = 'The Email field must be filled in.';
	
	if (theform.email.value != ""){
	theform.email.pattern = 'email';
	theform.email.patternError = 'The Email address entered is not valid.';
	}
	else{
		theform.email.pattern = '';
	}
	
	theform.emailConfirm.required = true;
	theform.emailConfirm.requiredError = 'The Confirm Email field must be filled in.';
	
//	theform.EmailConfirm.pattern = 'email';
	//theform.EmailConfirm.patternError = 'The Email Confirmation address entered is not valid.';
	
	
	
	theform.firstName.required = true;
	theform.firstName.requiredError = 'Please enter your first name.';

	theform.lastName.required = true;
	theform.lastName.requiredError = 'Please enter your last name.';
	
//	theform.City.required = true;
//	theform.City.requiredError = 'The City field must be filled in.';
	
//	theform.Country.required = true;
//	theform.Country.requiredError = 'A Country must be selected.';
//	theform.Country.disallowEmptyValue = true;
//	theform.Country.disallowEmptyValueError = 'A Country must be selected.';
	/*
	if ((theform.Country.options[theform.Country.selectedIndex].value == "US") || (theform.Country.options[theform.Country.selectedIndex].value == "CA")) {
		theform.State.required = true;
		theform.State.requiredError = 'A State/Province must be selected.';
		theform.State.disallowEmptyValue = true;
		theform.State.disallowEmptyValueError = 'A State/Province must be selected.';
		theform.Province.required = false;
	}
	else {
		theform.Province.required = true;
		theform.Province.requiredError = 'The State/Province field must be filled in.';
		theform.State.required = false;
		theform.State.disallowEmptyValue = false;
	}
	
	if (theform.Country.options[theform.Country.selectedIndex].value == "US") {
		theform.Zip.pattern = 'zipcode';
		theform.Zip.patternError = 'The US Zip Code entered is not valid (must be exactly 5 numeric digits).';
	}
	else if (theform.Country.options[theform.Country.selectedIndex].value == "CA") {
		theform.Zip.pattern = 'postal code';
		theform.Zip.patternError = 'The Canadian Postal Code entered is not valid (use ANA NAN or ANA-NAN format).';
	}
	else {
		theform.Zip.required = true;
		theform.Zip.requiredError = 'The Zip/Postal Code field must be filled in.';
		theform.Zip.pattern = '';
	}
	
	if ((theform.Country.options[theform.Country.selectedIndex].value == "US") || (theform.Country.options[theform.Country.selectedIndex].value == "CA")) {
		theform.DaytimePhone.pattern = 'us phone number';
		theform.DaytimePhone.patternError = 'The Work Phone number is not valid.';
		theform.EveningPhone.pattern = 'us phone number';
		theform.EveningPhone.patternError = 'The Home (or Cell) Phone number is not valid.';
	}
	else {
		theform.DaytimePhone.required = true;
		theform.DaytimePhone.requiredError = 'The Work Phone number field must be filled in.';
		theform.EveningPhone.required = true;
		theform.EveningPhone.requiredError = 'The Home (or Cell) Phone number field must be filled in.';
		theform.DaytimePhone.pattern = '';
		theform.EveningPhone.pattern = '';
	}
	
	
//	theform.YearHSGED.required = true;
//	theform.YearHSGED.requiredError = 'A year of high school graduation or GED completion must be selected.';
//	theform.YearHSGED.disallowEmptyValue = true;
//	theform.YearHSGED.disallowEmptyValueError = 'A year of high school graduation or GED completion must be selected.';

	theform.ProgramIDList.required = true;
	theform.ProgramIDList.requiredError = 'A Program of interest must be selected.';
	theform.ProgramIDList.disallowEmptyValue = true;
	theform.ProgramIDList.disallowEmptyValueError = 'A Program of interest must be selected.';

// Need to validaet this as well 	
	theform.birthMonth.required = true;
	theform.birthMonth.requiredError = 'Please choose the month of your birthdate';
	theform.birthMonth.disallowEmptyValue = true;
	theform.birthMonth.disallowEmptyValueError = 'Please choose the month of your birthdate.';
	
	theform.birthDay.required = true;
	theform.birthDay.requiredError = 'Please choose the day of your birthdate'
	theform.birthDay.disallowEmptyValue = true;
	theform.birthDay.disallowEmptyValueError = 'Please choose the day of your birthdate.';
	
	theform.birthYear.required = true;
	theform.birthYear.requiredError = 'Please choose the year of your birthdate'
	theform.birthYear.disallowEmptyValue = true;
	theform.birthYear.disallowEmptyValueError = 'Please choose the year of your birthdate.';
	
//Validation for the date of birth using IsDate
if ((theform.birthMonth.options[theform.birthMonth.selectedIndex].value != '') & (theform.birthDay.options[theform.birthDay.selectedIndex].value != '') & (theform.birthYear.options[theform.birthYear.selectedIndex].value != ''))
{

dob = theform.birthMonth.options[theform.birthMonth.selectedIndex].value + "/" + theform.birthDay.options[theform.birthDay.selectedIndex].value + "/" + theform.birthYear.options[theform.birthYear.selectedIndex].value;

alert(dob);
}


*/

//If the visitor enters a phone number, make sure it is valid
/*
	if (theform.PhoneNumber.value != ''){
		theform.PhoneNumber.pattern = 'us phone number';
		theform.PhoneNumber.patternError = 'The Phone number is not valid. Please make sure you included the area code.';
	}
		else {
			
			theform.PhoneNumber.pattern = '';			
		}


//Reason for contacting	
	theform.ReasonForContacting.required = true;
	theform.ReasonForContacting.requiredError = 'Please tell us why you are contacting us'
	theform.ReasonForContacting.disallowEmptyValue = true;
	theform.ReasonForContacting.disallowEmptyValueError = 'Please tell us why you are contacting us.';

//Message Details	
	theform.ContactMessage.required = true;
	theform.ContactMessage.requiredError = 'Please provide the details of your reason for contacting us.'
	//theform.ContactMessage.disallowEmptyValue = true;
	//theform.ContactMessage.disallowEmptyValueError = 'Years of work experience must be selected.';
*/
	
//Here is where we call the getFormErrors function in the form_validation.js script to create the array

	var errors = getFormErrors(theform);
	if (errors.length > 0) {
		var errorMessage = 'The form was not submitted due to the following problem' + ((errors.length > 1) ? 's' : '') + ':\n\n';
		for (var errorIndex = 0; errorIndex < errors.length; errorIndex++) {
			errorMessage += '* ' + errors[errorIndex] + '\n';
		}
		errorMessage += '\nPlease fix ' + ((errors.length > 1) ? 'these' : 'this') + ' problem' + ((errors.length > 1) ? 's' : '') + ' and resubmit the form.';
		alert(errorMessage);
		return false;
	}
	

	/* submit the form once all validation is complete */
	theform.submit();
}