// JavaScript Document
function contact(nano)
	{
	parent.location = 'm'+'ail'+'to'+String.fromCharCode(58)+'fopc'+String.fromCharCode(nano)+'portencrosscastle.org.uk';
	}


	function validate() 
		{
		trap = 0;
		if (trap == 0) {firstName()}
		if (trap == 0) {lastName()}
		if (trap == 0) {address()
		if (trap == 0) {town()}
		if (trap == 0) {county()}
		if (trap == 0) {postcode()}
		if (trap == 0) {email()}
		if (trap == 0) {telephone()}
		if (trap == 0) 
			{
			document.frmUkDonate.submit()
			//alert('ok!')
		    }
		}

	function firstName() {
		if (document.frmUkDonate.firstname.value == "") 
			{
			trap = 1
			alert('Please enter your first name')
			document.frmUkDonate.firstname.focus()
			}
		}
	function lastName() {
		if (document.frmUkDonate.lastname.value == "") {
			trap = 1
			alert('Please enter your last name')
			document.frmUkDonate.lastname.focus()
			}
		}

	function address() {
		if (document.frmUkDonate.firstline.value == "") {
			trap = 1
			alert('Please enter your address')
			document.frmUkDonate.firstline.focus()
			}
		}

	function town() {
		if (document.frmUkDonate.town.value == "") {
			trap = 1
			alert('Please enter your town')
			document.frmUkDonate.town.focus()
			}
		}

	function county() {
		if (document.frmUkDonate.county.value == "") {
			trap = 1
			alert('Please enter your county or region')
			document.frmUkDonate.county.focus()
			}
		}

	function postcode() {
		if (document.frmUkDonate.postcode.value == "") {
			trap = 1
			alert('Please enter your postcode')
			document.frmUkDonate.postcode.focus()
			}
		}

	function email() {
		trap = 0;
		addr = document.frmUkDonate.email_address_sender.value
		bits = addr.split("@")
		if (bits.length < 2)
			{
			trap=1
			}
		else 
			{
			scnd = bits[1].split(".")
			if (scnd.length < 2) 
				{
				trap = 1
				}
			}
			
	if(trap == 1)
			{
			alert("Please check your email address. We may need this to contact you about your order.")
			document.frmUkDonate.email_address_sender.focus()
			}
		}

	function telephone() 
		{
		 if (document.frmUkDonate.telephone.value == "") 
		 	{
			trap = 1
			alert('Please enter your telephone number. We may need to contact you about your order.')
			document.frmUkDonate.telephone.focus()
			}
		}	
	}
	
