// JavaScript Document

function validate() {	
	// Sets the initial error message
	var errorMessage = "Please complete the following fields: ";	
	// Check to see if a fields value has changed
	function checkField(inputName,defaultText) {
		if (document.getElementById("html_mail_form")[inputName].value==defaultText) {
			errorMessage = errorMessage + " [ " + defaultText +  " ] ";
		}
	}
	// Input fields to check
	checkField("FirstName","First Name");
	checkField("LastName","Last Name");
	checkField("Address1","Address 1");
	checkField("City","City");
	checkField("State","State");
	checkField("Email","Email");
	checkField("Phone","Phone");
	// Submits form if all required fields have been completed
	if (errorMessage == "Please complete the following fields: ") {
	return true;
	}
	// Alerts error message and kills submission
	else {
	alert(errorMessage);
	return false;
   	}
}
