
	
//Check the inquiry form is filled in correctly
function CheckForm () { 

	//Initialise variables
	var errorMsg = "";

	
	//Check for a first name
	if (document.myform.name.value == ""){
		errorMsg += "\n\tEnter your Name";	
	}
	

	
	//Check for a phone number
	if (document.myform.phone.value == ""){
		errorMsg += "\n\tEnter your phone number";
	}

//Check for an e-mail address and that it is valid
if ((document.myform.email.value == "") || (document.myform.email.value.length > 0 && (document.myform.email.value.indexOf("@",0) == - 1 || document.myform.email.value.indexOf(".",0) == - 1))) { 
	errorMsg += "\n\tEnter your valid e-mail address";
}

	
	//Check for an inquiry
	if (document.myform.message.value == "") { 
 		errorMsg += "\n\tEnter your comments";
	}
	//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;
}
