function validateEmailAddress(p_element, p_prompt_name, p_optional) 
   { 
     /*
      *  @param  p_element:     document.form.element of form field
      *  @param  p_prompt_name: prompt name shown on the screen
      *  @param  p_optional:    Y/N this field can/can't be null 
      */
      var v_msg = "";
      var v_value = p_element.value;
      var v_token_list = " ";

      var at_index;
      var dot_index;

      v_value = removeTokens(v_value, v_token_list);
      v_msg += noSpecialChars(v_value, p_prompt_name);
      if (p_optional == "N") 
			{
         if (!isNull(v_value))
				 {
            v_msg += p_prompt_name + " " + v_value + " must be entered.\n";
         }  
      }

			if (v_value != "")
			{
			
      at_index = v_value.indexOf('@');
      dot_index = v_value.lastIndexOf('.');
      if(at_index == -1) {
        v_msg += "The email address should contain an '@' character.\n"
      }
      
      if (dot_index == -1 || dot_index < at_index) {
        v_msg += "The email address should contain atleast one '.' character after the '@'.\n";
        
      }
     }
      return v_msg;
   }


