function isEmail(who) {
  var email=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,6}$/i;
  return(email.test(who));
}

function validate_form () {  
  if (!document.contactfrom.author.value){
    var missing = "Name";
    document.contactfrom.author.className='comment_box_alert';
    }
    else{
    document.contactfrom.author.className='comment_box';   
    }
    
  if (!document.contactfrom.email.value || !isEmail(document.contactfrom.email.value)){
    var missing = "E-mail address";
    document.contactfrom.email.className='comment_box_alert';
    }
    else{
    document.contactfrom.email.className='comment_box';   
    }
    
  if (!document.contactfrom.comment.value){
    var missing = "Comment";
    document.contactfrom.comment.className='comment_area_alert';   
    }
    else{
    document.contactfrom.comment.className='comment_area';   
    }
    
  if (missing) {
    document.getElementById('error').innerHTML="Please enter the required fields"
    return false;
    }
    else {
    return true;
    }

}