
	
//Check the inquiry form is filled in correctly
function CheckForm () { 

	//Initialise variables
	var errorMsg = "";

	
	//Check for a first name
	if (document.ContactUs.firstName.value == ""){
		errorMsg += "\n\tFirst Name \t- Enter your First Name";	
	}
	
	//Check for a last name
	if (document.ContactUs.lastName.value == ""){
		errorMsg += "\n\tLast Name \t- Enter your Last Name";	
	}
	
	//Check for a phone number
	if (document.ContactUs.tel.value == ""){
		errorMsg += "\n\tPhone Number \t- Enter your phone number";
	}

	
//Check for an e-mail address and that it is valid
if ((document.ContactUs.email.value == "") || (document.ContactUs.email.value.length > 0 && (document.ContactUs.email.value.indexOf("@",0) == - 1 || document.ContactUs.email.value.indexOf(".",0) == - 1))) { 
	errorMsg += "\n\tE-mail Address \t- Enter your valid e-mail address";
}

	//Check for an company
	if (document.ContactUs.company.value == "") { 
 		errorMsg += "\n\tCompany \t- Enter a company";
	}

	 //Check for address
	//if (document.ContactUs.address.value == ""){
	//	errorMsg += "\n\tAddress \t\t- Enter your address";
	//}
 //Check for city
	//if (document.ContactUs.city.value == ""){
		//errorMsg += "\n\tCity \t\t- Enter your city";
//	}
			
	//Check for an inquiry
	if (document.ContactUs.inquiry.value == "") { 
 		errorMsg += "\n\tMessage \t\t- Enter a message";
	}
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your inquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}
