function validate_required(field,alerttxt) {
  with (field) {
    if (value==null||value=="") {
      alert(alerttxt);return false;
    }
    else {
      return true;
    }
  }
}

function validate_email(field,alerttxt) {
  with (field) {
    apos=value.indexOf("@");
    dotpos=value.lastIndexOf(".");
    if (apos<1||dotpos-apos<2) {
      alert(alerttxt);return false;
    }
    else {
      return true; 
    }
  }
}

/*send button rollover*/
function hov(loc,cls) {   
  if(loc.className)   
    loc.className=cls;   
}   

function validate_contact(thisform) {
  with (thisform) {
    if (validate_required(contact,"please enter your name")==false) {
	  contact.focus();return false;
	}
    if (validate_required(email,"please enter your email address")==false) {
	  email.focus();return false;
	}	  
    if (validate_email(email,"please enter a valid e-mail address")==false) {
	  email.focus();return false;
	}
    if (validate_required(comment,"please enter a comment")==false) {
	  comment.focus();return false;
	}	
	if (validate_required(recaptcha_challenge_field,"please enter the two words for validation")==false) {
	  comment.focus();return false;
	}	
  }
}

