// JavaScript Document
<!--

function checkEmail(email) {
var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
return (filter.test(email)) ;
}





function validate(doc)
{
	var message = "The form has the following errors:\n"
	var errors = false;
	var form = doc.getElementById("contactme_form")
	if(!checkEmail(form.email.value))
	{
		errors = true;
		message +="Your email adress needs to be in the form name@example.com\n"
	}
if(form.contact_name.value == "")
	{
		errors = true;
		message +="You must provide a Contact Name\n";
	}
	//resopnd to failure by printing error and return false
	if(errors)
	{
    	window.alert (message);
		return false;
	}
	else
		return true;
	
}



function  validate_and_submit(doc)
{
	if(validate(doc))
	{
		var form = doc.getElementById("contactme_form");
		form.submit();
	}
	
}
-->