// Verify catalog request form.
function Verify (f) {
	var ErrorString = "";
   var isCatalogRequest = !isCheckedByLength(f.catalog);

	if (isBlank(f.firstname)) 	ErrorString += "\n - Please enter your first name";
	if (isBlank(f.lastname)) 	ErrorString += "\n - Please enter your last name";
	if (isCatalogRequest) {
		if (isBlank(f.address)) 	ErrorString += "\n - Please enter your address";
		if (isBlank(f.city)) 		ErrorString += "\n - Please enter your city";
		var countryValue = f.CountryID.options[f.CountryID.selectedIndex].value;	// cross-browser selected value
		if (countryValue == 'USA') {
			if (isSelected(f.StateProvinceID, 0)) 	ErrorString += "\n - Please select a state";
			if (isSelectedOrHigher(f.StateProvinceID, 52)) 	ErrorString += "\n - Please select a U.S. state or territory";
			if (isBlank(f.zip)) { 			ErrorString += "\n - Please enter your zip code";
			} else if (checkZip(f.zip)) {	ErrorString += "\n - Your zip code is in an improper format";
			}
		} else if (countryValue == 'Canada') {
			if (!isSelectedOrHigher(f.StateProvinceID, 52)) 	ErrorString += "\n - Please select a province";
			if (isBlank(f.zip))  	ErrorString += "\n - Please enter your postal code";
		}
		if (isSelected(f.CountryID, 1))  		ErrorString += "\n - Please select a country";
		// if (countryValue == 220 && isBlank(f.zip)) ErrorString += "\n - Please enter your postal code";
	}
	if (isChecked(f.pleaseCall)) {
		if (isBlank(f.email) && isBlank(f.phone)) ErrorString += "\n - Enter your e-mail address or phone number to have a\n\t   Racine Federated representative contact you";
		else if (!isBlank(f.email) && testSimpleEmail(f.email)) ErrorString += "\n - Your e-mail address is not valid";
	}
	if (!isChecked(f.pleaseCall) && !isCatalogRequest) {
		if (isBlank(f.comments)) ErrorString += "\n - Please enter your comments or questions";
		if ((isBlank(f.email) || testSimpleEmail(f.email)) && isBlank(f.phone)) {
			ErrorString += "\n - Please enter either a valid e-mail address or your phone number";
		}
	}

	// If ErrorString has content, there was at least one error; let them know.
	if (ErrorString.length > 0) {
		msg  = "____________________________________________________\n\n";
		msg += "  Your form was not submitted because of the following error(s): \n";
		msg += "____________________________________________________\n";
		alert(msg + ErrorString);
		return false;
	}
}
