<%@ Page Language="C#"Inherits="xy.start.AdminLogin" %>
<%@ Import Namespace="xy.start" %>
<!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>
    <title>欢迎登录后台</title>
    <link rel="stylesheet" type="text/css" href="style/css/login.css" />
    <script type="text/javascript" src="style/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="style/js/login.js"></script>
    <script type="text/javascript" src="style/js/validate.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#TxtUserName").focus();
            $("#BtnSubmit").click(function () {
                if (ValidateForm()) {
                    $.ajax({
                        type: "post",
                        dataType: "html",
                        data: $('#myformadu').serialize(),
                        url: "?type=login" + "&r=" + Math.random(),
                        beforeSend: function (XMLHttpRequest) {

                        },
                        success: function (result) {
                            if (result == "") {
                                if (window.parent == window)
                                    location.href = "default.aspx" + $("#HiddenQuery").val();
                                else
                                    window.parent.location.href = "default.aspx" + $("#HiddenQuery").val();
                            } else if (result == "ipfailed")
                                location.href = location.href;
                            else
                                alert(result);
                        },
                        error: function () {
                            alert("ajax error...");
                        }
                    });
                }
                return false;
            });
        });
    </script>
</head>
<body id="loginBody" >        
    <div class="loginMain">
        <form id="myformadu" action="" method="post" defaultbutton="BtnSubmit">
            <input type="hidden" id="HiddenQuery" value="<%=xy.start.UtilsRequest.UrlQuerys() %>" />
            <div class="loginBox">
                <ul>
                    <li>
                        <input id="TxtUserName" name="TxtUserName" type="text" class="loginUser loginText" value="" maxlength="20" 
                            tabindex="1" attr="{regex:'[A-Za-z0-9-]{4,20}',msg:'账户格式不对,为4-20个英文数字组合'}" /></li>
                    <li>
                        <input id="TxtUserPass" name="TxtUserPass" type="password" class="loginPwd loginText" value="" maxlength="16" 
                            tabindex="2" attr="{regex:'[A-Za-z0-9-]{4,16}',msg:'密码格式不对,为4-16个英文数字组合'}" /></li>
                    <li>
                        <input id="BtnSubmit" name="BtnSubmit" type="submit" class="loginBtn" value=" Login " tabindex="3" />
                        <label><a class="loginPwdBack" href="<%=Copyright._TechUrl %>" target="_blank" >忘记密码？</a></label>
                    </li>
                </ul>
            </div>
        </form>
    </div>
    <div class="loginTop">
    </div>
    <div class="loginBottom"></div>
    <div id="cloudBody">
        <div id="cloud1" class="cloud"></div>
        <div id="cloud2" class="cloud"></div>
        <div id="cloud3" class="cloud"></div>
    </div>
</body>
</html>
