<%@ page language="VB" autoeventwireup="false" inherits="Auth_Login, MachSol.MachPanel.Web" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">

    <title id="Title" runat="server">MachPanel&reg; - Login to Control Center</title>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <!-- Google Fonts -->

    <link rel="stylesheet" type='text/css' href='<%# "/css/google/material-icons.css?" + ProductVersion %>' />

    <!-- Jquery base library -->
    <link rel="stylesheet" type='text/css' href='<%# "/plugins/jquery-ui-1.13.2/jquery-ui.min.css?" + ProductVersion %>' />

    <!-- Bootstrap Core Css -->
    <link rel="stylesheet" type='text/css' href='<%# "/plugins/bootstrap/css/bootstrap.css?" + ProductVersion %>' />

    <!-- Bootstrap Select Css -->
    <link rel="stylesheet" type='text/css' href='<%# "/plugins/bootstrap-select/css/bootstrap-select.css?" + ProductVersion %>' />

    <link rel="stylesheet" type='text/css' href='<%# "/plugins/virtual-select/style.min.css?" + ProductVersion %>' />

    <!-- Waves Effect Css -->
    <link rel="stylesheet" type='text/css' href='<%# "/plugins/node-waves/waves.css?" + ProductVersion %>' />


    <!-- AdminBSB Themes -->
    <link rel="stylesheet" type='text/css' href='<%# "/css/themes/all-themes.css?" + ProductVersion %>' />


    <!-- font-glyphs css -->
    <link rel="stylesheet" type='text/css' href='<%# "/css/font-glyphs.css?" + ProductVersion %>' />

    <!-- Custom Css -->
    <link rel="stylesheet" type='text/css' href='<%# "/css/Style.css?" + ProductVersion %>' />


    <style type="text/css">
        @media (max-width: 991px) {
            body {
                background-size: initial;
                background-position: center;
            }
        }

        .form-horizontal .form-group {
            margin-left: 0px;
            margin-right: 0px;
            margin-bottom: 5px;
        }

        .round {
            height: 60px;
            width: 60px;
            line-height: 60px;
            text-align: center;
            -webkit-border-radius: 30px;
            -moz-border-radius: 30px;
            -ms-border-radius: 30px;
            border-radius: 30px;
            font-size: 2.5em;
        }


        #notification-carousel .carousel-inner {
            min-height: 100px;
            max-height: 100px;
            overflow-y: auto;
        }

        #notification-carousel .carousel-indicators {
            top: auto;
            bottom: -35px;
            margin-right: -19px;
        }

            #notification-carousel .carousel-indicators li {
                background: #CFCFCF;
                width: 8px;
                height: 8px;
                margin: 2px;
                cursor: pointer;
                border: 1px solid #CCC;
                border-radius: 4px;
                opacity: 0.4;
                overflow: hidden;
                transition: all 0.4s;
            }

            #notification-carousel .carousel-indicators .active {
                background: #2196F3;
                width: 12px;
                height: 12px;
                border-radius: 6px;
                border-color: #2196F3;
                opacity: 1;
                overflow: hidden;
            }

        #notification-carousel .carousel-control.right {
            right: -70px;
            left: auto;
            background-repeat: initial;
            background-image: none;
        }

        #notification-carousel .carousel-control.left {
            left: -70px;
            right: auto;
            background-repeat: initial;
            background-image: none;
        }

        #notification-carousel .carousel-control .glyphicon {
            color: #cfcfcf;
            font-size: 20px;
        }

        #notification-carousel .carousel-control .glyphicon-chevron-left {
            left: 40px;
        }

        #notification-carousel .carousel-control .glyphicon-chevron-right {
            right: 40px;
        }

        #duo_iframe {
            width: 100%;
            min-width: 304px;
            max-width: 620px;
            height: 330px;
            border: none;
        }
    </style>

    <!-- JQuery Framework References -->
    <script type="text/javascript" src='/plugins/jquery/jquery.min.js?<%# ProductVersion %>'></script>
    <script type="text/javascript" src='/plugins/jquery-ui-1.13.2/jquery-ui.min.js?<%# ProductVersion %>'></script>

    <script type="text/javascript" src='/JS/adal.js?<%# ProductVersion %>'></script>
    <script type="text/javascript" src='/JS/aad-login.js?<%# ProductVersion %>'></script>

    <script type="text/javascript" src='/JS/sweetalert/js/swl.js?<%# ProductVersion %>' defer></script>
    <link rel="stylesheet" type='text/css' href='<%# "/JS/sweetalert/css/swl.css?" + ProductVersion %>' />
    <script type="text/javascript" src='/JS/fido2/helpers.js?<%# ProductVersion %>' defer></script>
    <script type="text/javascript" src='/JS/fido2/passwordless.login.js?<%# ProductVersion %>' defer></script>

    <!--Custom Scripts-->
    <script type="text/javascript">
        $('[id*=noscript_div]').hide();
    </script>
    <script type="text/javascript" src='/JS/Utility.js?<%# ProductVersion %>'></script>
    <script type="module" src="/JS/punycode.js?<%# ProductVersion %>"></script>
    <script type="text/javascript" src='/JS/Duo/Duo-Web-v2.js?<%# ProductVersion %>'></script>
    <link rel="icon" href="" type="image/ico" sizes="16x16" id="link_favicon" runat="server">
</head>
<body id="Bdy" runat="server">

    <%If MachSol.MachPanel.DBCore.SystemSettings.IsDMP() Then %>
    <link rel="stylesheet" type='text/css' href='/css/sar-customizations.css?<%# ProductVersion %>' />
    <%End If%>

    <div id='noscript_div' runat="server" class="login-form-div">
        <div class="error-msg">
            <b>
                <asp:Literal ID="Literal7" runat="server" EnableViewState="false" Text="<%$ Resources:Content,FAM00155 %>" /></b>
        </div>
    </div>
    <!-- Page Loader -->
    <div class="page-loader-wrapper">
        <div class="sk-cube-grid">
            <div class="sk-cube sk-cube1"></div>
            <div class="sk-cube sk-cube2"></div>
            <div class="sk-cube sk-cube3"></div>
            <div class="sk-cube sk-cube4"></div>
            <div class="sk-cube sk-cube5"></div>
            <div class="sk-cube sk-cube6"></div>
            <div class="sk-cube sk-cube7"></div>
            <div class="sk-cube sk-cube8"></div>
            <div class="sk-cube sk-cube9"></div>
        </div>
    </div>

    <%-- Login Page Main Div--%>
    <form id="form1" runat="server" class="form-horizontal">

        <div class="auth-container">
            <div class="row">
                <div class="col-xs-12 col-lg-offset-2 col-lg-8">

                    <div class="card">
                        <div class="body">

                            <%-- Notification Area--%>
                            <div id="LoginNotif" runat="server" class="m-t-10 p-l-35 p-r-35">
                                <!-- Carousel
            ================================================== -->
                                <div id="notification-carousel" class="carousel slide" data-interval="5000" data-pause="hover" data-wrap="true">
                                    <div class="carousel-inner">
                                        <asp:Repeater ID="Rep_Notifications" runat="server">
                                            <ItemTemplate>
                                                <div class='<%# IIf(Container.ItemIndex = 0,"item active","item") %>'>
                                                    <div class="caption">
                                                        <h4><%#DataBinder.Eval(Container.DataItem, "NotificationTitle")%></h4>
                                                        <p><%#DataBinder.Eval(Container.DataItem, "NotificationDescription").ToString.Replace(Chr(10), "<br/>")%></p>
                                                    </div>
                                                </div>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </div>
                                    <!-- Indicators -->
                                    <ol class="carousel-indicators">
                                        <asp:Repeater ID="Rep_NotificationIndicators" runat="server">
                                            <ItemTemplate>
                                                <li data-target="#notification-carousel" data-slide-to="<%# Container.ItemIndex%>" class="<%# IIf(Container.ItemIndex = 0, " active", "")%>"></li>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </ol>
                                    <a class="left carousel-control" href="#notification-carousel" data-slide="prev">
                                        <span class="glyphicon glyphicon-chevron-left"></span>
                                        <span class="sr-only">Previous</span>
                                    </a>
                                    <a class="right carousel-control" href="#notification-carousel" data-slide="next">
                                        <span class="glyphicon glyphicon-chevron-right"></span>
                                        <span class="sr-only">Next</span>
                                    </a>
                                </div>

                                <!-- End Carousel -->
                            </div>
                            <%-- <h2 class="text-center text-capitalize">
                <asp:Literal ID="Ltl_CPBName" runat="server"></asp:Literal>
            </h2>--%>

                            <div class="m-t-20 m-b-20 p-l-10 p-r-10">
                                <asp:Image ID="Img_Logo" runat="server" CssClass="Logo_Image width-500px" ImageUrl="~/App_Themes/Default/Images/icons/logo.png" />
                                <hr />
                            </div>

                            <div class="p-l-10 p-r-10">
                                <h4>
                                    <asp:Literal ID="Ltl_System" runat="server"></asp:Literal>
                                </h4>
                            </div>

                            <div class="row">
                                <div class="col-xs-12">
                                    <div class="form-group p-l-10 p-r-10">
                                        <div style="display: none" id="Div_AuthError" runat="server">
                                            <div class="col-xs-12 text-danger">
                                                <asp:Label ID="Lbl_AzureError" runat="server" Text="<%$ Resources:Content,SPT002016 %>"
                                                    EnableViewState="false" Visible="false" /><br />
                                                <asp:Label ID="Literal4" runat="server" EnableViewState="false" Text="<%$ Resources:Content,SPT002015 %>" />
                                                <asp:Label ID="Literal5" runat="server" Text="<%$ Resources:Content,SPT002016 %>"
                                                    EnableViewState="false" /><br />
                                                <asp:HyperLink ID="hplGetSecretKey" Visible="false" runat="server" Text="<%$ Resources:Content,strGetasecretkeybyemail %>"
                                                    NavigateUrl="~/Auth/ForgotPassword.aspx"></asp:HyperLink>
                                                <br />

                                                <asp:Label ID="Lbl_LockdownMsg" runat="server" CssClass="warnMsg YOverFlowMsg"></asp:Label><br />
                                            </div>
                                        </div>
                                        <div style="display: none" id="Div_IPLockError" runat="server">
                                            <div class="col-xs-12 text-danger">
                                                <asp:Label ID="Literal6" runat="server" EnableViewState="false" Text="<%$ Resources:Content,SPT002015 %>" />
                                                <asp:Literal ID="Ltl_IPLock" runat="server" Text="<%$ Resources:Content,String459 %>"
                                                    EnableViewState="false" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <script type="text/javascript">
                                function accountChangeHandler(s) {
                                    $get('<%= hf_passworless_username.ClientID %>').value = s.value;
                                }
                            </script>
                            <div id="li_2FA_Step1" runat="server" class="m-t-10">
                                <asp:Panel ID="Pnl_UserAccountInfo" runat="server">
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="form-group form-float p-l-10 p-r-10">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_CPLogin" runat="server" CssClass="form-control" onChange="accountChangeHandler(this);"></asp:TextBox>
                                                    <asp:Label ID="Literal1" runat="server" Text="<%$ Resources:Content,SPT002013%>"
                                                        CssClass="form-label" />
                                                    <asp:RequiredFieldValidator ID="RFV_UserName" SetFocusOnError="true" Display="None"
                                                        runat="server" ErrorMessage="<%$Resources:Content,USM0067%>" ControlToValidate="TxBx_CPLogin"
                                                        ValidationGroup="MPLoginUserName"></asp:RequiredFieldValidator>
                                                    <%--<asp:RegularExpressionValidator ID="RE_UserName" SetFocusOnError="true" Display="None"
                                                        runat="server" ErrorMessage="<%$Resources:Content,Usernamemustbeinemailformat%>" ControlToValidate="TxBx_CPLogin"
                                                        ValidationExpression="<%$ Resources:MPRegex,EmailAddress%>" ValidationGroup="MPLoginUserName"></asp:RegularExpressionValidator>--%>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="Tr_Locale" runat="server">
                                        <div class="col-xs-12 col-sm-3 login-select-locale">
                                            <asp:Literal ID="Literal03" runat="server" Text="<%$Resources:Content,FAM0024%>"
                                                EnableViewState="false" />
                                        </div>
                                        <div class="col-xs-12">
                                            <div class="form-group p-l-10 p-r-10">
                                                <asp:DropDownList ID="DDL_Locale" AutoPostBack="true" CssClass="LoginDD" runat="server" Width="135px">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="form-group p-l-10 p-r-10">
                                                <span id='tr_aduserlogin' runat='server' class="pull-left p-l-5">
                                                    <%--<asp:LinkButton ID='Lbtn_ADUserLogin' runat='server' Text='<%$ Resources:Content,USM0040 %>'
                                                CausesValidation='false'></asp:LinkButton>--%>
                                                    <asp:CheckBox ID="CB_ADUserLogin" runat="server" Text="<%$Resources:Content,USM0040 %>" />
                                                </span>
                                                <span class="pull-right">
                                                    <asp:ValidationSummary ID="VS_MPLoginUserName" runat="server" ValidationGroup="MPLoginUserName" ShowSummary="false" ShowMessageBox="true" />
                                                    <asp:Button ID="Btn_UserAccountNext" CssClass="btn btn-primary" runat="server"
                                                        Text="<%$Resources:Content,GN00001242%>" ValidationGroup="MPLoginUserName" CausesValidation="true" />
                                                </span>
                                            </div>
                                        </div>
                                    </div>

                                    <div id="Div_LoginAzure" runat="server" class="login-azure m-b-15" visible="false">
                                        <div class="circle-base">
                                            <asp:Label ID="Label4" runat="server" Text="OR"></asp:Label>
                                        </div>
                                        <div class="col-xs-12 align-center">
                                            <asp:Button ID="Btn_LoginWithAzure" runat="server" Text="<%$ Resources:Content,LoginWithAzure%>" CausesValidation="false" CssClass="btn btn-primary" />
                                            <asp:Button ID="Btn_LoginWithAzure2" runat="server" Text="<%$ Resources:Content,LoginWithAzure%>" CssClass="btn btn-primary btn-aad-login hide" />
                                            <asp:HiddenField ID="HF_AzureAppId" runat="server" />
                                            <asp:HiddenField ID="HF_AzureLogin" runat="server" />
                                            <asp:Button ID="Btn_AzureSuccess" runat="server" CausesValidation="false" Style="display: none;" Text="Login" />
                                        </div>
                                    </div>
                                    <div id="Div_LoginWithADFS" runat="server" class="login-azure m-b-15" visible="false">
                                        <div class="circle-base">
                                            <asp:Label ID="Label5" runat="server" Text="OR"></asp:Label>
                                        </div>
                                        <div class="col-xs-12 align-center">
                                            <asp:Button ID="Btn_LoginWithADFS" runat="server" Text="<%$Resources:Content,StrLoginWithADFS %>" CausesValidation="false" CssClass="btn btn-primary" />
                                        </div>
                                    </div>
                                    <div id="Div_LoginKeyCloak" runat="server" class="login-azure m-b-15" visible="false">
                                        <div class="circle-base">
                                            <asp:Label ID="Label6" runat="server" Text="OR"></asp:Label>
                                        </div>
                                        <div class="col-xs-12 align-center">
                                            <asp:Button ID="Btn_LoginWithKeyCloak" runat="server" Text="<%$Resources:Content,LoginWithKeyCloak %>" CausesValidation="false" CssClass="btn btn-primary" />
                                        </div>
                                    </div>
                                </asp:Panel>

                                <asp:HiddenField runat="server" ID="hf_passworless_username" runat="server"></asp:HiddenField>
                                <asp:Panel ID="Pnl_UserPasswordInfo" runat="server" Visible="false" DefaultButton="Btn_Login">
                                    <div class="row hide">
                                        <div class="col-xs-6 col-xs-offset-3">
                                            <div class="form-group p-l-10 p-r-10 text-center">
                                                <span class="bg-blue-grey round glyphicon glyphicon-user"></span>
                                                <br />
                                                <asp:Literal ID="Ltrl_LoginAccountInfo" runat="server"></asp:Literal>
                                                <div class="clearfix"></div>
                                                <asp:Literal ID="Ltrl_LoginAccountType" runat="server"></asp:Literal>
                                            </div>
                                        </div>
                                    </div>
                                    <br />
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="form-group form-float p-l-10 p-r-10">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_CPPwd" CssClass="form-control" runat="server" TextMode="Password"></asp:TextBox>
                                                    <asp:Label ID="Literal2" runat="server" Text="<%$Resources:Content,GN0000569%>"
                                                        EnableViewState="false" CssClass="form-label" />
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Display="None" runat="server"
                                                        ErrorMessage="<%$ Resources:Content,GN00008028%>" SetFocusOnError="true"
                                                        ControlToValidate="TxBx_CPPwd" ValidationGroup="MPLoginPassword"></asp:RequiredFieldValidator>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div id="div_passworlessauth" runat="server" class="row passworless-controls">
                                        <div class="align-center">
                                            <a id="btn-passworless-auth" onclick="handleSignInSubmit(event)"><i class="material-icons" style="font-size: 2em;">fingerprint</i>
                                                <i class="material-icons" style="font-size: 2em;">visibility</i>
                                                <i class="material-icons" style="font-size: 2em;">dialpad</i>
                                                <%--<i class="material-icons" style="font-size:2em;">devices</i>--%>
                                                <div class="m-t-5"><%= Resources.Content.StrGoPasswordless %></div>
                                            </a>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="form-group p-l-10 p-r-10">
                                                <span class="pull-left">
                                                    <asp:LinkButton ID="LB_ForgotPassword" runat="server" Text="<%$Resources:Content,GN00008005%>"
                                                        CausesValidation="False"></asp:LinkButton><br />
                                                    <asp:LinkButton ID="LB_UnlockAccount" runat="server" Text="<%$Resources:Content,UnlockAccount%>"
                                                        CausesValidation="False" Visible="false"></asp:LinkButton>
                                                </span>
                                                <div class="clearfix visible-xs hidden-sm"></div>
                                                <span class="pull-right">
                                                    <asp:ValidationSummary ID="VS_MPLoginPassword" runat="server" ValidationGroup="MPLoginPassword" ShowSummary="false" ShowMessageBox="true" />
                                                    <asp:Button ID="Btn_GoBack" runat="server" Text="<%$ Resources:Content,String1018 %>" CssClass="btn btn-primary" CausesValidation="false" />
                                                    <asp:Button ID="Btn_Login" CssClass="btn btn-primary" runat="server" Text="<%$Resources:Content,GN0001248%>"
                                                        ValidationGroup="MPLoginPassword" />
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </asp:Panel>

                                <asp:Panel ID="Pnl_UserResetPassword" runat="server" Visible="false" DefaultButton="Btn_ResetPassword">
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="form-group form-float p-l-10 p-r-10">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_OldPassword" TextMode="Password" runat="server" CssClass="form-control"></asp:TextBox>
                                                    <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Content,strOldPassword%>"
                                                        CssClass="form-label" />
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" SetFocusOnError="true" Display="None"
                                                        runat="server" ErrorMessage="<%$Resources:Content,OldPasswordRequired%>" ControlToValidate="TxBx_OldPassword"></asp:RequiredFieldValidator>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="form-group form-float p-l-10 p-r-10">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_NewPassword" TextMode="Password" runat="server" CssClass="form-control"></asp:TextBox>
                                                    <asp:Label ID="Label2" runat="server" Text="<%$ Resources:Content,DGN1110554%>"
                                                        CssClass="form-label" />
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" SetFocusOnError="true" Display="None"
                                                        runat="server" ErrorMessage="<%$Resources:Content,NewPasswordRequired%>" ControlToValidate="TxBx_NewPassword"></asp:RequiredFieldValidator>
                                                    <asp:RegularExpressionValidator ErrorMessage='<%$ Resources:Content,DGN1110625%>'
                                                        ID="RegularExpressionValidator1" runat="server" ControlToValidate="TxBx_NewPassword"
                                                        Display="None" ValidationExpression="^.*(?=.{6,})(?=.*\d)(?=.*[a-zA-Z]).*$"
                                                        SetFocusOnError="True"></asp:RegularExpressionValidator>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="form-group form-float p-l-10 p-r-10">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_ConfirmNewPassword" TextMode="Password" runat="server" CssClass="form-control"></asp:TextBox>
                                                    <asp:Label ID="Label3" runat="server" Text="<%$ Resources:Content,DGN1110555%>"
                                                        CssClass="form-label" />
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" SetFocusOnError="true" Display="None"
                                                        runat="server" ErrorMessage="<%$Resources:Content,USM0195%>" ControlToValidate="TxBx_ConfirmNewPassword"></asp:RequiredFieldValidator>
                                                    <asp:CompareValidator ID="Cv_password" runat="server" ControlToValidate="TxBx_ConfirmNewPassword" ControlToCompare="TxBx_NewPassword"
                                                        Display="None"></asp:CompareValidator>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="form-group p-l-10 p-r-10">
                                                <span class="pull-right">
                                                    <asp:Button ID="Btn_ResetPassword" CssClass="btn btn-primary" runat="server" Text="<%$Resources:Content,GN0000281%>" />
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </div>

                            <%-- Login Area--%>
                            <div id="li_2FA_Step2" runat="server" visible="false">
                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="form-group p-l-10 p-r-10">
                                            <asp:Literal ID="Ltr_PINSent" runat="server" Text="<%$ Resources:Content,PINSentInEmail%>" />
                                        </div>
                                    </div>
                                </div>
                                <br />
                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="form-group form-float p-l-10 p-r-10">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_PINCode" runat="server" CssClass="form-control" AutoCompleteType="Disabled"></asp:TextBox>
                                                <asp:Label ID="Literal8" runat="server" Text="<%$ Resources:Content,PINCode%>"
                                                    EnableViewState="false" CssClass="form-label" />
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" SetFocusOnError="true" Display="None"
                                                    runat="server" ErrorMessage="<%$Resources:Content,USM0067%>" ControlToValidate="TxBx_PINCode" ValidationGroup="PIN">
                                                </asp:RequiredFieldValidator>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="form-group p-l-10 p-r-10">
                                            <asp:LinkButton ID="Lb_ResendCode" runat="server" Text="<%$ Resources:Content,ResendPINCode%>"
                                                CausesValidation="False" Visible="false"></asp:LinkButton>
                                            <asp:HiddenField ID="HiddenTimer" runat="server" />
                                            <asp:Label ID="TimerLabel" runat="server" />
                                        </div>

                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="form-group p-l-10 p-r-10">

                                            <asp:CheckBox ID="ChBx_RememberDevice" runat="server" Text="<%$ Resources:Content,RememberDeviceText%>" />

                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12">
                                        <span class="pull-left">
                                            <asp:LinkButton ID="Lb_ResetGoogleAuthenticator" runat="server" Text="<%$Resources:Content,ResetGoogleAuthenticator%>"
                                                CausesValidation="False" Visible="false"></asp:LinkButton>
                                        </span>

                                        <span class="pull-right">
                                            <asp:Button ID="Btn_SubmitPIN" runat="server" CssClass="btn btn-primary" Text="<%$ Resources:Content,GN0000710 %>"
                                                ValidationGroup="PIN" />&nbsp;&nbsp;
                                        <asp:Button ID="Btn_Cancel" runat="server" CssClass="btn btn-cancel" Text="<%$ Resources:Content,GN0000572 %>"
                                            CausesValidation="false" />
                                            <asp:ValidationSummary ID="ValidationSummary1" DisplayMode="BulletList" ShowMessageBox="true"
                                                ShowSummary="false" runat="server" />
                                        </span>
                                    </div>
                                </div>
                            </div>

                            <div id="Div_DuoAuthentication" runat="server" visible="false">

                                <asp:HiddenField ID="HF_DuoHostName" Value="" runat="server" />
                                <asp:HiddenField ID="HF_DuoSigRequest" Value="" runat="server" />
                                <iframe id="duo_iframe"></iframe>
                            </div>

                            <div class="row">
                                <div class="col-xs-12 align-center m-t--15">
                                    <asp:Label ID="Ltl_CopyRight" runat="server" CssClass="hide d-none btn-dummy"></asp:Label>&nbsp;
                                    <asp:LinkButton ID="LB_CompanyLink" runat="server"></asp:LinkButton>
                                </div>
                            </div>



                        </div>
                    </div>

                </div>
            </div>
        </div>

        <ajax:ScriptManager ID="SM_Master" EnablePartialRendering="true" EnableScriptGlobalization="true"
            EnableScriptLocalization="true" runat="server" AsyncPostBackTimeout="360">
        </ajax:ScriptManager>

        <asp:Button ID="Btn_Dummy2" Style="display: none" runat="server" />
        <asp:Panel ID="Pnl_SavePhone" CssClass="width-modal-popup-auto" runat="server" Style="display: none;">
            <div class="col-xs-12">
                <div class="card">
                    <div class="header">
                        <h3><%= Resources.Content.EnterMobile%></h3>
                    </div>
                    <div class="body">
                        <div class="row">
                            <div class="col-sm-2 col-xs-12 row-label">
                                <label>
                                    <asp:Label ID="lbl1" runat="server" Text="<%$ Resources:Content,MobileNumber %>"></asp:Label>:</label>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_PhoneNumber" CssClass="form-control" MaxLength="20" runat="server" />
                                    </div>
                                </div>
                                <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="SavePhoneNumber" ID="RequiredFieldValidator6"
                                    ControlToValidate="TxBx_PhoneNumber" runat="server" ErrorMessage='<%$Resources:Content,GN00008058%>'
                                    Display="None"></asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12">
                                <asp:ValidationSummary ID="ValidationSummary2" ValidationGroup="SavePhoneNumber" ShowMessageBox="true"
                                    ShowSummary="false" runat="server" />
                                <asp:Button ID="Btn_Pop_OK" CssClass="btn btn-primary" ValidationGroup="SavePhoneNumber" runat="server" Text="<%$ Resources:Content,SendPIN %>" />
                                <asp:Button ID="Btn_Pop_Cancel" CssClass="btn btn-primary" CausesValidation="false" runat="server" Text="<%$ Resources:Content,GN0000572 %>" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </asp:Panel>
        <EM:ModalPopupExtender runat="server" ID="MPE_Phone" OkControlID="Btn_Pop_OK"
            CancelControlID="Btn_Pop_Cancel" OnOkScript="onOk()" OnCancelScript="onCancel()" BackgroundCssClass="modalBackground" DropShadow="false"
            PopupControlID="Pnl_SavePhone" TargetControlID="Btn_Dummy2">
        </EM:ModalPopupExtender>

        <asp:Button ID="Btn_Dummy3" Style="display: none" runat="server" />
        <asp:Panel ID="Pnl_SaveQRCode" CssClass="width-modal-popup-auto" runat="server" Style="display: none;" DefaultButton="Btn_Pop_QRCode_Ok">
            <div class="col-xs-12">
                <div class="card">
                    <div class="header">
                        <h3><%= Resources.Content.QRCode%></h3>
                    </div>
                    <div class="body">
                        <div class="row">
                            <div class="col-xs-12" style="width: 250px; height: 250px;">
                                <asp:Image ID="Image_QRCode" runat="server" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-5 col-xs-12 row-label">
                                <asp:Literal ID="Literal12" runat="server" Text="<%$ Resources:Content,ScanQRCodeOrUseTheKey %>"
                                    EnableViewState="false" />:
                            </div>
                            <div class="col-sm-7 col-xs-12">
                                <asp:Label ID="Lbl_SecretCode" runat="server"></asp:Label>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12">
                                <asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:Content,GAuthHelp %>"
                                    EnableViewState="false" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-2 col-xs-12 row-label">
                                <label>
                                    <asp:Label ID="Literal10" runat="server" Text="<%$ Resources:Content,EnterCode %>"
                                        EnableViewState="false" />:</label>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_GACode" CssClass="form-control" MaxLength="6" runat="server"></asp:TextBox>
                                    </div>
                                </div>
                                <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="SaveQRCode" ID="RequiredFieldValidator7"
                                    ControlToValidate="TxBx_GACode" runat="server" ErrorMessage='<%$Resources:Content,QRCodeRequired%>'
                                    Display="None"></asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12">
                                <asp:ValidationSummary ID="ValidationSummary3" ValidationGroup="SaveQRCode" ShowMessageBox="true"
                                    ShowSummary="false" runat="server" />
                                <asp:Button ID="Btn_Pop_QRCode_Ok" runat="server" ValidationGroup="SaveQRCode" CssClass="btn btn-primary" Text="<%$ Resources:Content,Save %>" />
                                <asp:Button ID="Btn_Pop_QRCode_Cancel" CausesValidation="false" CssClass="btn btn-primary" runat="server" Text="<%$ Resources:Content,GN0000572 %>" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </asp:Panel>
        <EM:ModalPopupExtender runat="server" ID="MPE_GA" OkControlID="Btn_Pop_QRCode_Ok"
            CancelControlID="Btn_Pop_QRCode_Cancel" OnOkScript="onOkGA()" OnCancelScript="onCancelGA()" BackgroundCssClass="modalBackground" DropShadow="false"
            PopupControlID="Pnl_SaveQRCode" TargetControlID="Btn_Dummy3">
        </EM:ModalPopupExtender>

    </form>
    <%-- End Login Page Main Div--%>
    <!-- Bootstrap Core Js -->
    <script type="text/javascript" src='/plugins/bootstrap/js/bootstrap.js?<%# ProductVersion %>'></script>

    <!-- Waves Effect Plugin Js -->
    <script type="text/javascript" src='/plugins/node-waves/waves.js?<%# ProductVersion %>'></script>

    <%--Bootstrap Select Plugin--%>
    <script type="text/javascript" src='/plugins/bootstrap-select/js/bootstrap-select.js?<%# ProductVersion %>'></script>

    <script type="text/javascript" src='/plugins/virtual-select/script.js?<%# ProductVersion %>'></script>

    <!-- Slimscroll Plugin Js -->
    <script type="text/javascript" src='/plugins/jquery-slimscroll/jquery.slimscroll.js?<%# ProductVersion %>'></script>

    <script type="text/javascript" src='/JS/admin.js?<%# ProductVersion %>'></script>


    <script type="text/javascript">
        jQuery(document).ready(function ($) {
            $('#notification-carousel').carousel({
                interval: 4000
            });

            setCookie('JSEnabled', '1', 7);
            $('[id*=noscript_div]').hide();
            $('#LoginPage').show();

            function setHeight() {
                windowHeight = $(window).innerHeight();
                $('#Login-Container, #Login-banner, #Login-content').css('height', windowHeight);

            };
            setHeight();

            $(window).resize(function () {
                setHeight();
            });

            document.forms[0].onsubmit = function () {
                HandleInputHtmlTags();
                if ((typeof Page_IsValid == 'undefined') ||      // asp page has no validator
                    (Page_IsValid != null && Page_IsValid)) {
                    $('.page-loader-wrapper').show();
                }
            }


            var oldPostBack;
            var myForm = document.forms['aspnetForm'];
            if (!myForm) {
                myForm = document.aspnetForm;
            }
            if (!myForm) {
                myForm = document.forms[0];
            }

            oldPostBack = __doPostBack;
            __doPostBack = customPostBackHandler;

            function customPostBackHandler(eventTarget, eventArgument) {

                $('.page-loader-wrapper').show();
                if (myForm && (!myForm.onsubmit || (myForm.onsubmit() != false))) {
                    HandleInputHtmlTags();
                    return oldPostBack(eventTarget, eventArgument);
                }
                else
                    return oldPostBack(eventTarget, eventArgument);
            }

            $('input[type = checkbox]').addClass("filled-in");
            $('input[type = radio]').addClass("with-gap");
            $('input[type = text]').addClass("form-control");
            $('input[type = password]').addClass("form-control form-password");

            $('.form-control.form-password').on('keyup change blur focus', function () {
                if ($(this).val().indexOf('<') != -1 || $(this).val().indexOf('>') != -1) {
                    $(this).val('');
                    $(this).focus();
                    alert('greater then ">" and less then "<" symbols are not allwoed in passwords.');
                }
                //e.preventDefault();
            });

            jQuery("input[type=text], textarea").keyup(function (event) {
                //skip freetextbox htmleditor control
                var str = $(this)[0].className;
                if (!(str.match(/_HtmlBox/g) || str.match(/allowhtml/g))) {
                    txtValue = $(this).val();
                    txtValue = txtValue.replace(/[\<\>]+/g, '');
                    if (txtValue != $(this).val()) {
                        $(this).val(txtValue);
                    }
                }

            });

            $('select').attr("data-live-search", "true")
                .attr("data-width", "100%")
                .addClass("selectpicker form-control show-tick")
                .selectpicker();

            $('#notification-carousel .carousel-inner .caption').slimScroll({
                height: '100px',
                size: '6px',
                color: 'rgba(4,4,4,0.5)',
                borderRadius: '3',
                railBorderRadius: '3',
                alwaysVisible: true,
                disableFadeOut: true,
                railVisible: false,
                smoothWheelScroll: false
            });

            $("#notification-carousel").on('slid.bs.carousel', function () {
                $('#notification-carousel .carousel-inner .caption').slimScroll({ scrollTo: 0 });
            });

            /*$('#notification-carousel .carousel-inner .item .slimScrollRail').first().mouseover();
  
            $('#notification-carousel').on('slide.bs.carousel', function (e) {
                $this = $(this);
  
                setTimeout(function ($this) {
                    console.log($this);
                    $this.find('.slimScrollRail').first().mouseover();
                }, 100, $this);
            });*/

            $('input[type=text], input[type=password]').first().focus();
            $('input[type=text], input[type=password]').first().closest('.form-line').addClass('focused');

            $('.form-line').each(function () {
                $this = $(this);
                if ($this.find('input[type=text]').val() && $this.find('input[type=text]').val() != '')
                    $this.addClass("focused");
            });

        });


        function onOk() {
            if (document.getElementById('TxBx_PhoneNumber').value != '') {
                __doPostBack('Btn_Pop_OK', '');
            }
            else {
                alert("Please enter phone number.");
                $find('MPE_Phone').show();
            }

        }

        function onCancel() {
            __doPostBack('Btn_Pop_Cancel', '');
        }
        function onOkGA() {
            if (document.getElementById('TxBx_GACode').value != '') {
                __doPostBack('Btn_Pop_QRCode_OK', '');
            }
            else {
                alert("Please enter code.");
                $find('MPE_GA').show();
            }

        }

        function onCancelGA() {
            __doPostBack('Btn_Pop_QRCode_Cancel', '');
        }

        function SetLogin(uid, pwd, TB_UserName, TB_Pass, Auto) {
            var TxBx_UserName = document.getElementById(TB_UserName);
            var TxBx_Password = document.getElementById(TB_Pass);
            TxBx_UserName.value = uid;
            TxBx_Password.value = pwd;
            if (Auto == 'true') {
                __doPostBack('Btn_Login', '');
            }
        }

        function IntializeDuo(IsAdUser) {
            var DuoHostName = $("#HF_DuoHostName").val();
            var DuoSigRequest = $("#HF_DuoSigRequest").val();
            Duo.init({
                'host': DuoHostName,
                'sig_request': DuoSigRequest,
                'post_action': 'Login.aspx?Action=DuoAuthenticationSuccess&ADU=' + IsAdUser
            });
        }

        document.addEventListener("DOMContentLoaded", function () {
            const resendButton = document.getElementById("<%= Lb_ResendCode.ClientID %>");
            const timerLabel = document.getElementById("<%= TimerLabel.ClientID %>");
            const hiddenTimer = document.getElementById("<%= HiddenTimer.ClientID %>");
            if (hiddenTimer) {
                function updateTimer() {
                    const endTime = new Date(hiddenTimer.value);
                    const interval = setInterval(() => {
                        const currentTime = new Date();
                        const remaining = Math.floor((endTime - currentTime) / 1000);

                        if (remaining > 0) {
                            resendButton.style.display = 'none';
                            timerLabel.textContent = `You can resend the code in ${remaining} seconds.`;
                        } else {
                            clearInterval(interval);
                            //timerLabel.textContent = "You can resend the code now.";
                            resendButton.style.display = '';
                            timerLabel.style.display = 'none';
                        }
                    }, 1000);
                }

                updateTimer();
            }
        });
    </script>

    <!--Custom JS File-->
    <script type="text/javascript" src='/JS/custom-fixes-rcc.js?<%# ProductVersion %>'></script>

</body>

</html>
