function validate_contact(frm) { 
  var re;
  if (frm.name.value == '' ) {
    alert('Please enter your name.');
    return false;
  }
  re=/^[a-z\s]+$/i;
  if (frm.name.value.match(re) == null) {
    alert('Please enter a valid name.');
    return false;
  }
  if (frm.email.value == '' ) {
    alert('Please enter your email address.');
    return false;
  }
  re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/i;
  if (frm.email.value.match(re) == null) {
    alert('Invalid email address.');
    return false;
  }
  if (frm.content.value.length < 4) {
    alert('Please type your question or comments.');
    return false;
  }
  if (frm.captcha.value.length != 4) {
    alert('Please enter the security code shown in the image.');
    return false;
  }
  re = /^[a-z0-9]+$/i;
  if (frm.captcha.value.match(re) == null) {
    alert('Please enter the security code shown in the image.');
    return false;
  }
}

