function validEmail(email) {

    var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
    var regex = new RegExp(emailReg);

	if (regex.test(email) == false)
		return false;
	else
		return true;
	
}

function validate(form){
	var validForm = "";

	if (form.email.value == "") {
		validForm += "Please enter your email address.\n";
		} else if(validEmail(form.email.value) == false) {
			validForm += "Please enter a valid email address.\n";
		}

	if (form.contactname.value == "")
		validForm += "Please enter the contact name.\n";

	if (form.facilityperson.value == "")
		validForm += "Please enter the facility person.\n";

	if (form.address.value == "")
		validForm += "Please enter the address.\n";
		
	if (form.city.value == "")
		validForm += "Please enter the city.\n";
		
	if (form.state.selectedIndex == 0)
		validForm += "Please select the state.\n";

	if (form.zip.value == "")
		validForm += "Please enter the zip code.\n";
		
	if (form.phone.value == "")
		validForm += "Please enter the phone number.\n";

	if(validForm) {
		alert(validForm);
		return false;
	} else
		return true;
		
}
