function CountryChange(){

	var theForm = document.RequestInfoForm;
	
	if (theForm.Country.options[theForm.Country.selectedIndex].value != "US") {
		theForm.Zip.disabled = true;
		theForm.State.disabled = true;
		theForm.DaytimePhone.maxLength = '20';
		theForm.EveningPhone.maxLength = '20';
		document.getElementById('StateNotRequired').style.visibility = 'visible';
		document.getElementById('ZipNotRequired').style.visibility = 'visible';
	}
	if ((theForm.Country.options[theForm.Country.selectedIndex].value == '') || (theForm.Country.options[theForm.Country.selectedIndex].value == 'US')){
		theForm.Zip.disabled = false;
		theForm.State.disabled = false;
		theForm.DaytimePhone.maxLength = '10';
		theForm.DaytimePhone.value = theForm.DaytimePhone.value.substring(0,10);
		theForm.EveningPhone.maxLength = '10';
		theForm.EveningPhone.value = theForm.EveningPhone.value.substring(0,10);		
		document.getElementById('StateNotRequired').style.visibility = 'hidden';
		document.getElementById('ZipNotRequired').style.visibility = 'hidden';
	}

}

function submitrequest() {	
	theform = document.RequestInfoForm;
	
	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.Address.required = true;
	theform.Address.requiredError = 'The Address field must be filled in.';
	
	theform.City.required = true;
	theform.City.requiredError = 'The City field must be filled in.';
	
	if ((theform.CollegeID.value == 3) && (theform.Country.value != 'US')) {
	theform.State.required = false;
	theform.State.requiredError = '';
	theform.State.disallowEmptyValue = false;
	theform.State.disallowEmptyValueError = '';
	}
	else{
	theform.State.required = true;
	theform.State.requiredError = 'A State must be selected.';
	theform.State.disallowEmptyValue = true;
	theform.State.disallowEmptyValueError = 'A State must be selected.';
	}
	
	if (theform.Country.value != 'US') {
		theform.Zip.required = false;
		theform.Zip.pattern = '';
	}
	else {
	theform.Zip.required = true;
	theform.Zip.requiredError = 'The Zip field must be filled in.';
	theform.Zip.pattern = 'zipcode';
	theform.Zip.patternError = 'The US Zip Code entered is not valid (must be exactly 5 numeric digits).';
	}
	
	if (theform.CollegeID.value == 3){
	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.CollegeID.value == 3) && (theform.Country.value == 'US')) {
	theform.DaytimePhone.required = true;
	theform.DaytimePhone.requiredError = 'Please enter your Home Phone number, digits only.';
	theform.DaytimePhone.pattern = 'us phone number';
	theform.DaytimePhone.patternError = 'The Home Phone number is not valid.';
	}
	else if (theform.Country.value == 'US'){
	theform.DaytimePhone.required = true;
	theform.DaytimePhone.requiredError = 'Please enter your Home Phone number, digits only.';
	theform.DaytimePhone.pattern = 'us phone number';
	theform.DaytimePhone.patternError = 'The Home Phone number is not valid.';
	}
	else {
		theform.DaytimePhone.required = true;
		theform.DaytimePhone.requiredError = 'Please enter your Home Phone number, digits only.';
		theform.DaytimePhone.pattern = '';
		theform.DaytimePhone.patternError = '';
	}
	
	
	theform.Email.required = true;
	theform.Email.requiredError = 'The Email Address field must be filled in.';
	theform.Email.pattern = 'email';
	theform.Email.patternError = 'The Email Address entered is not valid.';

	theform.ProgramsOfInterest.required = true;
	theform.ProgramsOfInterest.requiredError = 'A Program of interest must be selected.';
	theform.ProgramsOfInterest.disallowEmptyValue = true;
	theform.ProgramsOfInterest.disallowEmptyValueError = 'A Program of interest must be selected.';

	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.BestTimeToCall.required = true;
	theform.BestTimeToCall.requiredError = 'Please choose the Best Time To Call.';
	theform.BestTimeToCall.disallowEmptyValue = true;
	theform.BestTimeToCall.disallowEmptyValueError = 'Please choose the Best Time To Call.';

	
	
	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;
	}


//This eveneing phone check is here AFTER the other validation so the form does nto get submitted with an improper
// phone number here	
	if (theform.EveningPhone.value != '') {
	theform.EveningPhone.pattern = 'us phone number';
	theform.EveningPhone.patternError = 'The Cell Phone number is not valid.';
		
		if (theform.Country.value == 'US'){
			if (theform.EveningPhone.value.length != 10) {
				alert('The Cell Phone number is not valid.');
				return false;
			}
			else {
			theform.EveningPhone.pattern = '';
			}
		}
		
	}
	
	
	// disable all buttons to avoid multi-submit
//	disableButtons(theform);
	
	// alert to avoid multiple-submit
//	submitAlert();
	
	/* submit the form once all validation is complete */
	theform.submit();
}