function validate_email(field,alerttxt)
	{
		with (field)
			{
				if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(form.email.value))
					{return (true);}
				else {alert(alerttxt);return false};

			}
	}

function validate_name(field,alerttxt)
	{
		with (field)
			{
				numofchar=value.length;
				if (numofchar<1) 
					  {alert(alerttxt);return false}
				else {return true}
			}
	}

function validate_address(field,alerttxt)
	{
		with (field)
			{
				numofchar=value.length;
				if (numofchar<1) 
					  {alert(alerttxt);return false}
				else {return true}
			}
	}

function validate_address2(field,alerttxt)
	{
		with (field)
			{
				numofchar=value.length;
				if (numofchar<1) 
					  {alert(alerttxt);return false}
				else {return true}
			}
	}

function validate_town(field,alerttxt)
	{
		with (field)
			{
				numofchar=value.length;
				if (numofchar<1) 
					  {alert(alerttxt);return false}
				else {return true}
			}
	}

function validate_county(field,alerttxt)
	{
		with (field)
			{
				numofchar=value.length;
				if (numofchar<1) 
					  {alert(alerttxt);return false}
				else {return true}
			}
	}

function validate_postcode(field,alerttxt)
	{
		with (field)
			{
				numofchar=value.length;
				if (numofchar<1) 
					  {alert(alerttxt);return false}
				else {return true}
			}
	}

function validate_hear(field,alerttxt)
	{
		with (field)
			{
				numofchar=value.length;
				if (numofchar<1) 
					  {alert(alerttxt);return false}
				else {return true}
			}
	}

//Function called from Form
function validate_form(thisform)
{
	with (thisform)
	{
		 if (validate_email(email,"Please enter your email address")==false)
		  {email.focus();return false}
		 if (validate_name(name,"Please enter your name")==false)
		  {name.focus();return false}
		 if (validate_address(address,"Please enter your address")==false)
		  {address.focus();return false}
		 if (validate_address2(address2,"Please enter your full address")==false)
		  {address2.focus();return false}
		 if (validate_town(town,"Please enter your town")==false)
		  {town.focus();return false}
		 if (validate_county(county,"Please enter your county")==false)
		  {county.focus();return false}
		 if (validate_postcode(postcode,"Please enter your postcode")==false)
		  {postcode.focus();return false}
		 if (validate_hear(hear,"Please tell us where you heard about us")==false)
		  {hear.focus();return false}
		  		
	}
}

