<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Hidistro.UI.Web.Admin.Login" %>

<%@ Register TagPrefix="Hi" Namespace="Hidistro.UI.Common.Controls" Assembly="Hidistro.UI.Common.Controls" %>
<%@ Import Namespace="Hidistro.Core" %>
<!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>
    <Hi:HeadContainer ID="HeadContainer1" runat="server" />
    <Hi:PageTitle ID="PageTitle1" runat="server" />
    <link href="css/login.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Utility/jquery-1.6.4.min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="con_body">
        <div class="lo_t"><img src="images/images_6.gif" /></div>
        <div class="lo_c">
            <div class="top"><img src="images/images_1.gif" /></div>
            <div class="Middle">
                <div class="Con_r">
                    <ul>
                        <li>
                            <div>
                                用户名：</div>
                            <div>
                                <asp:TextBox ID="txtAdminName" CssClass="input1" runat="server"></asp:TextBox></div>
                        </li>
                        <li>
                            <div>
                                密<em></em>码：</div>
                            <div>
                                <asp:TextBox ID="txtAdminPassWord" CssClass="input2" runat="server" TextMode="Password" /></div>
                        </li>
                        <li runat="server" id="imgCode" visible="true">
                            <div>
                                验证码：</div>
                            <div>
                                <asp:TextBox ID="txtCode" runat="server" class="input3" MaxLength="4"></asp:TextBox>
                            </div>
                            <div class="Verifi">
                                <a href="javascript:refreshCode();">
                                <img id="img_txtCode" src="" alt="" />     <img id="imgVerifyCode" src="../VerifyCodeImage.aspx" alt="" style="border-style: none" /></a></div>
                        </li>
                    </ul>
                    <%--<div style="float:right;color:red"></div>--%>
                    <div class="input_b" style="float: right; color: Red">
                        <asp:Literal ID="lblStatus" runat="server" Visible="false"></asp:Literal></div>
                        <div class="input_b"><asp:HiddenField ID="ErrorTimes" runat="server" Value="0" />
                            <asp:Button ID="btnAdminLogin" runat="server" Text="" CssClass="submit" /></div>
                    
                </div>
            </div>
            <div class="bottom">
                <%--<Hi:SiteCopyright ID="SiteCopyright1" runat="server" />--%>
            </div>
        </div>
        <div class="lo_r">
            <img src="images/images_7.gif" />
        </div>
    </div>
    </form>
    <script language="javascript" type="text/javascript">
        function refreshCode() {
            var img = document.getElementById("imgVerifyCode");
            if (img != null) {
                var currentDate = new Date();
                img.src = '<%= Globals.ApplicationPath + "/VerifyCodeImage.aspx?t=" %>' + currentDate.getTime();
            }
        }
        $(document).ready(function () {
            $("#img_txtCode").hide();
            $("#txtCode").keyup(function () {
                var value = $(this).val();
                if (value.length < 4) {
                    $("#img_txtCode").hide();
                    temp = "";
                }
                else if (value.length == 4) {
                    if (temp != value) {
                        $("#img_txtCode").show();
                        $.ajax({
                            url: "Login.aspx",
                            type: 'post', dataType: 'json', timeout: 10000,
                            data: {
                                isCallback: "true",
                                code: $("#txtCode").val()
                            },
                            async: false,
                            success: function (resultData) {
                                var flag = resultData.flag;
                                if (flag == "1") {
                                    $("#img_txtCode").attr("src", "images/true.gif");
                                }
                                else if (flag == "0") {
                                    $("#img_txtCode").attr("src", "images/false.gif");
                                }
                            }
                        });
                    }
                    temp = value;
                }
            });
        });
    </script>
</body>
</html>
