// Only script specific to the Contact Form goes here.
// General-purpose routines are in a separate file - see formval.js
  function validateOnSubmit() {
    var elem;
    var errs=0;
    // execute all element validations in reverse order, so focus gets
    // set to the first one in error.
    if (!validatePresent(document.forms.contactform.message, 'm'))		 errs += 1; 
    if (!validateEmail  (document.forms.contactform.myemail, 'e', true)) errs += 1; 
    if (!validatePresent(document.forms.contactform.myname, 'n'))        errs += 1; 

    if (errs>1)  alert('Some fields need to be corrected before you can send this.');
    if (errs==1) alert('One field needs to be corrected before you can send this.');

    return (errs==0);
  };