/*
  20090319 Leigh H - Rewritten to support the revised forgotpass.phtml.
                     Backwards compatible.
*/

function obj(sID) {
  return document.getElementById(sID);
}

function validateMail() {
  var oHint = obj("jshint");
  var oEmail = obj("txtEmailAddress");
  
  if (oHint) {
    if (oEmail.value == '') {
      oHint.style.display = "block";
      return false;
    }  
    oHint.style.display = "none";
  }  
	else {
    if(oEmail.value == '') {
  	 	alert("Please enter your email address.\nThis must be the address " +
        "used in your Relay For Life registration.");
  		oEmail.focus();
  		return false;
    }
  	if(!checkEmail(oEmail.value)) {
  	  alert("Please enter a valid email address.\nThis must be the " +
        "address used in your Relay For Life registration.");
  		oEmail.focus();
  		return false;
  	}
  }	
  return true;
}