//Requires malvernreg.js to be loaded first
//Test browser for cookies, before doing anything else
MIL.testCookie();
    
//Create MIL.reg.localization sub-namespace, if not already created
if (typeof(MIL.reg.localization)=="undefined") MIL.reg.localization = {};
MIL.initialize = function() {
  if ( MIL.getCookie ( "MalvernPathTo" ) == null ) {
    MIL.setCookie ( "MalvernPathTo" , document.forms[0].path_info.value , "" , "/" );
  }
  if (document.getElementById("fld_log_LoginName").value == "" ) {
    document.getElementById("fld_log_LoginName").focus();
  }
};
MIL.reg.forgottenPW = function() {
  if (!MIL.reg.validation.email ( "fld_log_emailaddress" ) ) {
    alert (MIL.reg.localization.invalidEmail);
    return false;
  }
  alert(MIL.reg.localization.passwordMsg);
  return true; 
};
MIL.reg.submitForgottenPW = function() {
  if (MIL.reg.forgottenPW()) {
    document.forms["sendPassword"].submit();
  }
};
MIL.reg.formatUsername = function() {
  document.getElementById("Username").value = document.getElementById("fld_log_LoginName").value.replace(/@/g,"_");
};

