
function ValidateForm(theForm)
{
	if(isWhiteSpace(theForm.FirstName.value))
	{
		alert("First Name is a required field.");
		theForm.FirstName.focus();
		return false;
	}	

	if(isWhiteSpace(theForm.LastName.value))
	{
		alert("Last Name is a required field.");
		theForm.LastName.focus();
		return false;
	}	

	if(isWhiteSpace(theForm.Address.value))
	{
		alert("Address is a required field.");
		theForm.Address.focus();
		return false;
	}	

		if(isWhiteSpace(theForm.City.value))
	{
		alert("City is a required field.");
		theForm.City.focus();
		return false;
	}	

		if(isWhiteSpace(theForm.Zip.value))
	{
		alert("Zip is a required field.");
		theForm.Zip.focus();
		return false;
	}	
	
	else if( (theForm.Zip.value.length != 5) || (!isNumeric(theForm.Zip.value) ) )
	{
		alert("Zip code is invalid.");
		theForm.Zip.focus();
		return false;
	}
		
		if(isWhiteSpace(theForm.PhoneSet1.value))
	{
		alert("Phone number is a required field.");
		theForm.PhoneSet1.focus();
		return false;
	}	
	
			if(isWhiteSpace(theForm.PhoneSet2.value))
	{
		alert("Phone number is a required field.");
		theForm.PhoneSet2.focus();
		return false;
	}	
	
			if(isWhiteSpace(theForm.PhoneSet3.value))
	{
		alert("Phone number is a required field.");
		theForm.PhoneSet3.focus();
		return false;
	}	
	
	
	if( (theForm.Phone1.value.length >0 ) ||  (theForm.Phone2.value.length >0) || (theForm.Phone3.value.length > 0) )
	{
		if( (theForm.Phone1.value.length != 3) ||  (theForm.Phone2.value.length != 3) || (theForm.Phone3.value.length != 4) || (!isNumeric(theForm.Phone1.value + theForm.Phone2.value + theForm.Phone3.value) ) )
		{
			alert("Day Phone is invalid.");
			theForm.Phone1.focus();
			return false;
		}	
	}

				if(isWhiteSpace(theForm.Comments.value))
	{
		alert("ALERT.");
		theForm.PhoneSet3.focus();
		return false;
	}

	return true;
}

