function validate() 
{
var msg = "The following information is missing:\n\n";
var goalert = false;
if (contactus.Name.value == "") {
	msg += 'Name\n';
	goalert = true;
}

if (contactus.Email.value == "") {
	msg += 'Email address\n';
	goalert = true;
}

if (contactus.PhonePre.value == "") {
	msg += 'First 3 Phone Number digits\n';
	goalert = true;
}

if (contactus.PhoneMid.value == "") {
	msg += 'Middle 3 Phone Number digits\n';
	goalert = true;
}

if (contactus.PhonePost.value == "") {
	msg += 'Last 4 Phone Number digits\n';
	goalert = true;
}

if (goalert == true) {
	alert(msg);
	return false;
} else {
	var e = contactus.Email.value;
	
	if (e.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 = contactus.Email.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 = contactus.Email.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;
	}
	//otherwise submit the form
	contactus.submit();		
	}
}
