function ContactForm_Validator(ContactForm) {
  if (ContactForm.sender_email.value == "") {
     alert("Please provide an e-mail address so we can contact you if required.");
     ContactForm.sender_email.focus();
     return (false);
  }
  if (ContactForm.sender_email.value.length < 1) {
     alert("Please provide an e-mail address so we can contact you if required.");
     ContactForm.sender_email.focus();
     return (false);
  }
  var cem = ContactForm.sender_email.value;
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(cem)){
  } else {
     alert('ERROR! The e-mail address you supplied appears to be invalid\n\n Please enter a legitimate e-mail address in format: someone@somewhere.tld');
     ContactForm.sender_email.focus();
     return false;
  }
  if (ContactForm.sender_name.value == "") {
     alert("Please provide your name so we know who to contact.");
     ContactForm.sender_name.focus();
     return (false);
  }
  if (ContactForm.sender_name.value.length < 1) {
     alert("Please provide your name so we know who to contact.");
     ContactForm.sender_name.focus();
     return (false);
  }
  if (ContactForm.main_message.value == "") {
     alert("Please enter your message (max: 512 characters).");
     ContactForm.main_message.focus();
     return (false);
  }
  if (ContactForm.main_message.value.length > 512) {
     alert("Please enter at most 512 characters in the message field.");
     ContactForm.main_message.focus();
     return (false);
  }
  return (true);
}
