Please log in below."); $registrationFeedback.show(); } else { displayErrorMessage("Error: Registration was not successful.
You may try again or contact support."); } break; } else if (values[0] === "FailedAttempt") { displayErrorMessage(failedLoginMessage); } } }); function displayErrorMessage(errorMessage) { $('#error').html(errorMessage); $('#error').show(); } if (document.URL.indexOf("SessionExpired=true") >= 0) { $('#session_expired').show(); } if (document.URL.indexOf("TokenExpired=true") >= 0) { $('#token_expired').show(); } if (document.URL.indexOf("InvalidToken=true") >= 0) { $('#invalid_token').show(); } if (document.URL.indexOf("Error=true") >= 0) { $('#error').show(); } $("#loginFrameLoginButton").click(function (event) { resetErrorMessages(); if ($('#LoginForm').valid()) { var r = { Actions: "Login", UserName: $('#Login_UserName').val(), Password: $('#Login_Password').val() }; var p = requestBroker(r); p.done(function (response) { if (response.Validated == true) { if (response.Login.Success) { if (response.Login.PasswordChangeRequired) { redirectPage( "/ResetPassword" ); } else { if (justRegistered) { redirectPage( "/Preferences" ); } else if (response.Login.MigratedAccount) { qs = getQueryString(); if (qs.startsWith("Redirect=")) { redirectPage(qs.substr(qs.indexOf("=") + 1).replace("&", "?") + "&Welcome=true"); } else { redirectPage( "/AccountSummary" + "?Welcome=true" ); } } else { qs = getQueryString(); if (qs.startsWith("Redirect=")) { if (qs.indexOf("&") > 0 || qs.indexOf("?") > 0) redirectPage(qs.substr(qs.indexOf("=") + 1).replace("&", "?") + "&nr=1"); else redirectPage(qs.substr(qs.indexOf("=") + 1) + "?nr=1"); } else { redirectPage( "/AccountSummary" ); } } } } else { if (response.Login.ProfileDisabled) { displayErrorMessage("Error: This username has been disabled. Please contact Customer Service at 770‑850‑6200 or toll free at 1‑877‑850‑6200."); } else if (response.Login.Restricted) { var minutes = Math.ceil(response.Login.RestrictedTimeRemainingSeconds / 60); displayErrorMessage("Error: For security reasons, your account has been temporarily locked. Access has been restricted for the next " + minutes + " minutes."); } else { displayErrorMessage(failedLoginMessage); } } } else { alert(response.ValidationErrors); } }); } event.preventDefault(); }); localStorage.removeItem('lastTab');