<%@ Page Language="C#" MasterPageFile="~/masterpages/eGeneralNoTimer.master" AutoEventWireup="True"
    Inherits="_Default" Title="Brightstar Device Protection: Login" Culture="auto" UICulture="auto"
    CodeBehind="Default.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="Server">
    <script type="text/javascript">
    function capsCheck(e, obj) {
        kc = e.keyCode ? e.keyCode : e.which;
        sk = e.shiftKey ? e.shiftKey : ((kc == 16) ? true : false);
        
        var Password = document.getElementById("<%= m_lgLogin.FindControl("CapsWarning").ClientID %>"); 
        if (((kc >= 65 && kc <= 90) && !sk) || ((kc >= 97 && kc <= 122) && sk)) {

            Password.style.visibility = 'visible';
        }
        else Password.style.visibility = 'hidden';
    } 
    </script>
    <div id="envMessage"> 
        <asp:Label ID="HostEnvironmentHeader" runat="server" /><br/>
        <asp:Label ID="HostEnvironmentInfo" runat="server" />
    </div> 
    <div id="login">
    <div width="300px">
        <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse">
            <tr>
                <td>
                    <table border="0" cellpadding="0" width="220px">
                        <tr>
                            <td>
                                <asp:Literal ID="litLanguage" runat="server" Text="<%$ Resources: Default, LabelLocationColon %>"
                                    Visible="true" />
                            </td>
                            <td width="150px">
                                <asp:DropDownList ID="ddlCulture" runat="server" AutoPostBack="true " Visible="true"
                                    DataValueField="LocaleId" DataTextField="Description" OnSelectedIndexChanged="ddlCulture_SelectedIndexChanged" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="litEnvironments" runat="server" Text="Environment:" Visible="False" />
                            </td>
                            <td width="150px">
                                <asp:DropDownList ID="ddlConsOfEnvironments" runat="server" AutoPostBack="true " Visible="False" OnSelectedIndexChanged="ddlEnvironments_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <%--<asp:Literal ID = "litTimeZone" runat = "server" Text = "<%$ Resources: Default, TimeZone %>" /> --%>
                            </td>
                            <td>
                                <%--<asp:DropDownList ID="ddlTimeZone" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlTimeZone_SelectedIndexChanged" /> --%>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <br />
    </div>
    <asp:Login ID="m_lgLogin" runat="server" OnAuthenticate="Login_Authenticate"
        DestinationPageUrl="~/site/HITS/Default.aspx" OnLoggedIn="m_lgLogin_LoggedIn" >
        <TitleTextStyle Font-Bold="True" Height="20px" HorizontalAlign="Left" VerticalAlign="Top" />
        <CheckBoxStyle VerticalAlign="Middle" />
        <TextBoxStyle Width="100px" />
        <LabelStyle HorizontalAlign="Left" />
        <LayoutTemplate>
            <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse">
                <tr>
                    <td>
                        <table border="0" cellpadding="0">
                            <tr>
                                <td align="left"  valign="top" class="loginText"  >
                                    <asp:Literal ID="Literal1"  runat="server" Text="<%$ Resources: Default, LogInLabel %>" />
                                </td>
                            </tr>
                            <tr>
                                <td valign="middle" align="left">
                                    <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" Text="<%$ Resources: Default, UserNameLabel %>"></asp:Label>
                                    <asp:TextBox ID="UserName" runat="server" Width="120px" autocomplete="off"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                        ErrorMessage="<%$ Resources: Default, UserNameRequiredLabel %>" ToolTip="<%$ Resources: Default, UserNameRequiredLabel %>"
                                        ValidationGroup="m_lgLogin" Text="*"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                
                                <td valign="middle" align="left">
                                       <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" Text="<%$ Resources: Default, PasswordLabel %>"></asp:Label>
                                    <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="120px" autocomplete="off"
                                        onkeypress="capsCheck(event,this);"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                        ErrorMessage="<%$ Resources: Default, PasswordRequiredLabel %>" ToolTip="<%$ Resources: Default, PasswordRequiredLabel %>"
                                        ValidationGroup="m_lgLogin" Text="*"></asp:RequiredFieldValidator>
                                    <br />
                                    <asp:Label ID="CapsWarning" runat="server" Style="visibility: hidden; color: Red"
                                        Text="<%$ Resources: Default, CapsWarning %>" />
                                </td>
                            </tr>
                            <tr valign="top">
                                <td valign="top" align="left">
                                    <asp:Label ID="PasswordSensitiveLabel" runat="server" Text="<%$ Resources: Default, PasswordSensitiveLabel %>"
                                        Font-Size="X-Small"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td  valign="middle">
                                </td>
                            </tr>
                            <tr>
                              
                                <td align="center">
                                    <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="<%$ Resources: Default, LoginButton %>"
                                        ValidationGroup="m_lgLogin" />
                                </td>
                            </tr>
                            <tr>
                                <td  valign="middle">
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <div style="color: red">
                <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
            </div>
        </LayoutTemplate>
    </asp:Login>
    &nbsp;<br />
    <asp:LoginView ID="m_lvLoginView" runat="server">
        <LoggedInTemplate>
            <asp:Label ID="m_lblLogged" runat="server" Text="<%$ Resources: Default, YouAreLoggedInAsLabel %>"></asp:Label>&nbsp;
            <asp:LoginName ID="m_lnLoginName" runat="server" Font-Bold="True" />
            <asp:HyperLink ID="m_hlChangePassword" runat="server" NavigateUrl="~/Site/ChangePassword.aspx"
                Text="<%$ Resources: Default, ChangePasswordLabel %>"></asp:HyperLink>
        </LoggedInTemplate>
        <AnonymousTemplate>
            <asp:HyperLink ID="m_hlForgetPassword" runat="server" NavigateUrl="~/RecoverPasswordNew.aspx"
                Text="<%$ Resources: Default, ForgetPasswordLabel %>"></asp:HyperLink>
        </AnonymousTemplate>
    </asp:LoginView>
    <br />
    <br />
        </div>
</asp:Content>
