//***************************************************************
//  Validation routines for Baldwin Restaurant
//
//  If errors are found, they are added to alert string
//  which is presented at the end of the check.
// ***************************************************************

function validate(){

var hasErrors = "no";

var errorMsg = "All fields must be complete before the form can be submitted.\n\n";
	errorMsg+= "Please fill in the following information:\n\n";


if(document.contactform.name.value == ""){
	errorMsg += "Name\n";
	hasErrors = "yes";
}
		
if(document.contactform.email.value == ""){
	errorMsg += "Email Address\n";
	hasErrors = "yes";
}
	
if(document.contactform.comments.value == ""){
	errorMsg += "Comments\n";
	hasErrors = "yes";
}

//Add buffer for scrolling
	errorMsg += "\n\n";

if(hasErrors == "yes"){
	alert(errorMsg);
	return false;
}
else
	return true;
}
