{"id":10003,"date":"2024-09-18T11:10:20","date_gmt":"2024-09-18T16:10:20","guid":{"rendered":"https:\/\/www.hmns.org\/?page_id=10003"},"modified":"2026-03-31T05:26:34","modified_gmt":"2026-03-31T10:26:34","slug":"login","status":"publish","type":"page","link":"https:\/\/www.hmns.org\/login\/","title":{"rendered":"Log In"},"content":{"rendered":"<style type=\"text\/css\">\n\t#hmns-login-box {\n\t\tpadding: 48px 0 48px;\n\t\tmargin: 50px auto 50px;\t\n\t\twidth: 1400px;\n\t\tmax-width: 100%;\t\n\t\tborder: 1px solid rgba(95,85,65,.2);\n\t\tbackground:white;\n\t}\n\t#hmns-login-box .login-flex {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap:48px;\t\n\t}\n\t.title-bar {\n\t\ttext-align: center;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tjustify-content: center;\n\t\tgap: 16px;\n\t}\n\t.form-switcher {\n\t\tdisplay: flex;\n\t\tjustify-content: center;\t\n\t\tgap: 48px;\n\t\tpadding: 0 16px;\n\t}\n\t\n\n\t.login-form-box, .create-account-box, .password-reset-box, .password-change-box {\n\t\twidth: 600px;\n\t\tmax-width: 100%;\n\t\tbackground:white;\n\t\tbox-shadow:var(--hmns-box-shadow-light);\n\t\tmargin: 0 auto;\n\t}\n\t.create-account-box, .password-reset-box, .password-change-box {\n\t\tdisplay: none;\n\t}\n\t.create-account-box.active, .password-reset-box.active, .password-change-box.active {\n\t\tdisplay: block;\n\t}\n\t.login-form-box.hide {\n\t\tdisplay: none;\n\t}\n\t.login-form-box .login-top-bar,\n\t.password-reset-box .password-reset-top-bar,\n\t.password-change-box .password-change-top-bar {\n\t\tbackground: var(--fossil-rim);\n\t\ttext-align: center;\n\t\tcolor: white;\n\t\tfont-size: 20px;\n\t\tfont-family: \"Ringside Regular Bold\";\t\n\t\tpadding: 16px;\n\t}\n\t.create-account-fields { padding: 48px;}\n\tform#create-account-form .select-outer {\n\t\twidth: 100%;\n\t\tmargin-bottom: 32px;\n\t\tbackground:none;\n\t\tborder:1px solid rgba(95,85,65,.2);\n\t\tborder-radius: 4px;\n\t\tpadding: 0;\n\t\tmargin-top: 8px;\n\t}\n\tform#create-account-form select {\n\t\twidth: 100%;\n\t\tbackground:none;\n\t\tborder:none;\n\t\tpadding: 12px 24px;\n\t\t-webkit-appearance: none; \/* Hide default chevron for Webkit browsers *\/\n  \t\t-moz-appearance: none;    \/* Hide default chevron for Firefox *\/\n  \t\tappearance: none;         \/* Hide default chevron for other browsers *\/\n\t\tbackground-image: url('https:\/\/www.hmns.org\/wp-content\/themes\/hmns-theme\/assets\/images\/chevron-down.svg');\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-size: 16px; \/* Adjust size as needed *\/\n\t\tbackground-position: calc(100% - 24px) center;\n\t}\n\t.create-account-section-top-bar {\n\t\tbackground: var(--fossil-rim);\n\t\ttext-align: center;\n\t\tcolor: white;\n\t\tfont-size: 18px;\n\t\tfont-family: \"Ringside Regular Bold\";\t\n\t\tpadding: 12px;\n\t\tmargin-bottom: 16px;\n\t}\n\t.login-form-box .login-form,\n\t.password-reset-box .password-reset-form,\n\t.password-change-box .password-change-form {\n\t\tpadding: 48px 96px;\t\n\t}\n\t.login-form-box .login-form input[type=\"text\"], \n\t.login-form-box .login-form input[type=\"password\"],\n\tform#create-account-form input[type=\"text\"],\n\tform#create-account-form input[type=\"password\"],\n\t.password-reset-box .password-reset-form input[type=\"text\"],\n\t.password-change-box .password-change-form input[type=\"password\"] {\n\t\twidth: 100%;\n\t\theight: 50px;\n\t\tborder: 0;\n\t\tborder-bottom: 1px solid rgba(95,85,65,.2);\n\t\tmargin-bottom: 32px;\t\n\t\tbackground:none;\n\t} \n\t.login-form-box .login-submit,\n\t.create-account-box .create-account-submit,\n\t.password-reset-box .password-reset-submit,\n\t.password-change-box .password-change-submit {\n\t\tbackground: var(--cream);\n\t\tborder-bottom: 4px solid var(--monarch);\n\t\tpadding:32px;\n\t\tdisplay:flex;\n\t\tjustify-content:center;\n\t}\n\t.login-form-box .login-submit input[type=\"submit\"],\n\t.create-account-box .create-account-submit input[type=\"submit\"],\n\t.password-reset-box .password-reset-submit input[type=\"submit\"],\n\t.password-change-box .password-change-submit input[type=\"submit\"] {\n\t\tbackground: var(--monarch-alt);\n\t\tfont-family: \"Ringside Regular Bold\";\t\n\t\tpadding: 16px 24px;\n\t\tcolor: white;\n\t\tborder:0;\n\t\tmin-width: 150px;\n\t\tcursor: pointer;\n\t}\n\t.form-switcher-box {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tjustify-content: center;\t\n\t\tgap: 8px;\n\t\tbackground:var(--cream-light);\n\t\tpadding: 24px 32px 32px;\n\t\twidth: 205px;\n\t}\n\t.form-switcher-title h6 {\n\t\tfont-family: \"Termina\";\n\t\tfont-size: 14px;\n\t\tcolor: var(--fossil-rim);\n\t\ttext-align: center;\n\t\tfont-weight: 500;\n\t}\n\n\t.form-switcher-box button {\n\t\tbackground:none !important;\n\t\tpadding: 0 0 8px 0 !important;\n\t\ttransition: all 0.5s ease;\n\t\tborder:none !important;\n\t\tborder-bottom: 1px solid var(--serengeti) !important;\n\t\tcolor: var(--fossil-rim) !important;\t\n\t\tborder-radius: 0 !important;\n\t\tfont-weight: normal !important;\n\t}\t\n\t.form-switcher-box button:hover {\n\t\tborder-bottom-color: var(--monarch-alt) !important;\n\t\tbackground:none !important;\n\n\t}\n\t.login-form-box .login-form .label-flex,\n\tform#create-account-form .label-flex,\n\t.password-reset-box .password-reset-form .label-flex,\n\t.password-change-box .password-change-form .label-flex { \n\t\tdisplay: flex;\t\n\t}\n\t.login-form-box .login-form .label-flex label,\n\tform#create-account-form .label-flex label,\n\t.password-reset-box .password-reset-form .label-flex label,\n\t.password-change-box .password-change-form .label-flex label {\n\t\tmargin-right: auto;\t\n\t}\n\t.login-extras-box {\n\t\tpadding: 24px;\t\n\t}\n\t.label-flex label {\n\t\tfont-family: \"Termina\";\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: var(--fossil-rim);\n\t}\n\t.label-flex span.required {\n\t\tfont-family: \"Termina\";\n\t\tfont-size: 10px;\n\t\tfont-weight: 600;\n\t\tcolor: var(--fossil-rim);\t\n\t}\n\t.login-form .login-fields .login-links {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tcolumn-gap 8px;\n\t\tjustify-content: center;\n\t\talign-items: center;\t\n\t}\n\t.login-form .login-fields .login-links a {\n\t\tcolor: var(--monarch-alt);\n\t\tfont-family: \"Ringside Regular Bold\";\n\t}\n\tform#tessitura-login-form.greyed-out,\n\tform#create-account-form.greyed-out,\n\tform#password-reset-form.greyed-out,\n\tform#password-change-form.greyed-out {\n\t\topacity: .5;\n\t\tappearance:none;\n\t\t--webkit-appearance:none;\n\t\t--moz-appearance:none;\t\n\t}\n\t.loginReturn, .create-account-return, .password-reset-return, .password-change-return {\n\t\tpadding: 32px;\n\t\ttext-align: center;\n\t}\n\t.loginReturn h6, .create-account-return h6, .password-reset-return h6, .password-change-return h6 {\n\t\tcolor: var(--monarch-alt);\n\t\tmargin-bottom: 16px;\n\t}\n\t.return-url-notification {\n\t\tbackground: var(--cream);\n\t\tpadding: 16px 24px;\n\t\ttext-align: center;\n\t\tfont-size: 14px;\n\t\tcolor: var(--fossil-rim);\n\t\tborder-bottom: 1px solid rgba(95,85,65,.2);\n\t}\n\t.return-url-notification.hide {\n\t\tdisplay: none;\n\t}\n\t.return-url-notification a {\n\t\tcolor: var(--monarch-alt);\n\t\tfont-family: \"Ringside Regular Bold\";\n\t}\n<\/style>\n<section id=\"hmns-login-box\">\n\t<div class=\"login-flex\">\n\t\t<div class=\"title-bar\">\n\t\t\t<h2>Welcome to Our New Online Experience.<\/h2>\t\t\t\t\t\t<p>We&#8217;ve launched a fresh website. If you held an account with us previously, please kindly reset your password for continued access.<\/p>\t\t\n\t\t<\/div>\n\t\t<div class=\"form-switcher\">\n\t\t\t<div class=\"form-switcher-box\">\n\t\t\t\t<div class=\"form-switcher-title\"><h6 class=\"form-switcher-title-text\">Login<\/h6><\/div>\n\t\t\t\t<button id=\"show-login-form\">Login<\/button>\n\t\t\t<\/div>\n\t\t\t<div class=\"form-switcher-box\">\n\t\t\t\t<div class=\"form-switcher-title\"><h6 class=\"form-switcher-title-text\">Reset Password<\/h6><\/div>\n\t\t\t\t<button id=\"show-password-reset-form\">Reset Password<\/button>\n\t\t\t<\/div>\n\t\t\t<div class=\"form-switcher-box\">\n\t\t\t\t<div class=\"form-switcher-title\"><h6 class=\"form-switcher-title-text\">Create Account<\/h6><\/div>\n\t\t\t\t<button id=\"show-create-account-form\">Create Account<\/button>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"form-container-flex\" data-tnaction=\"login\">\n\t\t\t<div class=\"login-form-box\">\n\t\t\t\t<div class=\"login-top-bar\">Login<\/div>\n\t\t\t\t<div class=\"login-status-checking\" style=\"padding: 48px; text-align: center;\">\n\t\t\t\t\t<div class=\"login-spinner\" style=\"margin: 0 auto 16px;\"><div class=\"spinner-icon\"><svg xmlns:svg=\"http:\/\/www.w3.org\/2000\/svg\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\" version=\"1.0\" width=\"64px\" height=\"64px\" viewBox=\"0 0 128 128\" xml:space=\"preserve\"><g><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,1)\"\/><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,.1)\" transform=\"rotate(30 64 64)\"\/><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,.1)\" transform=\"rotate(60 64 64)\"\/><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,.1)\" transform=\"rotate(90 64 64)\"\/><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,.2)\" transform=\"rotate(120 64 64)\"\/><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,.3)\" transform=\"rotate(150 64 64)\"\/><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,.4)\" transform=\"rotate(180 64 64)\"\/><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,.5)\" transform=\"rotate(210 64 64)\"\/><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,.6)\" transform=\"rotate(240 64 64)\"\/><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,.7)\" transform=\"rotate(270 64 64)\"\/><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,.8)\" transform=\"rotate(300 64 64)\"\/><path d=\"M97.63 8.23a7.38 7.38 0 0 1 2.7 10.07L89.2 37.57a7.38 7.38 0 1 1-12.77-7.37l11.12-19.27a7.38 7.38 0 0 1 10.08-2.7z\" fill=\"rgba(242,244,238,.9)\" transform=\"rotate(330 64 64)\"\/><animateTransform attributeName=\"transform\" type=\"rotate\" values=\"0 64 64;30 64 64;60 64 64;90 64 64;120 64 64;150 64 64;180 64 64;210 64 64;240 64 64;270 64 64;300 64 64;330 64 64\" calcMode=\"discrete\" dur=\"1080ms\" repeatCount=\"indefinite\"><\/animateTransform><\/g><\/svg><\/div><\/div>\n\t\t\t\t\t<p>Checking login status&#8230;<\/p>\n\t\t\t\t<\/div>\n\t\t\t\t<form id=\"tessitura-login-form\" action=\"\" method=\"POST\" style=\"display: none;\">\n\t\t\t\t\t<div class=\"login-form\">\n\t\t\t\t\t\t<div class=\"login-fields\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>EMAIL<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"tessitura-username\" name=\"tessituraUsername\" placeholder=\"\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>PASSWORD<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"password\" id=\"tessitura-pass\" name=\"tessituraPassword\" placeholder=\"****\">\n\t\t\t\t\t\t\t<div class=\"login-links\"><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div class=\"login-submit\">\n\t\t\t\t\t\t<input type=\"submit\" value=\"Login\" name=\"login\">\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/form>\t\n\t\t\t\t<div class=\"loginReturn hide\"><\/div>\t\n\t\t\t<\/div>\n\t\t\t<div class=\"create-account-box\">\n\t\t\t\t\n\t\t\t\t<form id=\"create-account-form\" action=\"\" method=\"POST\">\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"create-account-section\">\n\t\t\t\t\t\t\t<div class=\"create-account-section-top-bar\">Login Information<\/div>\n\t\t\t\t\t\t\t<div class=\"create-account-fields\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>EMAIL ADDRESS<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"create-account-email\" name=\"create-account-email\" placeholder=\"\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>PASSWORD<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"password\" id=\"create-account-pass\" name=\"create-account-pass\" placeholder=\"****\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>CONFIRM PASSWORD<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"password\" id=\"create-account-confirm-pass\" name=\"create-account-confirm-pass\" placeholder=\"****\">\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"create-account-section\">\n\t\t\t\t\t\t\t<div class=\"create-account-section-top-bar\">Account Information<\/div>\n\t\t\t\t\t\t\t<div class=\"create-account-fields\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>PREFIX<\/label><\/div>\n\t\t\t\t\t\t\t<div class=\"select-outer\"><select autocomplete=\"honorific-prefix\" class=\" form-control tn-prefix-id\" id=\"Patron_PrefixId\" name=\"Patron.PrefixId\">\n\t\t\t\t\t\t\t\t<option selected=\"selected\" value=\"-1\">(None)<\/option><option value=\"6\">Dr.<\/option><option value=\"3\">Miss<\/option><option value=\"1\">Mr.<\/option><option value=\"2\">Mrs.<\/option><option value=\"4\">Ms.<\/option><option value=\"162\">Mx.<\/option>\n\t\t\t\t\t\t\t<\/select><\/div>\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>FIRST NAME<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"create-account-first-name\" name=\"create-account-first-name\" placeholder=\"\" required>\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>MIDDLE NAME<\/label><\/div>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"create-account-middle-name\" name=\"create-account-middle-name\" placeholder=\"\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>LAST NAME<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"create-account-last-name\" name=\"create-account-last-name\" placeholder=\"\" required>\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>SUFFIX<\/label><\/div>\n\t\t\t\t\t\t\t<!-- NEED A Custom DROPDOWN FOR SUFFIXES, the following select is the \"raw\" HTML from TNEW that I stole from TNEW -->\n\t\t\t\t\t\t\t<div class=\"select-outer\"><select autocomplete=\"honorific-suffix\" class=\" form-control tn-suffix-id\" data-val-required=\"The SuffixId field is required.\" id=\"Patron_SuffixId\" name=\"Patron.SuffixId\" required>\n\t\t\t\t\t\t\t\t<option selected=\"selected\" value=\"-1\">(None)<\/option><option value=\"4\">II<\/option><option value=\"5\">III<\/option><option value=\"6\">IV<\/option><option value=\"2\">Jr<\/option><option value=\"3\">Sr.<\/option>\n\t\t\t\t\t\t\t<\/select><\/div>\n\t\t\t\t\t\t\t <div class=\"label-flex\"><label>PHONE NUMBER<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"create-account-phone\" name=\"create-account-phone\" placeholder=\"\">\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"create-account-section\">\n\t\t\t\t\t\t\t<div class=\"create-account-section-top-bar\">Address<\/div>\n\t\t\t\t\t\t\t<div class=\"create-account-fields\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>STREET ADDRESS<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"create-account-street-address\" name=\"create-account-street-address\" placeholder=\"\" required>\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>APARTMENT, SUITE, UNIT or OTHER<\/label><\/div>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"create-account-apartment-suite-unit-other\" name=\"create-account-apartment-suite-unit-other\" placeholder=\"\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>CITY<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"create-account-city\" name=\"create-account-city\" placeholder=\"\" required>\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>STATE<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<!-- NEED A CUSTOM DROPDOWN FOR STATES, the following select is the \"raw\" HTML from TNEW that I stole from TNEW -->\n\t\t\t\t\t\t\t<div class=\"select-outer\"><select autocomplete=\"address-level1\" class=\" form-control tn-state-id\" data-tn-form-control=\"true\" id=\"Address_StateId\" name=\"Address.StateId\" required>\n\t\t\t\t\t\t\t\t<!-- <option value=\"\" disabled selected>Select<\/option><option value=\"5\">Alabama<\/option><option value=\"4\">Alaska<\/option><option value=\"1\">American Embassy<\/option><option value=\"3\">American Embassy<\/option><option value=\"8\">American Samoa<\/option><option value=\"9\">Arizona<\/option><option value=\"7\">Arkansas<\/option><option value=\"6\">Armed Forces<\/option><option value=\"11\">California<\/option><option value=\"13\">Colorado<\/option><option value=\"14\">Connecticut<\/option><option value=\"15\">D.C.<\/option><option value=\"16\">Delaware<\/option><option value=\"17\">Florida<\/option><option value=\"19\">Georgia<\/option><option value=\"20\">Guam<\/option><option value=\"21\">Hawaii<\/option><option value=\"23\">Idaho<\/option><option value=\"24\">Illinois<\/option><option value=\"25\">Indiana<\/option><option value=\"22\">Iowa<\/option><option value=\"26\">Kansas<\/option><option value=\"27\">Kentucky<\/option><option value=\"28\">Louisiana<\/option><option value=\"33\">Maine<\/option><option value=\"34\">Marshall Islands<\/option><option value=\"32\">Maryland<\/option><option value=\"30\">Massachusetts<\/option><option value=\"35\">Michigan<\/option><option value=\"18\">Micronesia<\/option><option value=\"36\">Minnesota<\/option><option value=\"38\">Mississippi<\/option><option value=\"37\">Missouri<\/option><option value=\"39\">Montana<\/option><option value=\"43\">Nebraska<\/option><option value=\"50\">Nevada<\/option><option value=\"45\">New Hampshire<\/option><option value=\"46\">New Jersey<\/option><option value=\"47\">New Mexico<\/option><option value=\"51\">New York<\/option><option value=\"41\">North Carolina<\/option><option value=\"42\">North Dakota<\/option><option value=\"12\">Northern Mariana Is.<\/option><option value=\"52\">Ohio<\/option><option value=\"53\">Oklahoma<\/option><option value=\"55\">Oregon<\/option><option value=\"60\">Palau<\/option><option value=\"56\">Pennsylvania<\/option><option value=\"59\">Puerto Rico<\/option><option value=\"61\">Rhode Island<\/option><option value=\"62\">South Carolina<\/option><option value=\"63\">South Dakota<\/option><option value=\"65\">Tennessee<\/option><option value=\"67\">Texas<\/option><option value=\"66\">Trust Territories<\/option><option value=\"68\">Utah<\/option><option value=\"71\">Vermont<\/option><option value=\"70\">Virgin Islands<\/option><option value=\"69\">Virginia<\/option><option value=\"72\">Washington<\/option><option value=\"74\">West Virginia<\/option><option value=\"73\">Wisconsin<\/option><option value=\"75\">Wyoming<\/option> -->\n\t\t\t\t\t\t\t\t<option value=\"\" disabled selected>Select<\/option><option value=\"AL\">Alabama<\/option><option value=\"AK\">Alaska<\/option><option value=\"AA\">American Embassy (AA)<\/option><option value=\"AE\">American Embassy (AE)<\/option><option value=\"AS\">American Samoa<\/option><option value=\"AZ\">Arizona<\/option><option value=\"AR\">Arkansas<\/option><option value=\"AP\">Armed Forces<\/option><option value=\"CA\">California<\/option><option value=\"CO\">Colorado<\/option><option value=\"CT\">Connecticut<\/option><option value=\"DC\">D.C.<\/option><option value=\"DE\">Delaware<\/option><option value=\"FL\">Florida<\/option><option value=\"GA\">Georgia<\/option><option value=\"GU\">Guam<\/option><option value=\"HI\">Hawaii<\/option><option value=\"ID\">Idaho<\/option><option value=\"IL\">Illinois<\/option><option value=\"IN\">Indiana<\/option><option value=\"IA\">Iowa<\/option><option value=\"KS\">Kansas<\/option><option value=\"KY\">Kentucky<\/option><option value=\"LA\">Louisiana<\/option><option value=\"ME\">Maine<\/option><option value=\"MH\">Marshall Islands<\/option><option value=\"MD\">Maryland<\/option><option value=\"MA\">Massachusetts<\/option><option value=\"MI\">Michigan<\/option><option value=\"FM\">Micronesia<\/option><option value=\"MN\">Minnesota<\/option><option value=\"MS\">Mississippi<\/option><option value=\"MO\">Missouri<\/option><option value=\"MT\">Montana<\/option><option value=\"NE\">Nebraska<\/option><option value=\"NV\">Nevada<\/option><option value=\"NH\">New Hampshire<\/option><option value=\"NJ\">New Jersey<\/option><option value=\"NM\">New Mexico<\/option><option value=\"NY\">New York<\/option><option value=\"NC\">North Carolina<\/option><option value=\"ND\">North Dakota<\/option><option value=\"CM\">Northern Mariana Is.<\/option><option value=\"OH\">Ohio<\/option><option value=\"OK\">Oklahoma<\/option><option value=\"OR\">Oregon<\/option><option value=\"PW\">Palau<\/option><option value=\"PA\">Pennsylvania<\/option><option value=\"PR\">Puerto Rico<\/option><option value=\"RI\">Rhode Island<\/option><option value=\"SC\">South Carolina<\/option><option value=\"SD\">South Dakota<\/option><option value=\"TN\">Tennessee<\/option><option value=\"TX\">Texas<\/option><option value=\"TT\">Trust Territories<\/option><option value=\"UT\">Utah<\/option><option value=\"VT\">Vermont<\/option><option value=\"VI\">Virgin Islands<\/option><option value=\"VA\">Virginia<\/option><option value=\"WA\">Washington<\/option><option value=\"WV\">West Virginia<\/option><option value=\"WI\">Wisconsin<\/option><option value=\"WY\">Wyoming<\/option>\n\t\t\t\t\t\t\t<\/select><\/div>\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>POSTAL CODE<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"create-account-postal-code\" name=\"create-account-postal-code\" placeholder=\"12345\" pattern=\"[0-9]{5}\" required>\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>COUNTRY<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<!-- NEED A CUSTOM DROPDOWN FOR COUNTRIES, the follow select is the \"raw\" HTML from TNEW that I stole from TNEW -->\n\t\t\t\t\t\t\t<div class=\"select-outer\"><select autocomplete=\"country-name\" class=\" form-control country-id\" data-val=\"true\" data-val-required=\"The CountryId field is required.\" id=\"Address_CountryId\" name=\"Address.CountryId\" required><option value=\"\" disabled selected>Select<\/option>\n\t\t\t\t\t\t\t\t<option value=\"226\">Afghanistan<\/option><option value=\"3\">Albania<\/option><option value=\"4\">Algeria<\/option><option value=\"5\">Andorra<\/option><option value=\"6\">Angola<\/option><option value=\"10\">Antigua and Barbuda<\/option><option value=\"7\">Argentina<\/option><option value=\"235\">Armenia<\/option><option value=\"8\">Aruba<\/option><option value=\"227\">Australia<\/option><option value=\"11\">Austria<\/option><option value=\"12\">Azores<\/option><option value=\"230\">Bahamas<\/option><option value=\"18\">Bahrain<\/option><option value=\"24\">Bangladesh<\/option><option value=\"219\">Barbados<\/option><option value=\"236\">Belarus<\/option><option value=\"15\">Belgium<\/option><option value=\"22\">Belize<\/option><option value=\"16\">Benin<\/option><option value=\"17\">Bermuda<\/option><option value=\"19\">Bhutan<\/option><option value=\"25\">Bolivia<\/option><option value=\"237\">Bosnia and Herzegovina<\/option><option value=\"26\">Botswana<\/option><option value=\"27\">Brazil<\/option><option value=\"202\">British Virgin Islnd<\/option><option value=\"28\">Brunei Darussalam<\/option><option value=\"29\">Bulgaria<\/option><option value=\"21\">Burkina Faso<\/option><option value=\"30\">Burma<\/option><option value=\"23\">Burundi<\/option><option value=\"238\">Cambodia<\/option><option value=\"31\">Cameroon<\/option><option value=\"32\">Canada<\/option><option value=\"42\">Canal Zone<\/option><option value=\"41\">Canary Islands<\/option><option value=\"46\">Cape Verde<\/option><option value=\"49\">Cayman Islands<\/option><option value=\"33\">Central African Rep<\/option><option value=\"36\">Chad<\/option><option value=\"35\">Channel Islands<\/option><option value=\"37\">Chile<\/option><option value=\"239\">China<\/option><option value=\"43\">Colombia<\/option><option value=\"40\">Comoros<\/option><option value=\"171\">Confed of Senegambia<\/option><option value=\"44\">Congo<\/option><option value=\"39\">Cook Islands<\/option><option value=\"45\">Costa Rica<\/option><option value=\"232\">Croatia<\/option><option value=\"47\">Cuba<\/option><option value=\"48\">Curacao<\/option><option value=\"50\">Cyprus<\/option><option value=\"240\">Czech Republic<\/option><option value=\"51\">Czechoslovakia<\/option><option value=\"52\">Dahomey<\/option><option value=\"53\">Denmark<\/option><option value=\"54\">Djibouti<\/option><option value=\"145\">Dm People&#8217;s Rp Korea<\/option><option value=\"55\">Dominica<\/option><option value=\"56\">Dominican Republic<\/option>\n\t\t\t\t\t\t\t\t<option value=\"241\">East Timor<\/option><option value=\"57\">Ecuador<\/option><option value=\"58\">Egypt<\/option><option value=\"59\">El Salvador<\/option><option value=\"60\">England<\/option><option value=\"61\">Equatorial Guinea<\/option><option value=\"242\">Eritrea<\/option><option value=\"62\">Estonia<\/option><option value=\"63\">Ethiopia<\/option><option value=\"64\">Faeroe Islands<\/option><option value=\"67\">Falkland Islands<\/option><option value=\"69\">Fed Rep of Germany<\/option><option value=\"243\">Federated States of Micronesia<\/option><option value=\"66\">Fiji<\/option><option value=\"65\">Finland<\/option><option value=\"68\">France<\/option><option value=\"34\">French Guiana<\/option><option value=\"70\">French Polynesia<\/option><option value=\"71\">Gabon<\/option><option value=\"244\">Georgia<\/option><option value=\"74\">Germany<\/option><option value=\"75\">Ghana<\/option><option value=\"76\">Gibraltar<\/option><option value=\"77\">Gilbert &amp; Ellice Is<\/option><option value=\"79\">Greece<\/option><option value=\"80\">Greenland<\/option><option value=\"73\">Grenada<\/option><option value=\"81\">Guadaloupe<\/option><option value=\"78\">Guatemala<\/option><option value=\"83\">Guinea<\/option><option value=\"82\">Guinea-Bissau<\/option><option value=\"84\">Guyana<\/option><option value=\"85\">Haiti<\/option><option value=\"88\">Honduras<\/option><option value=\"86\">Hong Kong<\/option><option value=\"89\">Hungary<\/option><option value=\"90\">Iceland<\/option><option value=\"92\">India<\/option><option value=\"91\">Indonesia<\/option><option value=\"95\">Iran<\/option><option value=\"96\">Iraq<\/option><option value=\"94\">Ireland<\/option><option value=\"97\">Isle Of Man<\/option><option value=\"98\">Israel<\/option><option value=\"99\">Italy<\/option><option value=\"100\">Ivory Coast<\/option><option value=\"101\">Jamaica<\/option><option value=\"102\">Japan<\/option><option value=\"103\">Jordan<\/option><option value=\"105\">Kampuchea<\/option><option value=\"245\">Kazakhstan<\/option><option value=\"106\">Kenya<\/option><option value=\"108\">Kiribati<\/option><option value=\"246\">Kosovo<\/option><option value=\"109\">Kuwait<\/option><option value=\"247\">Kyrgyzstan<\/option><option value=\"110\">Laos<\/option><option value=\"111\">Latvia<\/option><option value=\"112\">Lebanon<\/option><option value=\"113\">Lesotho<\/option><option value=\"114\">Liberia<\/option><option value=\"118\">Libya<\/option><option value=\"115\">Liechtenstein<\/option><option value=\"116\">Lithuania<\/option>\n\t\t\t\t\t\t\t\t<option value=\"117\">Luxembourg<\/option><option value=\"119\">Macau<\/option><option value=\"248\">Macedonia<\/option><option value=\"120\">Madagascar<\/option><option value=\"127\">Malawi<\/option><option value=\"121\">Malaysia<\/option><option value=\"249\">Maldives<\/option><option value=\"126\">Mali<\/option><option value=\"133\">Malta<\/option><option value=\"250\">Marshall Islands<\/option><option value=\"122\">Martinique<\/option><option value=\"123\">Mauritania<\/option><option value=\"134\">Mauritius<\/option><option value=\"125\">Mexico<\/option><option value=\"251\">Moldova<\/option><option value=\"130\">Monaco<\/option><option value=\"129\">Mongolia<\/option><option value=\"252\">Montenegro<\/option><option value=\"128\">Montserrat Island<\/option><option value=\"131\">Morocco<\/option><option value=\"132\">Mozambique<\/option><option value=\"253\">Myanmar<\/option><option value=\"135\">Namibia<\/option><option value=\"136\">Nauru<\/option><option value=\"138\">Nepal<\/option><option value=\"87\">Netherlands<\/option><option value=\"148\">Netherlands Antilles<\/option><option value=\"139\">Nevis<\/option><option value=\"137\">New Caledonia<\/option><option value=\"140\">New Guinea<\/option><option value=\"213\">New Hebrides<\/option><option value=\"149\">New Zealand<\/option><option value=\"141\">Nicaragua<\/option><option value=\"142\">Niger<\/option><option value=\"147\">Nigeria<\/option><option value=\"144\">Niue<\/option><option value=\"254\">North Korea<\/option><option value=\"143\">Northern Ireland, UK<\/option><option value=\"146\">Norway<\/option><option value=\"150\">Okinawa<\/option><option value=\"151\">Oman<\/option><option value=\"152\">Pacific Islands<\/option><option value=\"153\">Pakistan<\/option><option value=\"255\">Palau<\/option><option value=\"154\">Panama<\/option><option value=\"155\">Papua New Guinea<\/option><option value=\"156\">Paraguay<\/option><option value=\"222\">People&#8217;s Dm Rp Yemen<\/option><option value=\"38\">People&#8217;s Rp of China<\/option><option value=\"157\">Peru<\/option><option value=\"158\">Philippines<\/option><option value=\"159\">Pitcairn<\/option><option value=\"160\">Poland<\/option><option value=\"161\">Portugal<\/option><option value=\"20\">Portuguese Guinea<\/option><option value=\"162\">Qatar<\/option><option value=\"177\">Republic of Korea<\/option><option value=\"124\">Republic of Maldives<\/option><option value=\"256\">Republic of the Congo<\/option><option value=\"163\">Reunion Islands<\/option><option value=\"164\">Romania<\/option>\n\t\t\t\t\t\t\t\t<option value=\"233\">Russia<\/option><option value=\"166\">Rwanda<\/option><option value=\"167\">Ryukyu Islands<\/option><option value=\"185\">Saint Lucia<\/option><option value=\"257\">Samoa<\/option><option value=\"178\">San Marino<\/option><option value=\"168\">Sao Tome &amp; Principe<\/option><option value=\"169\">Saudi Arabia<\/option><option value=\"170\">Scotland<\/option><option value=\"172\">Senegal<\/option><option value=\"258\">Serbia<\/option><option value=\"173\">Seychelles<\/option><option value=\"174\">Sierra Leone<\/option><option value=\"175\">Singapore<\/option><option value=\"234\">Slovakia<\/option><option value=\"228\">Slovenia<\/option><option value=\"181\">Solomon Islands<\/option><option value=\"182\">Somalia<\/option><option value=\"180\">South Africa<\/option><option value=\"229\">South Korea<\/option><option value=\"259\">South Sudan<\/option><option value=\"183\">Spain<\/option><option value=\"184\">Sri Lanka<\/option><option value=\"186\">St Martin<\/option><option value=\"187\">St Vincent &amp; Grenad<\/option><option value=\"176\">St. Kitts and Nevis<\/option><option value=\"188\">Sudan<\/option><option value=\"189\">Suriname<\/option><option value=\"190\">Swaziland<\/option><option value=\"191\">Sweden<\/option><option value=\"192\">Switzerland<\/option><option value=\"193\">Syria<\/option><option value=\"194\">Tahiti<\/option><option value=\"195\">Taiwan<\/option><option value=\"260\">Tajikistan<\/option><option value=\"196\">Tanzania<\/option><option value=\"197\">Thailand<\/option><option value=\"13\">The Bahamas<\/option><option value=\"72\">The Gambia<\/option><option value=\"198\">Tibet<\/option><option value=\"199\">Timor<\/option><option value=\"200\">Togo<\/option><option value=\"201\">Tonga<\/option><option value=\"203\">Trinidad &amp; Tobago<\/option><option value=\"204\">Tunisia<\/option><option value=\"205\">Turkey<\/option><option value=\"261\">Turkmenistan<\/option><option value=\"206\">Tuvalu<\/option><option value=\"208\">Uganda<\/option><option value=\"262\">Ukraine<\/option><option value=\"207\">United Arab Emirates<\/option><option value=\"209\">United Kingdom<\/option><option value=\"210\">Upper Volta<\/option><option value=\"211\">Uruguay<\/option><option selected=\"selected\" value=\"1\">USA<\/option><option value=\"263\">Uzbekistan<\/option><option value=\"215\">Vanuatu<\/option><option value=\"214\">Vatican City<\/option><option value=\"216\">Venezuela<\/option><option value=\"217\">Vietnam<\/option><option value=\"218\">Wales<\/option>\n\t\t\t\t\t\t\t\t<option value=\"179\">Western Samoa<\/option><option value=\"220\">Yemen Arab Republic<\/option><option value=\"223\">Yugoslavia<\/option><option value=\"107\">Zaire<\/option><option value=\"224\">Zambia<\/option><option value=\"225\">Zimbabwe<\/option>\n\t\t\t\t\t\t\t<\/select><\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\n\t\t\t\t\t<div class=\"create-account-submit\">\n\t\t\t\t\t\t<input type=\"submit\" value=\"Create Account\" name=\"create-account\">\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/form>\n\t\t\t\t<div class=\"create-account-return hide\"><\/div>\n\t\t\t<\/div>\n\t\t\t<div class=\"password-reset-box\">\n\t\t\t\t<div class=\"password-reset-top-bar\">Reset Your Password<\/div>\n\t\t\t\t<form id=\"password-reset-form\" action=\"\" method=\"POST\">\n\t\t\t\t\t<div class=\"password-reset-form\">\n\t\t\t\t\t\t<div class=\"password-reset-fields\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>EMAIL<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"password-reset-email\" name=\"password-reset-email\" placeholder=\"\">\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div class=\"password-reset-submit\">\n\t\t\t\t\t\t<input type=\"submit\" value=\"Reset Password\" name=\"password-reset\">\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/form>\n\t\t\t\t<div class=\"password-reset-return hide\"><\/div>\n\t\t\t<\/div>\n\t\t\t<div class=\"password-change-box\">\n\t\t\t\t<div class=\"password-change-top-bar\">Set Your New Password<\/div>\n\t\t\t\t<form id=\"password-change-form\" action=\"\" method=\"POST\">\n\t\t\t\t\t<div class=\"password-change-form\">\n\t\t\t\t\t\t<div class=\"password-change-fields\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>NEW PASSWORD<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"password\" id=\"password-change-new-pass\" name=\"password-change-new-pass\" placeholder=\"****\">\n\t\t\t\t\t\t\t<div class=\"label-flex\"><label>CONFIRM NEW PASSWORD<\/label><span class=\"required\">(Required)<\/span><\/div>\n\t\t\t\t\t\t\t<input type=\"password\" id=\"password-change-confirm-pass\" name=\"password-change-confirm-pass\" placeholder=\"****\">\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div class=\"password-change-submit\">\n\t\t\t\t\t\t<input type=\"submit\" value=\"Change Password\" name=\"password-change\">\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/form>\n\t\t\t\t<div class=\"password-change-return hide\"><\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\t<\/div>\n<\/section>\n<script>\njQuery(document).ready(function ($) {\n\tvar sessionKey = (typeof getCookie === 'function') ? (getCookie('sessionKey') || '') : '';\n\t\/\/ Initial view from URL: login unless ?portal=create-account or ?portal=reset-password (or ?tnaction=...)\n\tvar initialTnaction = $('.form-container-flex').attr('data-tnaction') || '';\n\tif (!initialTnaction && typeof window.location !== 'undefined' && window.location.search) {\n\t\tvar params = new URLSearchParams(window.location.search);\n\t\tinitialTnaction = params.get('portal') || params.get('tnaction') || '';\n\t}\n\tinitialTnaction = ['create-account', 'reset-password', 'login'].indexOf(initialTnaction) >= 0 ? initialTnaction : 'login';\n\n\tvar setAjaxHeaders = window.hmnsSetAjaxHeaders;\n\t\n\t\/\/ Store login status globally\n\tvar userIsLoggedIn = false;\n\t\n\t\/\/ Apply session result from footer (no duplicate API call). Footer triggers hmns_session_checked with this payload.\n\tfunction applySessionCheckResult(response) {\n\t\tif (!response) return;\n\t\tuserIsLoggedIn = response.isLoggedIn || false;\n\t\t$('.login-status-checking').hide();\n\t\tif (userIsLoggedIn) {\n\t\t\t$('form#tessitura-login-form').hide();\n\t\t\t$('.loginReturn').html('<h6>You are already logged into your TNEW account<\/h6>').removeClass('hide');\n\t\t} else {\n\t\t\t$('form#tessitura-login-form').show();\n\t\t\t$('.loginReturn').addClass('hide');\n\t\t}\n\t}\n\t\n\t\/\/ Only run login-form display when initial view is login (not create-account or reset-password)\n\tif (initialTnaction === 'login') {\n\t\tif (!sessionKey || sessionKey === '') {\n\t\t\t$('.login-status-checking').hide();\n\t\t\t$('form#tessitura-login-form').show();\n\t\t\t$('.loginReturn').addClass('hide');\n\t\t} else {\n\t\t\t\/\/ Use footer's session check result (hmns_session_checked) instead of a second API call\n\t\t\tif (window.hmns_last_session_check) {\n\t\t\t\tapplySessionCheckResult(window.hmns_last_session_check);\n\t\t\t} else {\n\t\t\t\t$(document).one('hmns_session_checked', function(e, response) {\n\t\t\t\t\tapplySessionCheckResult(response);\n\t\t\t\t});\n\t\t\t\t\/\/ Fallback: if event never fires (e.g. footer error), show form after 2s\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tif ($('.login-status-checking').is(':visible')) {\n\t\t\t\t\t\tapplySessionCheckResult({ isLoggedIn: false });\n\t\t\t\t\t}\n\t\t\t\t}, 2000);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tvar createTNEWSession = window.hmnsCreateTNEWSession;\n\t\n\t\/\/ Form Switcher Logic\n\t$('#show-login-form').on('click', function() {\n\t\t$('.form-switcher button').addClass('secondary');\n\t\t$(this).removeClass('secondary');\n\t\t$('.create-account-box, .password-reset-box').removeClass('active');\n\t\t$('.login-form-box').removeClass('hide');\n\t\t\n\t\t\/\/ Check login status (use global variable or cookie as fallback)\n\t\tvar tessituraLoginCookie = getCookie('tessituraLogin');\n\t\tvar isLoggedIn = userIsLoggedIn || (tessituraLoginCookie === 'true' || tessituraLoginCookie === true);\n\t\t\n\t\tif (isLoggedIn) {\n\t\t\t\/\/ User is logged in - show message instead of form\n\t\t\t$('form#tessitura-login-form').hide();\n\t\t\t$('.login-status-checking').hide();\n\t\t\t$('.loginReturn').html('<h6>You are already logged into your TNEW account<\/h6>').removeClass('hide');\n\t\t} else {\n\t\t\t\/\/ User is not logged in - show login form\n\t\t\t$('form#tessitura-login-form').show();\n\t\t\t$('.login-status-checking').hide();\n\t\t\t$('.loginReturn').addClass('hide');\n\t\t}\n\t});\n\t\n\t$('#show-create-account-form').on('click', function() {\n\t\t$('.form-switcher button').addClass('secondary');\n\t\t$(this).removeClass('secondary');\n\t\t$('.login-form-box').addClass('hide');\n\t\t$('.password-reset-box').removeClass('active');\n\t\t$('.create-account-box').addClass('active');\n\t\t\n\t\t\/\/ Check login status\n\t\tvar tessituraLoginCookie = getCookie('tessituraLogin');\n\t\tvar isLoggedIn = userIsLoggedIn || (tessituraLoginCookie === 'true' || tessituraLoginCookie === true);\n\t\t\n\t\tif (isLoggedIn) {\n\t\t\t\/\/ User is logged in - hide form and show message\n\t\t\t$('form#create-account-form').hide();\n\t\t\t$('.create-account-return').html('<h6>You must be logged out of all TNEW accounts to create a new account<\/h6>').removeClass('hide');\n\t\t} else {\n\t\t\t\/\/ User is not logged in - show form\n\t\t\t$('form#create-account-form').show();\n\t\t\t$('.create-account-return').addClass('hide');\n\t\t}\n\t});\n\t\n\t$('#show-password-reset-form').on('click', function() {\n\t\t$('.form-switcher button').addClass('secondary');\n\t\t$(this).removeClass('secondary');\n\t\t$('.login-form-box').addClass('hide');\n\t\t$('.create-account-box').removeClass('active');\n\t\t$('.password-reset-box').addClass('active');\n\t\t\/\/ Password reset form is always usable - ensure form is visible\n\t\t$('form#password-reset-form').show();\n\t\t$('.password-reset-return').addClass('hide');\n\t});\n\t\n\t\/\/ Apply initial form on load (initialTnaction already set at top from data-tnaction \/ ?portal \/ ?tnaction)\n\tif (initialTnaction === 'create-account') {\n\t\t$('.form-switcher button').addClass('secondary');\n\t\t$('#show-create-account-form').removeClass('secondary');\n\t\t$('.login-form-box').addClass('hide');\n\t\t$('.password-reset-box').removeClass('active');\n\t\t$('.create-account-box').addClass('active');\n\t\t$('.login-status-checking').hide();\n\t\tif (typeof getCookie === 'function') {\n\t\t\tvar tessituraLoginCookie = getCookie('tessituraLogin');\n\t\t\tvar isLoggedIn = userIsLoggedIn || (tessituraLoginCookie === 'true' || tessituraLoginCookie === true);\n\t\t\tif (isLoggedIn) {\n\t\t\t\t$('form#create-account-form').hide();\n\t\t\t\t$('.create-account-return').html('<h6>You must be logged out of all TNEW accounts to create a new account<\/h6>').removeClass('hide');\n\t\t\t} else {\n\t\t\t\t$('form#create-account-form').show();\n\t\t\t\t$('.create-account-return').addClass('hide');\n\t\t\t}\n\t\t} else {\n\t\t\t$('form#create-account-form').show();\n\t\t\t$('.create-account-return').addClass('hide');\n\t\t}\n\t} else if (initialTnaction === 'reset-password') {\n\t\t$('.form-switcher button').addClass('secondary');\n\t\t$('#show-password-reset-form').removeClass('secondary');\n\t\t$('.login-form-box').addClass('hide');\n\t\t$('.create-account-box').removeClass('active');\n\t\t$('.password-reset-box').addClass('active');\n\t\t$('.login-status-checking').hide();\n\t\t$('form#password-reset-form').show();\n\t\t$('.password-reset-return').addClass('hide');\n\t}\n\t\/\/ when initialTnaction === 'login', PHP and showLoginForm\/waitForSessionCheck already handle it\n\t\n\t\/\/ CONVERTED: Login Form - New TNEW Method with Custom Router\n\t$('form#tessitura-login-form').on('submit',function (e) {\n\t\te.stopImmediatePropagation();\n\t\te.preventDefault();\n\t\tvar $form = $(this);\n\t\tvar userName = $form.find('input[name=\"tessituraUsername\"]').val();\n\t\tvar userPass = $form.find('input[name=\"tessituraPassword\"]').val();\n\t\tvar returnURL = '';\n\t\t\n\t\tsessionKey = getCookie('sessionKey');\n\t\t\n\t\tfunction performLogin(key) {\n\t\t\tajaxArray = [];\n\t\t\t\/\/ NEW FORMAT: No base URL, just endpoint and parameters\n\t\t\tajaxArray.push('\/api\/Web\/Session\/{sessionkey}\/Login');\n\t\t\tajaxArray.push(key);\n\t\t\tajaxArray.push(userName);\n\t\t\tajaxArray.push(userPass);\n\t\t\tquery = JSON.stringify(ajaxArray);\n\t\t\t\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype : 'post',\n\t\t\t\turl : hmns_ajax_router.url,\n\t\t\t\tbeforeSend: setAjaxHeaders,\n\t\t\t\tdata : {\n\t\t\t\t\taction : 'tessitura_api_interactions',\n\t\t\t\t\tquery : query\t\t\n\t\t\t\t},\n\t\t\t\tbeforeSend : function (xhr) {\n\t\t\t\t\tsetAjaxHeaders(xhr);\n\t\t\t\t\t$('form#tessitura-login-form').addClass('greyed-out');\n\t\t\t\t},\n\t\t\t\tsuccess : function (response) {\n\t\t\t\t\t\n\t\t\t\t\t\/\/ Check for new format response (object with success property)\n\t\t\t\t\tif (response && typeof response === 'object' && response.success === true) {\n\t\t\t\t\t\tuserIsLoggedIn = true; \/\/ Update global login status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Set modeOfSale cookie from login response - prevents redirect loop on return\n\t\t\t\t\t\tif (response.modeOfSaleId) {\n\t\t\t\t\t\t\tsetCookie('modeOfSale', response.modeOfSaleId, 30);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Clear mode-of-sale reload flags so product pages can reload with new MOS if needed\n\t\t\t\t\t\tfor (var key in sessionStorage) {\n\t\t\t\t\t\t\tif (key.indexOf('mosReload_') === 0) {\n\t\t\t\t\t\t\t\tsessionStorage.removeItem(key);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('form#tessitura-login-form').addClass('hide');\n\t\t\t\t\t\tvar returnMessage = '<h6>Login successful!<\/h6>';\n\t\t\t\t\t\tif (returnURL && returnURL !== '') {\n\t\t\t\t\t\t\treturnMessage += '<p>Returning you to <a href=\"' + returnURL + '\">' + returnURL + '<\/a><\/p>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturnMessage += '<p>Redirecting you now...<\/p>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$('.loginReturn').html(returnMessage).removeClass('hide');\t\n\t\t\t\t\t\twindow.setTimeout(function () {\n\t\t\t\t\t\t\tif (returnURL && returnURL !== '') {\n\t\t\t\t\t\t\t\twindow.location.replace(returnURL);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twindow.location.replace('\/');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},2000);\n\t\t\t\t\t} else if (response && typeof response === 'object' && response.success === false) {\n\t\t\t\t\t\t\/\/ New format error response with details\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Try to get more specific error info\n\t\t\t\t\t\tvar errorDescription = '';\n\t\t\t\t\t\tif (response.tessitura_response && response.tessitura_response[0]) {\n\t\t\t\t\t\t\terrorDescription = response.tessitura_response[0].Description || '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Intelligent error detection and user guidance\n\t\t\t\t\t\tvar errorTitle = 'Login Failed';\n\t\t\t\t\t\tvar errorMsg = 'Please check your credentials and try again.';\n\t\t\t\t\t\tvar htmlMsg = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Check for \"account not found\" type errors\n\t\t\t\t\t\tif (errorDescription.toLowerCase().indexOf('not found') !== -1 || \n\t\t\t\t\t\t    errorDescription.toLowerCase().indexOf('does not exist') !== -1 ||\n\t\t\t\t\t\t    errorDescription.toLowerCase().indexOf('no account') !== -1) {\n\t\t\t\t\t\t\terrorTitle = 'Account Not Found';\n\t\t\t\t\t\t\terrorMsg = 'We couldn\\'t find an account with that email address.';\n\t\t\t\t\t\t\thtmlMsg = '<h6>' + errorTitle + '<\/h6><p>' + errorMsg + '<\/p>';\n\t\t\t\t\t\t\thtmlMsg += '<div style=\"margin-top: 16px;\"><button id=\"login-switch-to-create\" style=\"background: var(--monarch-alt); color: white; padding: 12px 24px; border: 0; cursor: pointer; border-radius: 4px;\">Create Account<\/button><\/div>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$('.loginReturn').html(htmlMsg).removeClass('hide');\n\t\t\t\t\t\t\t$('form#tessitura-login-form').removeClass('greyed-out');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ Add click handler\n\t\t\t\t\t\t\t$('#login-switch-to-create').on('click', function() {\n\t\t\t\t\t\t\t\t$('#show-create-account-form').trigger('click');\n\t\t\t\t\t\t\t\t$('.loginReturn').addClass('hide');\n\t\t\t\t\t\t\t\t\/\/ Pre-fill email\n\t\t\t\t\t\t\t\tvar emailVal = $('input[name=\"tessituraUsername\"]').val();\n\t\t\t\t\t\t\t\tif (emailVal) {\n\t\t\t\t\t\t\t\t\t$('input[name=\"create-account-email\"]').val(emailVal);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ Check for \"wrong password\" type errors\n\t\t\t\t\t\telse if (errorDescription.toLowerCase().indexOf('password') !== -1 || \n\t\t\t\t\t\t         errorDescription.toLowerCase().indexOf('credential') !== -1 ||\n\t\t\t\t\t\t         errorDescription.toLowerCase().indexOf('incorrect') !== -1) {\n\t\t\t\t\t\t\terrorTitle = 'Incorrect Password';\n\t\t\t\t\t\t\terrorMsg = 'The password you entered is incorrect. Would you like to reset it?';\n\t\t\t\t\t\t\thtmlMsg = '<h6>' + errorTitle + '<\/h6><p>' + errorMsg + '<\/p>';\n\t\t\t\t\t\t\thtmlMsg += '<div style=\"margin-top: 16px;\"><button id=\"login-switch-to-reset\" style=\"background: var(--monarch-alt); color: white; padding: 12px 24px; border: 0; cursor: pointer; border-radius: 4px;\">Reset Password<\/button><\/div>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$('.loginReturn').html(htmlMsg).removeClass('hide');\n\t\t\t\t\t\t\t$('form#tessitura-login-form').removeClass('greyed-out');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ Add click handler\n\t\t\t\t\t\t\t$('#login-switch-to-reset').on('click', function() {\n\t\t\t\t\t\t\t\t$('#show-password-reset-form').trigger('click');\n\t\t\t\t\t\t\t\t$('.loginReturn').addClass('hide');\n\t\t\t\t\t\t\t\t\/\/ Pre-fill email\n\t\t\t\t\t\t\t\tvar emailVal = $('input[name=\"tessituraUsername\"]').val();\n\t\t\t\t\t\t\t\tif (emailVal) {\n\t\t\t\t\t\t\t\t\t$('input[name=\"password-reset-email\"]').val(emailVal);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\/\/ Generic login failed\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (response.tessitura_response && response.tessitura_response.Message) {\n\t\t\t\t\t\t\t\terrorMsg = response.tessitura_response.Message;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thtmlMsg = '<h6>' + errorTitle + '<\/h6><p>' + errorMsg + '<\/p>';\n\t\t\t\t\t\t\thtmlMsg += '<div style=\"margin-top: 16px;\"><button id=\"login-switch-to-reset-generic\" style=\"background: var(--cream); color: var(--fossil-rim); padding: 12px 24px; border: 1px solid rgba(95,85,65,.2); cursor: pointer; border-radius: 4px;\">Forgot Password?<\/button><\/div>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$('.loginReturn').html(htmlMsg).removeClass('hide');\n\t\t\t\t\t\t\t$('form#tessitura-login-form').removeClass('greyed-out');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ Add click handler\n\t\t\t\t\t\t\t$('#login-switch-to-reset-generic').on('click', function() {\n\t\t\t\t\t\t\t\t$('#show-password-reset-form').trigger('click');\n\t\t\t\t\t\t\t\t$('.loginReturn').addClass('hide');\n\t\t\t\t\t\t\t\t\/\/ Pre-fill email\n\t\t\t\t\t\t\t\tvar emailVal = $('input[name=\"tessituraUsername\"]').val();\n\t\t\t\t\t\t\t\tif (emailVal) {\n\t\t\t\t\t\t\t\t\t$('input[name=\"password-reset-email\"]').val(emailVal);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\/\/ Old format or unexpected response\n\t\t\t\t\t\t$('.loginReturn').html('<h6>Login failed<\/h6><p>Please check your credentials and try again.<\/p>').removeClass('hide');\n\t\t\t\t\t\t$('form#tessitura-login-form').removeClass('greyed-out');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function(xhr, status, error) {\n\t\t\t\t\t$('.loginReturn').html('<h6>Login error<\/h6><p>An error occurred. Please try again.<\/p>').removeClass('hide');\n\t\t\t\t\t$('form#tessitura-login-form').removeClass('greyed-out');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\t\/\/ Check if we have a session key, create one if not\n\t\tif (sessionKey == '' || sessionKey == null) {\n\t\t\tcreateTNEWSession(function(newSessionKey) {\n\t\t\t\tperformLogin(newSessionKey);\n\t\t\t}, function(error) {\n\t\t\t\t$('.loginReturn').html('<h6>Session Error<\/h6><p>Could not create session. Please try again.<\/p>').removeClass('hide');\n\t\t\t});\n\t\t} else {\n\t\t\tperformLogin(sessionKey);\n\t\t}\n\t});\n\t\n\t\/\/ Account Creation Form Handler - New TNEW Method with Custom Router\n\t$('form#create-account-form').on('submit',function (e) {\n\t\te.stopImmediatePropagation();\n\t\te.preventDefault();\n\t\tvar $form = $(this);\n\t\tvar returnURL = '';\n\t\t\n\t\t\/\/ Dynamic validation for all required fields\n\t\t\/\/ Find all label-flex elements that contain a span.required\n\t\tvar missingFields = [];\n\t\tvar $requiredLabels = $form.find('.label-flex').has('span.required');\n\t\t\n\t\t$requiredLabels.each(function() {\n\t\t\tvar $label = $(this);\n\t\t\tvar fieldLabel = $label.find('label').text().trim();\n\t\t\tvar $field = null;\n\t\t\t\n\t\t\t\/\/ Try to find the field immediately after the label-flex\n\t\t\t$field = $label.next('input, select');\n\t\t\t\n\t\t\t\/\/ If not found, look for the next sibling element that is an input or select\n\t\t\tif ($field.length === 0) {\n\t\t\t\tvar $next = $label.next();\n\t\t\t\twhile ($next.length > 0 && !$next.is('input, select')) {\n\t\t\t\t\t$next = $next.next();\n\t\t\t\t}\n\t\t\t\tif ($next.is('input, select')) {\n\t\t\t\t\t$field = $next;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\/\/ If still not found, try finding by known field patterns based on label text\n\t\t\tif ($field.length === 0) {\n\t\t\t\tif (fieldLabel.indexOf('EMAIL') !== -1) {\n\t\t\t\t\t$field = $form.find('input[name=\"create-account-email\"]');\n\t\t\t\t} else if (fieldLabel.indexOf('PASSWORD') !== -1 && fieldLabel.indexOf('CONFIRM') === -1) {\n\t\t\t\t\t$field = $form.find('input[name=\"create-account-pass\"]');\n\t\t\t\t} else if (fieldLabel.indexOf('CONFIRM PASSWORD') !== -1 || fieldLabel.indexOf('CONFIRM') !== -1) {\n\t\t\t\t\t$field = $form.find('input[name=\"create-account-confirm-pass\"]');\n\t\t\t\t} else if (fieldLabel.indexOf('PREFIX') !== -1) {\n\t\t\t\t\t$field = $form.find('select#Patron_PrefixId');\n\t\t\t\t} else if (fieldLabel.indexOf('FIRST NAME') !== -1) {\n\t\t\t\t\t$field = $form.find('input[name=\"create-account-first-name\"]');\n\t\t\t\t} else if (fieldLabel.indexOf('MIDDLE NAME') !== -1) {\n\t\t\t\t\t$field = $form.find('input[name=\"create-account-middle-name\"]');\n\t\t\t\t} else if (fieldLabel.indexOf('LAST NAME') !== -1) {\n\t\t\t\t\t$field = $form.find('input[name=\"create-account-last-name\"]');\n\t\t\t\t} else if (fieldLabel.indexOf('PHONE') !== -1) {\n\t\t\t\t\t$field = $form.find('input[name=\"create-account-phone\"]');\n\t\t\t\t} else if (fieldLabel.indexOf('STREET ADDRESS') !== -1) {\n\t\t\t\t\t$field = $form.find('input[name=\"create-account-street-address\"]');\n\t\t\t\t} else if (fieldLabel.indexOf('CITY') !== -1) {\n\t\t\t\t\t$field = $form.find('input[name=\"create-account-city\"]');\n\t\t\t\t} else if (fieldLabel.indexOf('STATE') !== -1) {\n\t\t\t\t\t$field = $form.find('select#Address_StateId');\n\t\t\t\t} else if (fieldLabel.indexOf('POSTAL CODE') !== -1) {\n\t\t\t\t\t$field = $form.find('input[name=\"create-account-postal-code\"]');\n\t\t\t\t} else if (fieldLabel.indexOf('COUNTRY') !== -1) {\n\t\t\t\t\t$field = $form.find('select#Address_CountryId');\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($field.length > 0) {\n\t\t\t\tvar fieldValue = $field.val();\n\t\t\t\tvar isEmpty = false;\n\t\t\t\t\n\t\t\t\t\/\/ Check if field is empty\n\t\t\t\tif ($field.is('select')) {\n\t\t\t\t\t\/\/ For selects, check if value is empty or \"-1\" (None option)\n\t\t\t\t\tif (!fieldValue || fieldValue === '' || fieldValue === '-1') {\n\t\t\t\t\t\tisEmpty = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t\/\/ For inputs, check if value is empty or just whitespace\n\t\t\t\t\tif (!fieldValue || fieldValue.trim() === '') {\n\t\t\t\t\t\tisEmpty = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (isEmpty) {\n\t\t\t\t\tmissingFields.push(fieldLabel);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t\/\/ Get field values for submission\n\t\tvar firstName = $form.find('input[name=\"create-account-first-name\"]').val();\n\t\tvar lastName = $form.find('input[name=\"create-account-last-name\"]').val();\n\t\tvar email = $form.find('input[name=\"create-account-email\"]').val();\n\t\tvar password = $form.find('input[name=\"create-account-pass\"]').val();\n\t\tvar confirmPassword = $form.find('input[name=\"create-account-confirm-pass\"]').val();\n\t\tvar prefixId = $form.find('select#Patron_PrefixId').val();\n\t\tvar middleName = $form.find('input[name=\"create-account-middle-name\"]').val();\n\t\tvar suffixId = $form.find('select#Patron_SuffixId').val();\n\t\tvar phoneNumber = $form.find('input[name=\"create-account-phone\"]').val();\n\t\tvar streetAddress = $form.find('input[name=\"create-account-street-address\"]').val();\n\t\tvar apartmentSuiteUnitOther = $form.find('input[name=\"create-account-apartment-suite-unit-other\"]').val();\n\t\tvar city = $form.find('input[name=\"create-account-city\"]').val();\n\t\tvar stateId = $form.find('select#Address_StateId').val();\n\t\tvar postalCode = $form.find('input[name=\"create-account-postal-code\"]').val();\n\t\tvar countryId = $form.find('select#Address_CountryId').val();\n\t\t\n\t\t\/\/ Show validation errors if any required fields are missing\n\t\tif (missingFields.length > 0) {\n\t\t\tvar errorMsg = '<h6>Missing Required Fields<\/h6><p>Please fill in the following required fields:<\/p><ul style=\"text-align: left; margin: 16px 0; padding-left: 24px;\">';\n\t\t\tfor (var i = 0; i < missingFields.length; i++) {\n\t\t\t\terrorMsg += '<li>' + missingFields[i] + '<\/li>';\n\t\t\t}\n\t\t\terrorMsg += '<\/ul>';\n\t\t\t$('.create-account-return').html(errorMsg).removeClass('hide');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\/\/ Password confirmation validation\n\t\tif (password !== confirmPassword) {\n\t\t\t$('.create-account-return').html('<h6>Password Mismatch<\/h6><p>Passwords do not match. Please try again.<\/p>').removeClass('hide');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tsessionKey = getCookie('sessionKey');\n\t\t\n\t\tfunction performRegistration(key) {\n\t\t\tajaxArray = [];\n\t\t\tajaxArray.push('\/api\/Web\/Registration\/{sessionKey}\/Register');\n\t\t\tajaxArray.push(key);\n\t\t\tajaxArray.push(prefixId);\n\t\t\tajaxArray.push(firstName);\n\t\t\tajaxArray.push(middleName);\n\t\t\tajaxArray.push(lastName);\n\t\t\tajaxArray.push(suffixId);\n\t\t\tajaxArray.push(email);\n\t\t\tajaxArray.push(phoneNumber);\n\t\t\tajaxArray.push(password);\n\t\t\tajaxArray.push(streetAddress);\n\t\t\tajaxArray.push(apartmentSuiteUnitOther);\n\t\t\tajaxArray.push(city);\n\t\t\tajaxArray.push(stateId);\n\t\t\tajaxArray.push(postalCode);\n\t\t\tajaxArray.push(countryId);\n\t\t\tquery = JSON.stringify(ajaxArray);\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype : 'post',\n\t\t\t\turl : hmns_ajax_router.url,\n\t\t\t\tbeforeSend: setAjaxHeaders,\n\t\t\t\tdata : {\n\t\t\t\t\taction : 'tessitura_api_interactions',\n\t\t\t\t\tquery : query\t\t\n\t\t\t\t},\n\t\t\t\tbeforeSend : function (xhr) {\n\t\t\t\t\tsetAjaxHeaders(xhr);\n\t\t\t\t\t$('form#create-account-form').addClass('greyed-out');\n\t\t\t\t},\n\t\t\t\tsuccess : function (response) {\n\t\t\t\t\t\n\t\t\t\t\tif (response.success) {\n\t\t\t\t\t\t$('form#create-account-form').addClass('hide');\n\t\t\t\t\t\t\/\/ After account creation, redirect to home instead of returnURL\n\t\t\t\t\t\t\/\/ (user may want to explore rather than return to previous page)\n\t\t\t\t\t\tvar returnMessage = '<h6>Account Created Successfully!<\/h6>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('.create-account-return').html(returnMessage).removeClass('hide');\t\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar errorMsg = response.message || 'Unknown error occurred';\n\t\t\t\t\t\tvar errorCode = response.error_code || 'unknown';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Special handling for duplicate email - add helpful links\n\t\t\t\t\t\tvar htmlMsg = '<h6>Account Creation Failed<\/h6><p>' + errorMsg + '<\/p>';\n\t\t\t\t\t\tif (errorCode === 'duplicate_email') {\n\t\t\t\t\t\t\thtmlMsg = '<h6>Account Already Exists<\/h6><p>' + errorMsg + '<\/p>';\n\t\t\t\t\t\t\thtmlMsg += '<div style=\"margin-top: 16px;\"><button id=\"switch-to-login\" style=\"background: var(--monarch-alt); color: white; padding: 12px 24px; border: 0; cursor: pointer; margin-right: 8px; border-radius: 4px;\">Go to Login<\/button>';\n\t\t\t\t\t\t\thtmlMsg += '<button id=\"switch-to-reset\" style=\"background: var(--cream); color: var(--fossil-rim); padding: 12px 24px; border: 1px solid rgba(95,85,65,.2); cursor: pointer; border-radius: 4px;\">Reset Password<\/button><\/div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('.create-account-return').html(htmlMsg).removeClass('hide');\n\t\t\t\t\t\t$('form#create-account-form').removeClass('greyed-out');\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Add click handlers for the buttons\n\t\t\t\t\t\t$('#switch-to-login').on('click', function() {\n\t\t\t\t\t\t\t$('#show-login-form').trigger('click');\n\t\t\t\t\t\t\t$('.create-account-return').addClass('hide');\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$('#switch-to-reset').on('click', function() {\n\t\t\t\t\t\t\t$('#show-password-reset-form').trigger('click');\n\t\t\t\t\t\t\t$('.create-account-return').addClass('hide');\n\t\t\t\t\t\t\t\/\/ Pre-fill the email if available\n\t\t\t\t\t\t\tvar emailVal = $('input[name=\"create-account-email\"]').val();\n\t\t\t\t\t\t\tif (emailVal) {\n\t\t\t\t\t\t\t\t$('input[name=\"password-reset-email\"]').val(emailVal);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function(xhr, status, error) {\n\t\t\t\t\t$('.create-account-return').html('<h6>Registration Error<\/h6><p>An error occurred. Please try again.<\/p>').removeClass('hide');\n\t\t\t\t\t$('form#create-account-form').removeClass('greyed-out');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\t\/\/ Check if we have a session key, create one if not\n\t\tif (sessionKey == '' || sessionKey == null) {\n\t\t\tcreateTNEWSession(function(newSessionKey) {\n\t\t\t\tperformRegistration(newSessionKey);\n\t\t\t}, function(error) {\n\t\t\t\t$('.create-account-return').html('<h6>Session Error<\/h6><p>Could not create session. Please try again.<\/p>').removeClass('hide');\n\t\t\t});\n\t\t} else {\n\t\t\tperformRegistration(sessionKey);\n\t\t}\n\t});\n\t\n\t\/\/ Password Reset Form Handler - Send Credentials Email\n\t$('form#password-reset-form').on('submit',function (e) {\n\t\te.stopImmediatePropagation();\n\t\te.preventDefault();\n\t\tvar $form = $(this);\n\t\tvar email = $form.find('input[name=\"password-reset-email\"]').val();\n\t\t\n\t\t\/\/ Validation\n\t\tif (!email) {\n\t\t\t$('.password-reset-return').html('<h6>Missing Email<\/h6><p>Please enter your email address.<\/p>').removeClass('hide');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tsessionKey = getCookie('sessionKey');\n\t\t\n\t\tfunction performSendCredentials(key) {\n\t\t\tajaxArray = [];\n\t\t\tajaxArray.push('\/api\/Web\/Session\/{sessionKey}\/Login\/SendCredentials');\n\t\t\tajaxArray.push(key);\n\t\t\tajaxArray.push(email);\n\t\t\tquery = JSON.stringify(ajaxArray);\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype : 'post',\n\t\t\t\turl : hmns_ajax_router.url,\n\t\t\t\tbeforeSend: setAjaxHeaders,\n\t\t\t\tdata : {\n\t\t\t\t\taction : 'tessitura_api_interactions',\n\t\t\t\t\tquery : query\t\t\n\t\t\t\t},\n\t\t\t\tbeforeSend : function (xhr) {\n\t\t\t\t\tsetAjaxHeaders(xhr);\n\t\t\t\t\t$('form#password-reset-form').addClass('greyed-out');\n\t\t\t\t},\n\t\t\t\tsuccess : function (response) {\n\t\t\t\t\tif (response.success) {\n\t\t\t\t\t\t$('form#password-reset-form').addClass('hide');\n\t\t\t\t\t\t$('.password-reset-return').html('<h6>Email Sent!<\/h6><p>Please check your email for password reset instructions.<\/p>').removeClass('hide');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\/\/ Intelligent error handling for password reset\n\t\t\t\t\t\tvar errorMsg = response.message || 'Failed to send password reset email';\n\t\t\t\t\t\tvar htmlMsg = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Check if account doesn't exist\n\t\t\t\t\t\tif (errorMsg.toLowerCase().indexOf('not found') !== -1 || \n\t\t\t\t\t\t    errorMsg.toLowerCase().indexOf('does not exist') !== -1 ||\n\t\t\t\t\t\t    errorMsg.toLowerCase().indexOf('no account') !== -1) {\n\t\t\t\t\t\t\thtmlMsg = '<h6>Account Not Found<\/h6><p>We couldn\\'t find an account with that email address.<\/p>';\n\t\t\t\t\t\t\thtmlMsg += '<div style=\"margin-top: 16px;\"><button id=\"reset-switch-to-create\" style=\"background: var(--monarch-alt); color: white; padding: 12px 24px; border: 0; cursor: pointer; border-radius: 4px;\">Create Account<\/button><\/div>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$('.password-reset-return').html(htmlMsg).removeClass('hide');\n\t\t\t\t\t\t\t$('form#password-reset-form').removeClass('greyed-out');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ Add click handler\n\t\t\t\t\t\t\t$('#reset-switch-to-create').on('click', function() {\n\t\t\t\t\t\t\t\t$('#show-create-account-form').trigger('click');\n\t\t\t\t\t\t\t\t$('.password-reset-return').addClass('hide');\n\t\t\t\t\t\t\t\t\/\/ Pre-fill email\n\t\t\t\t\t\t\t\tvar emailVal = $('input[name=\"password-reset-email\"]').val();\n\t\t\t\t\t\t\t\tif (emailVal) {\n\t\t\t\t\t\t\t\t\t$('input[name=\"create-account-email\"]').val(emailVal);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\/\/ Generic error\n\t\t\t\t\t\t\t$('.password-reset-return').html('<h6>Reset Failed<\/h6><p>' + errorMsg + '<\/p>').removeClass('hide');\n\t\t\t\t\t\t\t$('form#password-reset-form').removeClass('greyed-out');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function(xhr, status, error) {\n\t\t\t\t\t$('.password-reset-return').html('<h6>Reset Error<\/h6><p>An error occurred. Please try again.<\/p>').removeClass('hide');\n\t\t\t\t\t$('form#password-reset-form').removeClass('greyed-out');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\t\/\/ Check if we have a session key, create one if not\n\t\tif (sessionKey == '' || sessionKey == null) {\n\t\t\tcreateTNEWSession(function(newSessionKey) {\n\t\t\t\tperformSendCredentials(newSessionKey);\n\t\t\t}, function(error) {\n\t\t\t\t$('.password-reset-return').html('<h6>Session Error<\/h6><p>Could not create session. Please try again.<\/p>').removeClass('hide');\n\t\t\t});\n\t\t} else {\n\t\t\tperformSendCredentials(sessionKey);\n\t\t}\n\t});\n\t\n\t\/\/ Password Change Form Handler - Change password after passwordless login\n\tvar userLoginInfo = null; \/\/ Store user info from passwordless login\n\t\n\t$('form#password-change-form').on('submit',function (e) {\n\t\te.stopImmediatePropagation();\n\t\te.preventDefault();\n\t\tvar $form = $(this);\n\t\tvar newPassword = $form.find('input[name=\"password-change-new-pass\"]').val();\n\t\tvar confirmPassword = $form.find('input[name=\"password-change-confirm-pass\"]').val();\n\t\tvar returnURL = '';\n\t\t\n\t\t\/\/ Validation\n\t\tif (!newPassword || !confirmPassword) {\n\t\t\t$('.password-change-return').html('<h6>Missing Information<\/h6><p>Please fill in all fields.<\/p>').removeClass('hide');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (newPassword !== confirmPassword) {\n\t\t\t$('.password-change-return').html('<h6>Password Mismatch<\/h6><p>Passwords do not match. Please try again.<\/p>').removeClass('hide');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\/\/ Check user info - LoginName might be email, not UserId\n\t\tif (!userLoginInfo) {\n\t\t\t$('.password-change-return').html('<h6>Session Error<\/h6><p>User information not found. Please try the password reset process again.<\/p>').removeClass('hide');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\/\/ Determine LoginName - could be UserId, LoginName, or email\n\t\t\/\/ Note: LoginName in Tessitura API might actually be the email\/username, not UserId\n\t\tvar loginName = userLoginInfo.UserId || userLoginInfo.LoginName || userLoginInfo.ElectronicAddress;\n\t\tvar emailAddress = userLoginInfo.ElectronicAddress;\n\t\tvar constituentId = userLoginInfo.ConstituentId;\n\t\tvar webLoginId = userLoginInfo.WebLoginId;\n\t\t\n\t\tif (!loginName || !emailAddress) {\n\t\t\t$('.password-change-return').html('<h6>Session Error<\/h6><p>User information incomplete. Please try the password reset process again.<\/p>').removeClass('hide');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!constituentId) {\n\t\t\t$('.password-change-return').html('<h6>Session Error<\/h6><p>User information incomplete. Please try the password reset process again.<\/p>').removeClass('hide');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!webLoginId) {\n\t\t\t$('.password-change-return').html('<h6>Session Error<\/h6><p>User information incomplete. Please try the password reset process again.<\/p>').removeClass('hide');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tsessionKey = getCookie('sessionKey');\n\t\t\n\t\tfunction performPasswordChange(key) {\n\t\t\tajaxArray = [];\n\t\t\tajaxArray.push('\/api\/Web\/Session\/{sessionKey}\/WebLogins');\n\t\t\tajaxArray.push(key);\n\t\t\tajaxArray.push(loginName);\n\t\t\tajaxArray.push(newPassword);\n\t\t\tajaxArray.push(emailAddress);\n\t\t\tajaxArray.push(constituentId);\n\t\t\tajaxArray.push(webLoginId);\n\t\t\tquery = JSON.stringify(ajaxArray);\n\t\t\t\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype : 'post',\n\t\t\t\turl : hmns_ajax_router.url,\n\t\t\t\tbeforeSend: setAjaxHeaders,\n\t\t\t\tdata : {\n\t\t\t\t\taction : 'tessitura_api_interactions',\n\t\t\t\t\tquery : query\t\t\n\t\t\t\t},\n\t\t\t\tbeforeSend : function (xhr) {\n\t\t\t\t\tsetAjaxHeaders(xhr);\n\t\t\t\t\t$('form#password-change-form').addClass('greyed-out');\n\t\t\t\t},\n\t\t\t\tsuccess : function (response) {\n\t\t\t\t\t\n\t\t\t\t\tif (response.success) {\n\t\t\t\t\t\t$('form#password-change-form').addClass('hide');\n\t\t\t\t\t\t\/\/ After password reset, redirect to home instead of returnURL\n\t\t\t\t\t\t\/\/ (user went through reset flow, fresh start makes sense)\n\t\t\t\t\t\tvar returnMessage = '<h6>Password Changed!<\/h6>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('.password-change-return').html(returnMessage).removeClass('hide');\t\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\/\/ Intelligent error handling for password change\n\t\t\t\t\t\tvar errorMsg = response.message || 'Password change failed';\n\t\t\t\t\t\tvar errorTitle = 'Password Change Failed';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Check for password requirement errors\n\t\t\t\t\t\tif (errorMsg.toLowerCase().indexOf('password') !== -1 && \n\t\t\t\t\t\t    (errorMsg.toLowerCase().indexOf('requirement') !== -1 || \n\t\t\t\t\t\t     errorMsg.toLowerCase().indexOf('weak') !== -1 ||\n\t\t\t\t\t\t     errorMsg.toLowerCase().indexOf('invalid') !== -1 ||\n\t\t\t\t\t\t     errorMsg.toLowerCase().indexOf('must') !== -1)) {\n\t\t\t\t\t\t\terrorTitle = 'Password Requirements Not Met';\n\t\t\t\t\t\t\tif (errorMsg.toLowerCase().indexOf('requirement') === -1) {\n\t\t\t\t\t\t\t\t\/\/ Add helpful requirements message if not already in error\n\t\t\t\t\t\t\t\terrorMsg += ' Your password must meet minimum security requirements.';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('.password-change-return').html('<h6>' + errorTitle + '<\/h6><p>' + errorMsg + '<\/p>').removeClass('hide');\n\t\t\t\t\t\t$('form#password-change-form').removeClass('greyed-out');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function(xhr, status, error) {\n\t\t\t\t\t$('.password-change-return').html('<h6>Password Change Error<\/h6><p>An error occurred. Please try again.<\/p>').removeClass('hide');\n\t\t\t\t\t$('form#password-change-form').removeClass('greyed-out');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\t\/\/ Check if we have a session key, create one if not\n\t\tif (sessionKey == '' || sessionKey == null) {\n\t\t\tcreateTNEWSession(function(newSessionKey) {\n\t\t\t\tperformPasswordChange(newSessionKey);\n\t\t\t}, function(error) {\n\t\t\t\t$('.password-change-return').html('<h6>Session Error<\/h6><p>Could not create session. Please try again.<\/p>').removeClass('hide');\n\t\t\t});\n\t\t} else {\n\t\t\tperformPasswordChange(sessionKey);\n\t\t}\n\t});\n\t\n\t\/\/ Passwordless Login Detection - Check for token and email in URL on page load\n\t\/\/ TNEW sends: \/login\/?l=email@domain.com&t=TOKEN\n\t\/\/ We support both TNEW format (l\/t) and custom format (email\/token)\n\t(function checkForPasswordlessLogin() {\n\t\tvar urlParams = new URLSearchParams(window.location.search);\n\t\tvar token = urlParams.get('token') || urlParams.get('t');\n\t\tvar email = urlParams.get('email') || urlParams.get('l');\n\t\t\n\t\t\n\t\t\/\/ Flag to prevent duplicate execution\n\t\tvar passwordlessLoginExecuted = false;\n\t\t\n\t\t\/\/ Function to execute passwordless login once nonce is ready\n\t\tvar executePasswordlessLogin = function() {\n\t\t\t\/\/ Prevent duplicate execution\n\t\t\tif (passwordlessLoginExecuted) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tpasswordlessLoginExecuted = true;\n\t\t\t\n\t\t\tsessionKey = getCookie('sessionKey');\n\t\t\t\n\t\t\tfunction performPasswordlessLogin(key) {\n\t\t\t\tajaxArray = [];\n\t\t\t\tajaxArray.push('\/api\/Web\/Session\/{sessionKey}\/Login\/Token');\n\t\t\t\tajaxArray.push(key);\n\t\t\t\tajaxArray.push(email);\n\t\t\t\tajaxArray.push(token);\n\t\t\t\tquery = JSON.stringify(ajaxArray);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype : 'post',\n\t\t\t\t\turl : hmns_ajax_router.url,\n\t\t\t\t\tbeforeSend: setAjaxHeaders,\n\t\t\t\t\tdata : {\n\t\t\t\t\t\taction : 'tessitura_api_interactions',\n\t\t\t\t\t\tquery : query\t\t\n\t\t\t\t\t},\n\t\t\t\t\tsuccess : function (response) {\n\t\t\t\t\t\tif (response.success && response.isLoggedIn) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ Set modeOfSale cookie from login response - prevents redirect loop on return\n\t\t\t\t\t\t\tif (response.modeOfSaleId) {\n\t\t\t\t\t\t\t\tsetCookie('modeOfSale', response.modeOfSaleId, 30);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ Clear mode-of-sale reload flags so product pages can reload with new MOS if needed\n\t\t\t\t\t\t\tfor (var key in sessionStorage) {\n\t\t\t\t\t\t\t\tif (key.indexOf('mosReload_') === 0) {\n\t\t\t\t\t\t\t\t\tsessionStorage.removeItem(key);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ Extract LoginInfo from response - check multiple possible paths\n\t\t\t\t\t\t\tvar loginInfo = null;\n\t\t\t\t\t\t\tif (response.data && response.data.LoginInfo && response.data.LoginInfo.length > 0) {\n\t\t\t\t\t\t\t\tloginInfo = response.data.LoginInfo[0];\n\t\t\t\t\t\t\t} else if (response.data && response.data.LoginInfo) {\n\t\t\t\t\t\t\t\t\/\/ LoginInfo might be a single object, not an array\n\t\t\t\t\t\t\t\tloginInfo = response.data.LoginInfo;\n\t\t\t\t\t\t\t} else if (response.data && Array.isArray(response.data.LoginInfo)) {\n\t\t\t\t\t\t\t\tloginInfo = response.data.LoginInfo[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ If we found LoginInfo, store it and show password change form\n\t\t\t\t\t\t\tif (loginInfo) {\n\t\t\t\t\t\t\t\tuserLoginInfo = loginInfo;\n\t\t\t\t\t\t\t\t\/\/ Ensure email is always stored\n\t\t\t\t\t\t\t\tif (!userLoginInfo.ElectronicAddress) {\n\t\t\t\t\t\t\t\t\tuserLoginInfo.ElectronicAddress = email;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\/\/ Show password change form\n\t\t\t\t\t\t\t\t$('.password-change-return').html('<h6>Login Successful!<\/h6><p>Please set your new password below.<\/p>').removeClass('hide');\n\t\t\t\t\t\t\t\t$('form#password-change-form').show();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\/\/ Even without LoginInfo, we can still show the password change form\n\t\t\t\t\t\t\t\t\/\/ The user is logged in, they just need to set a password\n\t\t\t\t\t\t\t\t\/\/ We'll use the email as LoginName\n\t\t\t\t\t\t\t\t$('.password-change-return').html('<h6>Login Successful!<\/h6><p>Please set your new password below.<\/p>').removeClass('hide');\n\t\t\t\t\t\t\t\t$('form#password-change-form').show();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\/\/ Store minimal user info from what we have\n\t\t\t\t\t\t\t\tuserLoginInfo = {\n\t\t\t\t\t\t\t\t\tElectronicAddress: email,\n\t\t\t\t\t\t\t\t\tLoginName: email  \/\/ Use email as LoginName if UserId not available\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar errorMsg = response.message || 'Invalid or expired token';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ Provide actionable guidance for expired tokens\n\t\t\t\t\t\t\tvar htmlMsg = '<h6>Link Expired<\/h6><p>This password reset link has expired or is invalid. Please request a new one.<\/p>';\n\t\t\t\t\t\t\thtmlMsg += '<div style=\"margin-top: 16px;\"><button id=\"token-request-new-reset\" style=\"background: var(--monarch-alt); color: white; padding: 12px 24px; border: 0; cursor: pointer; border-radius: 4px;\">Request New Reset Link<\/button><\/div>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$('.password-change-return').html(htmlMsg).removeClass('hide');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ Add click handler to switch to password reset form\n\t\t\t\t\t\t\t$('#token-request-new-reset').on('click', function() {\n\t\t\t\t\t\t\t\t\/\/ Show form switcher and password reset form\n\t\t\t\t\t\t\t\t$('.form-switcher').show();\n\t\t\t\t\t\t\t\t$('.password-change-box').removeClass('active').hide();\n\t\t\t\t\t\t\t\t$('#show-password-reset-form').trigger('click');\n\t\t\t\t\t\t\t\t$('.password-change-return').addClass('hide');\n\t\t\t\t\t\t\t\t\/\/ Pre-fill email if we have it\n\t\t\t\t\t\t\t\tif (email) {\n\t\t\t\t\t\t\t\t\t$('input[name=\"password-reset-email\"]').val(email);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror: function(xhr, status, error) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar htmlMsg = '<h6>Connection Error<\/h6><p>An error occurred while trying to verify your reset link.<\/p>';\n\t\t\t\t\t\thtmlMsg += '<div style=\"margin-top: 16px;\"><button id=\"token-error-retry\" style=\"background: var(--monarch-alt); color: white; padding: 12px 24px; border: 0; cursor: pointer; border-radius: 4px;\">Request New Reset Link<\/button><\/div>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('.password-change-return').html(htmlMsg).removeClass('hide');\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Add click handler\n\t\t\t\t\t\t$('#token-error-retry').on('click', function() {\n\t\t\t\t\t\t\t$('.form-switcher').show();\n\t\t\t\t\t\t\t$('.password-change-box').removeClass('active').hide();\n\t\t\t\t\t\t\t$('#show-password-reset-form').trigger('click');\n\t\t\t\t\t\t\t$('.password-change-return').addClass('hide');\n\t\t\t\t\t\t\tif (email) {\n\t\t\t\t\t\t\t\t$('input[name=\"password-reset-email\"]').val(email);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t\/\/ Check if we have a session key, create one if not\n\t\t\tif (sessionKey == '' || sessionKey == null) {\n\t\t\t\tcreateTNEWSession(function(newSessionKey) {\n\t\t\t\t\tperformPasswordlessLogin(newSessionKey);\n\t\t\t\t}, function(error) {\n\t\t\t\t\t$('.password-change-return').html('<h6>Session Error<\/h6><p>Could not create session. Please try again.<\/p>').removeClass('hide');\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tperformPasswordlessLogin(sessionKey);\n\t\t\t}\n\t\t};\n\t\t\n\t\tif (token && email) {\n\t\t\t\n\t\t\t\/\/ Hide all forms and show a loading message\n\t\t\t$('.form-switcher').hide();\n\t\t\t$('.login-form-box, .create-account-box, .password-reset-box').hide();\n\t\t\t$('.password-change-box').addClass('active').show();\n\t\t\t$('.password-change-return').html('<h6>Verifying Token...<\/h6><p>Please wait while we log you in.<\/p>').removeClass('hide');\n\t\t\t\n\t\t\t\/\/ Wait for nonce before executing passwordless login\n\t\t\t\/\/ Check if nonce is already ready\n\t\t\tif (window.hmns_ajax_router && window.hmns_ajax_router.ready) {\n\t\t\t\texecutePasswordlessLogin();\n\t\t\t} else {\n\t\t\t\t\/\/ Wait for nonce to be loaded\n\t\t\t\t\n\t\t\t\t\/\/ Fallback: check periodically in case event was missed\n\t\t\t\tvar nonceCheckInterval = setInterval(function() {\n\t\t\t\t\tif (window.hmns_ajax_router && window.hmns_ajax_router.ready) {\n\t\t\t\t\t\tclearInterval(nonceCheckInterval);\n\t\t\t\t\t\texecutePasswordlessLogin();\n\t\t\t\t\t}\n\t\t\t\t}, 100);\n\t\t\t\t\n\t\t\t\t\/\/ Listen for nonce ready event and clear interval when it fires\n\t\t\t\t$(document).one('hmns_nonce_ready', function() {\n\t\t\t\t\tclearInterval(nonceCheckInterval);\n\t\t\t\t\texecutePasswordlessLogin();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\/\/ Clear interval after 5 seconds to prevent infinite polling\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tclearInterval(nonceCheckInterval);\n\t\t\t\t}, 5000);\n\t\t\t}\n\t\t} else {\n\t\t}\n\t})();\n});\n<\/script>","protected":false},"excerpt":{"rendered":"","protected":false},"author":9,"featured_media":5557,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"wf_page_folders":[],"class_list":["post-10003","page","type-page","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Log In - HMNS<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hmns.org\/login\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Log In\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hmns.org\/login\/\" \/>\n<meta property=\"og:site_name\" content=\"HMNS\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-31T10:26:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.hmns.org\/wp-content\/uploads\/2023\/08\/facebook-shared-image2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1919\" \/>\n\t<meta property=\"og:image:height\" content=\"1003\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.hmns.org\/login\/\",\"url\":\"https:\/\/www.hmns.org\/login\/\",\"name\":\"Log In - HMNS\",\"isPartOf\":{\"@id\":\"https:\/\/www.hmns.org\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.hmns.org\/login\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.hmns.org\/login\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.hmns.org\/wp-content\/uploads\/2023\/08\/facebook-shared-image2.jpg\",\"datePublished\":\"2024-09-18T16:10:20+00:00\",\"dateModified\":\"2026-03-31T10:26:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.hmns.org\/login\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.hmns.org\/login\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hmns.org\/login\/#primaryimage\",\"url\":\"https:\/\/www.hmns.org\/wp-content\/uploads\/2023\/08\/facebook-shared-image2.jpg\",\"contentUrl\":\"https:\/\/www.hmns.org\/wp-content\/uploads\/2023\/08\/facebook-shared-image2.jpg\",\"width\":1919,\"height\":1003},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.hmns.org\/login\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.hmns.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Log In\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.hmns.org\/#website\",\"url\":\"https:\/\/www.hmns.org\/\",\"name\":\"Houston Museum of Natural Science\",\"description\":\"Explore, Engage, Enlighten\",\"alternateName\":\"HMNS\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.hmns.org\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Log In - HMNS","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hmns.org\/login\/","og_locale":"en_US","og_type":"article","og_title":"Log In","og_url":"https:\/\/www.hmns.org\/login\/","og_site_name":"HMNS","article_modified_time":"2026-03-31T10:26:34+00:00","og_image":[{"width":1919,"height":1003,"url":"https:\/\/www.hmns.org\/wp-content\/uploads\/2023\/08\/facebook-shared-image2.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.hmns.org\/login\/","url":"https:\/\/www.hmns.org\/login\/","name":"Log In - HMNS","isPartOf":{"@id":"https:\/\/www.hmns.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hmns.org\/login\/#primaryimage"},"image":{"@id":"https:\/\/www.hmns.org\/login\/#primaryimage"},"thumbnailUrl":"https:\/\/www.hmns.org\/wp-content\/uploads\/2023\/08\/facebook-shared-image2.jpg","datePublished":"2024-09-18T16:10:20+00:00","dateModified":"2026-03-31T10:26:34+00:00","breadcrumb":{"@id":"https:\/\/www.hmns.org\/login\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hmns.org\/login\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hmns.org\/login\/#primaryimage","url":"https:\/\/www.hmns.org\/wp-content\/uploads\/2023\/08\/facebook-shared-image2.jpg","contentUrl":"https:\/\/www.hmns.org\/wp-content\/uploads\/2023\/08\/facebook-shared-image2.jpg","width":1919,"height":1003},{"@type":"BreadcrumbList","@id":"https:\/\/www.hmns.org\/login\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hmns.org\/"},{"@type":"ListItem","position":2,"name":"Log In"}]},{"@type":"WebSite","@id":"https:\/\/www.hmns.org\/#website","url":"https:\/\/www.hmns.org\/","name":"Houston Museum of Natural Science","description":"Explore, Engage, Enlighten","alternateName":"HMNS","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hmns.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"publishpress_future_action":{"enabled":false,"date":"2026-04-16 20:17:07","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"wf_page_folders","extraData":[]},"publishpress_future_workflow_manual_trigger":{"enabledWorkflows":[]},"_links":{"self":[{"href":"https:\/\/www.hmns.org\/wp-json\/wp\/v2\/pages\/10003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hmns.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.hmns.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.hmns.org\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hmns.org\/wp-json\/wp\/v2\/comments?post=10003"}],"version-history":[{"count":2,"href":"https:\/\/www.hmns.org\/wp-json\/wp\/v2\/pages\/10003\/revisions"}],"predecessor-version":[{"id":50699,"href":"https:\/\/www.hmns.org\/wp-json\/wp\/v2\/pages\/10003\/revisions\/50699"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hmns.org\/wp-json\/wp\/v2\/media\/5557"}],"wp:attachment":[{"href":"https:\/\/www.hmns.org\/wp-json\/wp\/v2\/media?parent=10003"}],"wp:term":[{"taxonomy":"wf_page_folders","embeddable":true,"href":"https:\/\/www.hmns.org\/wp-json\/wp\/v2\/wf_page_folders?post=10003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}