//<script language=javascript>
//trick - add as the top line on the .js file

function Validate()
{

if (contact.aname.value == ''){
	alert("Please enter your name.");
	contact.aname.focus();
	return false;
	}

if (contact.aemail.value == ''){
	alert("Please enter your email address.");
	contact.aemail.focus();
	return false;
	}
	
if (contact.aemail.value.indexOf('@')==-1) { //does it have an @ in it?
	alert('Please provide a valid email address\n\nThe address is missing an @ symbol');
	return false;
	} 

var atsplit = contact.aemail.value.split('@');
if (atsplit[0]=='') { //are there any characters before the @ symbol
	alert('Please provide a valid email address\n\nThe address is missing characters before the @ symbol');
	return false;
	}

if (atsplit[1].indexOf('.')==-1) { //does it have a . after the @
	alert('Please provide a valid email address\n\nThe address is missing a . (dot) after the @ symbol');
	return false;
	} 

var atdotsplit = atsplit[1].split('.');
if (atdotsplit[0]=='') { //does it have characters immediately after the @				
	alert('Please provide a valid email address\n\nThe address is missing characters immediately after the @ symbol');
	return false;
	}

var dotsplit = contact.aemail.value.split('.');
//alert(dotsplit[dotsplit.length-1]);
if (dotsplit[dotsplit.length-1]=='') { //are there any characters after the last .
	alert('Please provide a valid email address\n\nThe address is missing characters after the last .(dot)');
	return false;
	}
	
if (contact.aphone1.value == ''){
	window.alert("Please enter the first 3 numbers of your telephone number.");
	contact.aphone1.focus();
	return false;
	}

if (contact.aphone2.value == ''){
	window.alert("Please enter the middle 3 numbers of your telephone number.");
	contact.aphone2.focus();
	return false;
	}
	
if (contact.aphone3.value == ''){
	window.alert("Please enter the last 4 numbers of your telephone number.");
	contact.aphone3.focus();
	return false;
	}
	
}


