// JavaScript Document
function CheckForm () { 

	//Initialise variables
	var errorMsg = "";

	//Check for a first name
	if (document.frmEnquiry.firstName.value == ""){
		errorMsg += "\n\tFirst Name \t- Enter your First Name";	
	}
	
	//Check for a last name
	if (document.frmEnquiry.lastName2.value == ""){
		errorMsg += "\n\tLast Name \t- Enter your Last Name";
	}
	

	if (document.frmEnquiry.country.value == "--- Choose One ---") { 
 		errorMsg += "\n\tCountry \t\t- Select a country";
	}
	 	
	//Check for an e-mail address and that it is valid
	if ((document.frmEnquiry.email.value == "") || (document.frmEnquiry.email.value.length > 0 && (document.frmEnquiry.email.value.indexOf("@",0) == - 1 || document.frmEnquiry.email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail Address \t- Enter your valid e-mail address";
	}
			
	//Check for an enquiry
	if (document.frmEnquiry.enquiry.value == "") { 
 		errorMsg += "\n\tEnquiry \t\t- Enter an enquiry";
	}
		
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your comments have not been sent because there are problem(s) with the form.\n";
		msg += "Please ammend and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be ammended: -\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
		
	return true;
}
