// JavaScript Document
function doValidations()
{
	var lastName2,firstName2,email2,company2,phone2;

	lastName2=document.getElementById("lastName2").value;
	firstName2=document.getElementById("firstName2").value;
	company2=document.getElementById("company2").value;
	email2=document.getElementById("email2").value;
	phone2=document.getElementById("phone2").value;

	emailVal = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;

	if(firstName2=="")
	{
		alert("First Name field is blank.");
		document.getElementById("firstName2").focus();
	}
	else if(lastName2=="")
	{
		alert("Last Name field is blank.");
		document.getElementById("lastName2").focus();	
	}
	else if(company2=="")
	{
		alert("Company field is blank.");
		document.getElementById("company2").focus();	
	}
	else if(email2=="")
	{
		alert("Email Address field is blank.");
		document.getElementById("email2").focus();
	}
	else if(!emailVal.test(email2))
	{
		alert("Email Address is not a valid format.");
		document.getElementById("email2").focus();
	}
	else if(phone2=="")
	{
		alert("Phone field is blank.");
		document.getElementById("phone2").focus();	
	}
	else
	{
		document.forms['contacts'].submit();
	}
}