function checkForm() {
	var req_name = true;
	var req_phone = true;
	var req_email = true;
	var req_message = true;
	thisform = document.getElementById("contactForm");
	var errStr ='';
	if (req_name && thisform.Name.value == '') { errStr += '- Name not supplied\n'; }
	if (req_phone && thisform.Phone.value == '') { errStr += '- Phone number not supplied\n'; }
	if (req_email && thisform.Email.value == '') {
		errStr += '- Email address not supplied\n';
	} else {
		if (!echeck(thisform.Email.value)) { errStr += '- Email address invalid\n'; }
	}
	if (req_message && thisform.Message.value == '') { errStr += '- Message not supplied'; }
	if (errStr == "") {
		return true;
	} else {
		errStr = 'Please correct the following errors:\n' + errStr;
		alert(errStr);
		return false;
	}
}

function echeck (str) {
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1) { return false; }
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) { return false; }
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) { return false; }
	if (str.indexOf(at,(lat+1))!=-1) { return false; }
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) { return false; }
	if (str.indexOf(dot,(lat+2))==-1) { return false; }
	if (str.indexOf(" ")!=-1) { return false; }
	return true;
}