// JavaScript Document
function validateForm(form) { //This is the name of the function

if (form.firm.value == "") { //This checks to make sure the field is not empty
   alert("The \"Name of Firm\" field is empty. Please enter the Firm Name."); //Informs user of empty field
   form.firm.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
}

if (form.name.value == "") { //This checks to make sure the field is not empty
   alert("The \"Contact Name\" field is empty. Please enter the Contact Name."); //Informs user of empty field
   form.name.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
}

if (form.email.value == "") { //This checks to make sure the field is not empty
   alert("The \"Email\" field is empty. Please enter your email address."); //Informs user of empty field
   form.email.focus( ); //This focuses the cursor on the empty field
   return false; //This prevents the form from being submitted
}

//function to check valid email address

validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
strEmail = document.forms[0].email.value;

// search email text for regular exp matches
if (strEmail.search(validRegExp) == -1) {
	alert('Sorry, but a valid e-mail address is required.\nPlease amend and retry.');
	return false;
} 

}