
function IsBlank(value) {
   for (var x = value.length - 1; x >= 0; x--) {
      if ((value.charAt(x) != " ") && (value.charAt(x) != "")) {
         return false;
      } 
   }
   return true;
}
function IsAValidEmail(value) {

    var foundAt = false
    var foundDot = false

    // Step through the inputValue looking for
    // "@" and "."

    for (var i=0; i<=value.length; i++) {
      if (value.charAt(i) == "@" ) {
          foundAt = true
      }
      else if (value.charAt(i) == ".") {
          foundDot = true
      }
    }

    // If both "@" and "." were found, assume
    // the e-mail address is valid; otherwise,
    // return false so the calling code knows
    // the e-mail address is invalid.

    if (foundAt && foundDot) {
        return true
    }
    else {
        return false
    }
}
function ValidateForm(Forgot) {
   
	if ((IsBlank(Forgot.emailaddress.value))){ 
   		alert("Please enter your e-Mail Address");
   		document.Forgot.emailaddress.focus();                           
        return false;
   }   
   else if ((!IsAValidEmail(Forgot.emailaddress.value))){ 
   		alert("Please enter a your e-Mail Address in a proper format.");
   		document.Forgot.emailaddress.focus();                           
        return false;
   }         
   else {                              
            return true;
   }
   }                                 
