function chkForm(frm) {
  // the name of the form
  f = frm;

  if (f.first) {
    if (f.first.value == '') {
      alert('Enter your name');
      return false;
    }
  }

  // if 'from' address field is used, this checks it to make sure address is valid
  if (f.email) {
    if (f.email.value != '' && (f.email.value.lastIndexOf('.') < 0 || f.email.value.lastIndexOf('@') < 1)) {
      alert('Invalid email address');
      return false;
    }
    else if (f.email.value == '') {
      alert('Enter your email address');
      return false;
    }
  }
  
  if (f.comments) {
    if (f.comments.value == '') {
      alert('Enter a message');
      return false;
    }
  }
  
}
