function validate(theForm)
{
	if (theForm.title.value == "*")
	{
	alert("Please select title.");
	theForm.title.focus();
	return (false);
	}
	
	if (theForm.name.value == "")
	{
		alert("Please enter your name.");
		theForm.name.focus();
		return (false);
	}

	var myRegExpr = new RegExp("^([A-Z]+[']?|[ ]?|[-]?)+$","gi");
	if (!myRegExpr.test(theForm.name.value))
	{
	    alert("Please enter only letters, spaces, apostrophe or hyphen in the name field.");
	    theForm.name.focus();
	    return (false);
	}
	
	if (theForm.telephone.value != "")
	{
		myRegExpr.compile("^([0-9]+[ ]?)+$","g");
		if (!myRegExpr.test(theForm.telephone.value))
		{
		    alert("Please enter only numbers and single spaces in the Telephone field.");
		    theForm.telephone.focus();
		    return (false);
		}
	}
	
	if (theForm.email.value == "")
	{
	alert("Please enter a value in the Email field.");
	theForm.email.focus();
	return (false);
	}

	myRegExpr.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$","gi");
	if (!myRegExpr.test(theForm.email.value))
	{
		alert("This does not appear to be a valid Email address.")
	    theForm.email.focus();
	    return (false);
	} 

	if (theForm.mobile.value != "")
	{
		myRegExpr.compile("^([0-9]+[ ]?)+$","g");
		if (!myRegExpr.test(theForm.mobile.value))
		{
		    alert("Please enter only numbers and single spaces in the Mobile field.");
		    theForm.mobile.focus();
		    return (false);
		}
	}

	if (theForm.address.value == "")
	{
	alert("Please enter Address.");
	theForm.address.focus();
	return (false);
	}
	
	myRegExpr.compile("^([A-Z0-9]+[']?|[ ]?|[-]?|[,]?)+$","gi");
	if (!myRegExpr.test(theForm.address.value))
	{
		alert("Please enter only letters, numbers, space, comma," + "\n" + "apostrophe or hyphen in the Address field.")
	    theForm.address.focus();
	    return (false);
	}
	
	if (theForm.town.value == "")
	{
	alert("Please enter Town.");
	theForm.town.focus();
	return (false);
	}	
	
	myRegExpr.compile("^([A-Z]+[']?|[ ]?|[-]?)+$","gi");
	if (!myRegExpr.test(theForm.town.value))
	{
	    alert("Please enter only letters, spaces, apostrophe or hyphen in the Town field.");
	    theForm.town.focus();
	    return (false);
	}
	
	if (theForm.county.value != "")
	{
		myRegExpr.compile("^([A-Z]+[']?|[ ]?|[-]?)+$","gi");
		if (!myRegExpr.test(theForm.county.value))
		{
		    alert("Please enter only letters, spaces, apostrophe or hyphen in the County field.");
		    theForm.county.focus();
		    return (false);
		}
	}		

	if (theForm.postcode.value == "")
	{
	alert("Please enter your Postcode.");
	theForm.postcode.focus();
	return (false);
	}
	
	myRegExpr.compile("^[A-Z]{1,2}[0-9]{1,2}[A-Z]{0,1}[ ]{1,1}[0-9]{1,1}[A-Z]{1,2}$","gi");
	if (!myRegExpr.test(theForm.postcode.value))
	{
		alert("This does not appear to be a valid Postcode.")
	    theForm.postcode.focus();
	    return (false);
	}
	
	return (true);
}