<%@ Page Language="C#" AutoEventWireup="true" Inherits="PowerEasy.Module.General.WebSite.Admin.LogOn"
    CodeBehind="Login.aspx.cs" ValidateRequest="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>管理登录</title>
    <link href="../Admin/Common/Login.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Admin/JS/softkeyboard.js"></script>
    <script type="text/javascript" src="/js/jquery.pack.js"></script>
    <script type="text/javascript">
    <!--
    if(self!=top){top.location=self.location;} 
    function ShowSoftKeyboard(obj)
    {
        if((typeof(CheckLoaded) == "function"))
        {
            password1 = obj;
            showkeyboard();
            Calc.password.value = '';
        }
        else
        {
            return false;
        }
    }
    // -->
    </script>
</head>
<body id="loginbody">
    <form id="Login" runat="server" enctype="multipart/form-data" defaultfocus="TxtUserName" defaultbutton="IbtnEnter">
        <div id="adminboxall">
            <div class="adminboxtop">
            </div>
            <div id="adminboxmain">
                <div class="menu">
                    <label>
                        <asp:ImageButton ID="IbtnEnter" ImageUrl="../Admin/Images/LoginImages/admin_menu.gif"
                            runat="server" OnClientClick="return BeginClick();" Style="width: 76px; height: 26px;" OnClick="IbtnEnter_Click" />
                    </label>
                </div>
            </div>
            <div class="adminboxbottom">
                <div id="login">
                    <ul>
                        <li class="text">用户名：<br />
                            <div class="box1">
                                <pe:ExtendedTextBox ID="TxtUserName" MaxLength="20" runat="server" CssClass="boxcontent"
                                    Style="font-family: 宋体;" EnableMultiStyle="false" Text=""></pe:ExtendedTextBox>
                            </div>
                        </li>
                        <li class="text">密 码：<br />
                            <div class="box2">
                                <%-- 取消Type=Password，利用JS在页面加载完毕后修改 --%>
                                <pe:ExtendedTextBox ID="TxtPassword" MaxLength="20" runat="server"
                                    CssClass="boxcontent" AutoComplete="off" EnableMultiStyle="false" Text=""></pe:ExtendedTextBox>
                            </div>
                        </li>
                        <li id="LiSiteManageCode" runat="server" class="text">管理认证码：<br />
                            <div class="box3">
                                <%-- 取消Type=Password，利用JS在页面加载完毕后修改 --%>
                                <pe:ExtendedTextBox ID="TxtAdminValidateCode" MaxLength="20" runat="server"
                                    CssClass="boxcontent" EnableMultiStyle="false" Text=""></pe:ExtendedTextBox>
                            </div>
                        </li>
                        <li id="LiCode" visible="false" runat="server" class="textCode">验证码：<br />
                            <div class="box4">
                                <pe:ExtendedTextBox ID="TxtValidateCode" MaxLength="20" runat="server" CssClass="boxcontent2"
                                    Style="ime-mode: disabled;" Visible="false" EnableMultiStyle="false"></pe:ExtendedTextBox>
                                <pe:ValidateCode ID="VcodeLogin" runat="server" Visible="false" RefreshLinkToolTip="看不清楚，换一个" />
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <a href="<%= BasePath %>" target="_blank" title="网站首页">
                <img src="../Admin/Images/LoginImages/admin_text.gif" width="186" border="0" height="10"
                    alt="Powered by PowerEasy&reg;" /></a>
            <div class="clearbox">
            </div>
        </div>
        <pe:RequiredFieldValidator ID="ValrUserName" runat="server" ErrorMessage="请输入用户名！"
            Display="None" SetFocusOnError="True"></pe:RequiredFieldValidator>
        <pe:RequiredFieldValidator ID="ValrPassword" runat="server" ErrorMessage="请输入密码！"
            Display="None" SetFocusOnError="True"></pe:RequiredFieldValidator>
        <pe:RequiredFieldValidator ID="ValrAdminValidateCode" runat="server" ErrorMessage="请输入管理认证码！"
            Display="None" SetFocusOnError="True"></pe:RequiredFieldValidator>
        <pe:RequiredFieldValidator ID="ValrValidateCode" runat="server" ErrorMessage="请输入验证码！"
            Display="None" SetFocusOnError="True" Visible="false"></pe:RequiredFieldValidator>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
            ShowSummary="False" />

        <script type="text/javascript" src="../JS/Encrypt/BigInt.js"></script>
        <script type="text/javascript" src="../JS/Encrypt/Encrypt.js"></script>
        <script type="text/javascript" src="../JS/Encrypt/Barrett.js"></script>
        <script type="text/javascript" src="../JS/Encrypt/Common.js"></script>
        <script type="text/javascript">
            $(function () {
                var $userpass = $("#<%=TxtPassword.ClientID%>")[0];
                try {
                    $userpass.type = 'password';
                } catch (e) {
                    $userpass.outerHTML = $userpass.outerHTML.replace('type=text', '').replace('>', ' type="password">');
                }
                if ($("#<%=TxtAdminValidateCode.ClientID%>").length > 0) {
                    var $usercode = $("#<%=TxtAdminValidateCode.ClientID%>")[0];
                    try {
                        $usercode.type = 'password';
                    } catch (e) {
                        $usercode.outerHTML = $usercode.outerHTML.replace('type=text', '').replace('>', ' type="password">');
                    }
                }
            });
            var BeginClick = function () {
                if (Page_ClientValidate()) {
                    GetRsaEncrypt(3);
                    $("#<%=TxtPassword.ClientID%>").attr("maxlength", "300");
                    $("#<%=TxtPassword.ClientID%>").val(rsaEncrypt($("#<%=TxtPassword.ClientID%>").val()));
                    if ($("#<%=TxtAdminValidateCode.ClientID%>").length > 0) {
                        $("#<%=TxtAdminValidateCode.ClientID%>").attr("maxlength", "300");
                        $("#<%=TxtAdminValidateCode.ClientID%>").val(rsaEncrypt($("#<%=TxtAdminValidateCode.ClientID%>").val()));
                    }
                    return true;
                } else {
                    return false;
                }
            }
        </script>
    </form>
</body>
</html>
