<!-- JavaScript Dcument
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
var postcodeExp = /^[A-Za-z]{1,2}[\d]{1,2}([A-Za-z])?\s?[\d][A-Za-z]{2}$/;
var phoneExp = /^(((\+44\s?\d{4}|\(?0\d{4}\)?)(\s?\d{3}\s?\d{3}|\s?\d{5}))|((\+44\s?\d{3}|\(?0\d{3}\)?)(\s?\d{3}\s?\d{4}|\s?\d{3}\s?\d{3}))|((\+44\s?\d{2}|\(?0\d{2}\)?)(\s?\d{4}\s?\d{4})|\s?\d{3}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$/;

function checkContactForm(theForm)	{
	var missing = "";
	radio_choice = false;

	for (counter = 0; counter < theForm.how_to_contact.length; counter++)	{
		// If a radio button has been selected it will return true
		// (If not it will return false)
		if (theForm.how_to_contact[counter].checked)
		radio_choice = true; 
	}

	if (theForm.title.value == "") missing += "Title\n";
	if (theForm.forename.value == "") missing += "First Name\n";
	if (theForm.surname.value == "") missing += "Surname\n";
	if (theForm.phone.value == "") missing += "Phone Number\n";
	if (theForm.email.value == "") missing += "Email Address\n";
	if (radio_choice != true) missing += "How would you like to be contacted?\n";
	if (theForm.How_did_you_hear_about_PLS.value == "" || theForm.How_did_you_hear_about_PLS.value == "null") missing += "How did you hear about PLS?\n";
	
	if (missing != "") {
		alert("You missed the following essential elements\n\n"
		+ missing
		+ "\nPlease complete and resubmit");
		return false;
	}
	else if (!theForm.email.value.match(emailExp))	{
		alert("Please enter a valid email address");
		return false;
	}
	else	return true;
}

function checkDownForm(theForm)	{
	var missing = "";
	var mind_being_contacted = false;
	var contact_prefs = false;
	var contact_prefs_val = "";

	if (theForm.name.value == "") missing += "Name\n";
	
	for (i = 0; i < theForm.mind_being_contacted.length; i++)	{
		if (theForm.mind_being_contacted[i].checked)	{
			mind_being_contacted = true;
		}
	}
	
	for (i = 0; i < theForm.contact_preference.length; i++)	{
		if (theForm.contact_preference[i].checked)	{
			contact_prefs = true;
			contact_prefs_val = theForm.contact_preference[i].value;
		}
	}
	
	if (!mind_being_contacted)	missing += "Do you mind being contacted?\n";
	if (!contact_prefs)	missing += "How would you like to be contacted?\n";
	
	if(contact_prefs_val == "Email")	{	
		if (theForm.email.value == "") missing += "Email Address\n";
	}
	else if(contact_prefs_val == "Telephone")	{
		if (theForm.phone_num.value == "") missing += "Phone Number\n";	
	}

	if (missing != "") {
		alert("You missed the following essential elements\n\n"
		+ missing
		+ "\nPlease complete and resubmit");
		return false;
	}
	else if (!theForm.email.value.match(emailExp) && contact_prefs_val == "Email")	{
		alert("Please enter a valid email address");
		return false;
	}
	else	return true;
}
-->