function checkemail(email,error) {
	emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(email))) { 
       error+= "The email address you have entered does not appear to be a valid one.\n";
    }
    else {
	//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (email.match(illegalChars)) {
          error+= "The email address contains illegal characters.\n";
       }
    }
    return error;
}
function validate() {
	name=document.contact_form.name.value;
	email=document.contact_form.email.value;
	phone=document.contact_form.phone.value;
	message=document.contact_form.message.value;
	error="";
	if (name=="") error+="Name is required.\n";
	if (email!="") {
		error=checkemail(email,error);
    } else error+="Email address is required.\n";
    if (name=="") error+="Please supply your contact telephone number.\n";
	if (message=="") error+="You did not type a message.\n";
    if (error!="") {
    	alert(error);
    	return false;
    }
    return true;
}