<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">function TryRegisterSubmit() {
    var msg = "";
    var bGood = true;
    if ($("#FirstName").val().trim().length === 0) {
        msg += "Please enter the user's first name.&lt;br&gt;";
        bGood = false;
    }

    if ($("#LastName").val().trim().length === 0) {
        msg += "Please enter the user's last name.&lt;br&gt;";
        bGood = false;
    }

    if ($("#CompanyName").val().trim().length === 0) {
        msg += "Please enter the user's Company Name.&lt;br&gt;";
        bGood = false;
    }

    if ($("#Address1").val().trim().length === 0) {
        msg += "Please enter the user's Street Address.&lt;br&gt;";
        bGood = false;
    }

    if ($("#City").val().trim().length === 0) {
        msg += "Please enter the user's City.&lt;br&gt;";
        bGood = false;
    }
    if ($("#State").children("option").length &gt; 0 &amp;&amp; $("#State").val().trim().length === 0) {
        msg += "Please enter the user's State.&lt;br&gt;";
        bGood = false;
    }
    if ($("#Country").val().trim().length === 0) {
        msg += "Please enter the user's Country.&lt;br&gt;";
        bGood = false;
    }
    if ($("#Zipcode").val().match(/^([A-Za-z0-9]{2,5}[ -])*[A-Za-z0-9]{2,10}$/g) === null) {
        msg += "Please enter a valid Postal Code.&lt;br&gt;";
        bGood = false;
    }

    var Phone = $("#Phone").val();
    if (Phone !== "" &amp;&amp; Phone.match(/\+?([0-9]+[ .-])*[0-9]+$/g) === null) {
        msg += "Please provide a valid phone number (e.g. 555-555-1212).&lt;br&gt;";
        bGood = false;
    }

    var Email = $("#Email").val();
    if (Email.match(/^[A-Za-z0-9.!#$%&amp;'*=?^_`{|}~-]+@([A-Za-z0-9-]+\.)+[A-Za-z]{2,20}$/g) === null) {
        msg += "Please provide a valid email address (e.g. janesmith@mycompany.com).&lt;br&gt;";
        bGood = false;
    }

    if ($("#CompanyType").val().length === 0) {
        msg += "Please enter the user's Company Type.&lt;br&gt;";
        bGood = false;
    }

    if ($("#CompanyType").val() == "S") {
        if ($('#ServiceLocation').val().length === 0) {
            msg += "Please enter the user's Cass Service Location.&lt;br&gt;";
            bGood = false;
        }
    }
}

function TryForgotPasswordSubmit() {
    var msg = "";
    var bGood = true;
    if ($("#LoginId").val().trim().length === 0) {
        msg += "Please enter the user's Login ID.&lt;br&gt;";
        bGood = false;
    }

    if ($("#Email").val().match(/^[A-Za-z0-9.!#$%&amp;'*=?^_`{|}~-]+@([A-Za-z0-9-]+\.)+[A-Za-z]{2,20}$/g) === null) {
        msg += "Please provide a valid email address.&lt;br&gt;";
        bGood = false;
    }
}

function TryResetPasswordSubmit() {
    var msg = "";
    var bGood = true;
    if ($("#Password").val().trim().length === 0) {
        msg += "Please enter Password.&lt;br&gt;";
        bGood = false;
    }

    if ($("#ConfirmPassword").val().trim().length === 0) {
        msg += "Please enter Confirm Password.&lt;br&gt;";
        bGood = false;
    }
}

function passwordStrength(password) {
    var desc = new Array();
    desc[0] = "Very Weak";
    desc[1] = "Very Weak";
    desc[2] = "Weak";
    desc[3] = "Medium";
    desc[4] = "Good";
    desc[5] = "Very Good";
    var score = 0;

    //if password bigger than 10 give 1 point
    if (password.length &gt; 8) score++;

    //if password has lower characters give 1 point
    if (password.match(/[a-z]/)) score++;

    //if password has uppercase characters give 1 point
    if (password.match(/[A-Z]/)) score++;

    //if password has at least one number give 1 point
    if (password.match(/[0-9]/)) score++;

    //if password has at least one special caracther give 1 point
    if (password.match(/.[!,@,#,$,%,^,&amp;,*,?,_,~,-,(,)]/)) score++;

    document.getElementById("passwordDescription").innerHTML = desc[score];
    document.getElementById("passwordStrength").className = "strength" + score;
}

function Validationcheck(e) {
    $("form").validate().element('#' + e.currentTarget.id);
}

function SpaceCheck(e) {
    var value = e.target.value;
    if (value.trim().length === 0 &amp;&amp; e.which === 32) {
        e.preventDefault();
    }
}

function NoSpaceCheck(e) {
    if (e.which === 32) {
        e.preventDefault();
    }
}

$(function () {
    if (document.getElementById("resetpwd") !== null) {
        document.getElementById("resetpwd").style.display = "block";
    }
    if (document.getElementById("registeruser") !== null) {
        document.getElementById("registeruser").style.display = "block";
    }
    if (document.getElementById("forgotpwd") !== null) {
        document.getElementById("forgotpwd").style.display = "block";
    }
    if (document.getElementById("cancelresetpwd") !== null) {
        document.getElementById("cancelresetpwd").style.display = "block";
    }
    if (document.getElementById("systemRequirements") !== null) {
        document.getElementById("systemRequirements").style.display = "block";
    }

    var pass = document.getElementById("Password");
    if (pass) {
        pass.addEventListener("keyup", function (event) {
            // set value of input field to variable
            var value = this.value;

            // fire function to test password strength
            passwordStrength(value);
        });
        jQuery.validator.addMethod("jqvPasswordStrengthCheck", function (value, element) {
            return checkPassword(value);
        });

        var confirmPass = document.getElementById("ConfirmPassword");
        if (confirmPass) {
            jQuery.validator.addMethod("jqvPasswordsMatch", function (value, element) {
                return value === document.getElementById("Password").value;
            });
        }
    }

    $("#Phone").on("blur", function () {
        var phoneValue = $(this).val();
        if (phoneValue.length === 10 &amp;&amp; !isNaN(parseInt(phoneValue))) {
            $(this).val(phoneValue.replace(/^(\d{3})(\d{3})(\d{4})+$/, "$1-$2-$3"));
        }
    });

    $("#Country").on("change", function () {
        let label = $('label[for="State"]');
        let input = $("#State");
        let parent = input.parent();
        input.remove();
        let stateSelections = countryRegions[$("#Country").val()];
        if (typeof stateSelections === "undefined" || stateSelections === null) {
            label.addClass("hidden");
            input = $('&lt;input type="hidden" name="State" id="State"/&gt;');
            $("#statediv").hide();
        } else {
            label.removeClass("hidden");
            input = $('&lt;select name="State" id="State" class="col-md-12 pl-0 form-control"&gt;&lt;/select&gt;');
            $("#statediv").show();
            $.each(stateSelections, function (index, item) {
                input.append($("&lt;option&gt;", {
                    value: item[0],
                    text: item[1]
                }));
            });
        }
        parent.append(input);
    });

    function closeCassNavMenus(e) {
        if (window.ngCassMenuComponent &amp;&amp; $(e.target).closest("li.sidenavlist").length === 0) {
            window.ngCassMenuComponent.zone.run(function () { window.ngCassMenuComponent.closeCassMenus(); });
        }
    }
    $(document).on("click", closeCassNavMenus);
    $(window).on("blur", closeCassNavMenus);
});

$("form").validate({
    rules: {
        "Password": {
            jqvPasswordStrengthCheck: true
        },
        "ConfirmPassword": {
            jqvPasswordsMatch: true
        }
    },
    messages: {
        'Password': {
            jqvPasswordStrengthCheck: "Password does not meet the password criteria."
        },
        "ConfirmPassword": {
            jqvPasswordsMatch: "Passwords do not match."
        }
    }
});

function checkPassword(pvalue) {

    pvalue = pvalue.toUpperCase();

    var iLetter = 0;
    var iNumber = 0;
    var iOther = 0;

    for (var i = 0; i &lt; pvalue.length; i++) {
        if (pvalue.charCodeAt(i) &gt;= 65 &amp;&amp; pvalue.charCodeAt(i) &lt;= 90) {
            iLetter = 1;
        }
        else if (pvalue.charCodeAt(i) &gt;= 48 &amp;&amp; pvalue.charCodeAt(i) &lt;= 57) {
            iNumber = 1;
        }
        else if ((pvalue.charCodeAt(i) &gt;= 0 &amp;&amp; pvalue.charCodeAt(i) &lt;= 47)
            || (pvalue.charCodeAt(i) &gt;= 58 &amp;&amp; pvalue.charCodeAt(i) &lt;= 64)
            || (pvalue.charCodeAt(i) &gt;= 91)) {
            iOther = 1;
        }
    }

    return 2 &lt;= iLetter + iNumber + iOther;
}
</pre></body></html>