	function CheckForm () 
	{ 

		//Initialise variables
		var errorMsg = "";
		var max=20;
		//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.lastName.value == "")
		{
			errorMsg += "\n\tLast Name \t- Enter your Last Name";
		}
		//Check for a address
		if (document.frmEnquiry.street1.value == "")
		{
			errorMsg += "\n\tHome address \t- Enter your Address";
		}
	 	
		//Check for a city
		if (document.frmEnquiry.town.value == "")
		{
			errorMsg += "\n\tHome City \t- Enter your City";
		}

		//Check for post no
		if (document.frmEnquiry.postCode.value == "")
		{
			errorMsg += "\n\tPost Code \t- Enter your Post Code";
		}	 	

		//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 post no
		if (document.frmEnquiry.tel.value == "")
		{
			errorMsg += "\n\tTele Phone \t- Enter your Tele Phone";
		}	

		//Check for an enquiry
		if (document.frmEnquiry.enquiry.value > max)
		{ 
 			errorMsg += "\n\tEnquiry \t\t- Please do not enter more than 20 characters. Please shorten your entry and submit again";
		}	
		//If there is a problem with the form then display an error
		if (errorMsg != "")
		{
			msg = "______________________________________________________________\n\n";
			msg += "Your enquiry 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;
	}

function ismaxlength(obj)
{
	var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
	if (obj.getAttribute && obj.value.length>mlength)
	obj.value=obj.value.substring(0,mlength)
}
	