<%@ page language="C#" autoeventwireup="true" inherits="ims.web.Login, ims.web" enableviewstatemac="false" enableEventValidation="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" id="Login">
<head runat="server">
    <title>登录<%= ims.Comm.Vars.OrgName + ims.Comm.Vars.SysName %></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="renderer" content="webkit">
</head>
<body>
    <form id="form1" runat="server" defaultbutton="box$btnOK">
    <asp:ScriptManager ID="s1" runat="server">
        <Scripts><asp:ScriptReference Name="MicrosoftAjax.js" ScriptMode="Auto" Path="~/js/MsAjax.js"/><asp:ScriptReference Name="MicrosoftAjaxWebForms.js" ScriptMode="Auto" Path="~/js/MsAjax.js"/></Scripts>
    </asp:ScriptManager>
    
    <ims:Pop runat="server" ID="box" Title="登录" ShowCancelButton="false" OkButtonText="登 录" OnOkClick="toLogin" HideOnOkClientClick="false" ShowProgress="false">
    <ContentTemplate>
        用户名：<asp:TextBox ID="tbUser" runat="server" Width="120"></asp:TextBox><asp:DropDownList runat="server" ID="ddlUsers" Width="124" Visible="false"></asp:DropDownList>
        <asp:HyperLink ID="hlReg" runat="server" CssClass="u" Text="用户注册" NavigateUrl="~/reg.aspx"></asp:HyperLink>
        <div class="sep"></div>
        密　码：<asp:TextBox ID="tbPassword" runat="server" Width="120" TextMode="Password"></asp:TextBox>
        <a href="#" onclick="return ShowPop('pop_popup',true);" class="u" runat="server" id="forgetPwd">忘记密码</a><br />
        <div runat="server" id="divVcode">
        验证码：<asp:TextBox ID="tbVcode" runat="server" Width="120"></asp:TextBox> <img src="vcode.aspx" title="验证码。若看不清楚，请点击以刷新。" style="cursor:pointer;height:19px" align="absMiddle" onclick="this.src='vcode.aspx?time='+new Date().getTime();" /><br />
        </div>
        <asp:CheckBox ID="RememberMe" runat="server" onclick="$('#box_tbPassword').focus();" Text="下次自动登录" />
        <div class="sep"></div>
        <asp:HyperLink ID="toOrderVerify" runat="server" NavigateUrl="~/orderVerify.aspx">我不想登录，希望直接提交订单</asp:HyperLink>
    </ContentTemplate>
    </ims:Pop>
    
    <asp:Button ID="resetPwdRecovery" runat="server" OnClick="ResetPwdRecovery" CausesValidation="false" CssClass="hide" />
    <ims:Pop runat="server" ID="pop" Title="找回密码" ShowCancelButton="false" ShowOkButton="false" OnClientCanel="$f('resetPwdRecovery').click();" ShowProgress="false">
    <ContentTemplate>
        <asp:Wizard ID="PwdRecovery" runat="server" DisplaySideBar="False" OnNextButtonClick="nextStep">
            <WizardSteps>
                <asp:WizardStep ID="WizardStep1" runat="server">
                要接收您的密码，请输入您的用户名。
                    <div class="contArea">
                        用户名：<asp:TextBox ID="tbUserName" runat="server" Width="100px"></asp:TextBox>
                    </div>
                </asp:WizardStep>
                <asp:WizardStep ID="WizardStep2" runat="server">
                要接收您的密码，请回答下列问题。<br />
                    <div class="contArea">
                    <asp:Literal ID="question" runat="server"></asp:Literal><br />
                    答案：<asp:TextBox ID="tbAnswer" runat="server" Width="100px"></asp:TextBox>
                     </div>
               </asp:WizardStep>
                <asp:WizardStep ID="WizardStep3" runat="server">
                    <div class="contArea">密码已发送到您的邮箱。</div>
                </asp:WizardStep>
            </WizardSteps>
            <StartNavigationTemplate>
                <div style="text-align:right">
                    <asp:Button ID="btnStartNext" runat="server" CommandName="MoveNext" CssClass="btn" CausesValidation="false"
                    Text="下一步" Width="52" />
                </div>
            </StartNavigationTemplate>
            <NavigationButtonStyle CssClass="btn" />
            <StepNavigationTemplate>
                <div style="text-align:right">
                <asp:Button ID="btnPrev" runat="server" CausesValidation="False" CommandName="MovePrevious"
                    CssClass="btn" Text="上一步" Width="52" />
                <asp:Button ID="btnNext" runat="server" CommandName="MoveNext" CssClass="btn" CausesValidation="False"
                    Text="下一步" Width="52" />
                  </div>
          </StepNavigationTemplate>
            <NavigationStyle HorizontalAlign="Center" />
            <FinishNavigationTemplate>
                <div class="right mtop_l">
                    <input type="button" value="确定" class="btn" onclick="HideDialog();" />
                 </div>
           </FinishNavigationTemplate>
        </asp:Wizard>
    </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="pwd" Title="您的密码是初始密码，请修改…" ShowCancelButton="false" ShowOkButton="false" HideOnOkClientClick="false" ShowCloseButton="false" ShowProgress="false">
    <ContentTemplate>
        <table cellspacing="2" onkeydown="return enterTo('pwd_btnChange');">
            <tr><td class="right">新密码：</td><td><asp:TextBox runat="server" TextMode="Password" ID="tbNew"></asp:TextBox></td></tr>
            <tr><td class="right">确认新密码：</td><td><asp:TextBox runat="server" TextMode="Password" ID="tbVerify"></asp:TextBox></td></tr>
            <tr><td> </td><td><asp:Button runat="server" ID="btnChange" OnClick="ChangePwd" OnClientClick="return preChgPwd();" Text="确 定" CssClass="btn" /></td></tr>
        </table>
    </ContentTemplate>
    </ims:Pop>
    <script src="js/comm.js"></script>
    <script>
        if (self != parent && location.href.indexOf("top=1") > -1) top.location = location;
        $(window).load(function () {
            $('#box_Body input:first').focus();
            $("#box_close").removeAttr("onclick").click(function(){
                if (self != parent) {
                    location = "home.aspx";
                } else {
                    opener = "";
                    close();
                }
            });
        });
        function preChgPwd() {
            var pwd1 = $("#pwd_tbNew").val(), pwd2 = $("#pwd_tbVerify").val();
            if (pwd1.length < 3) return showAndExit("请输入有效的新密码！");
            if (pwd2 == "") return showAndExit("请输入确认新密码！");
            if (pwd1 != pwd2) return showAndExit("两次输入的新密码不一致！");
            return true;
        }
    </script>
    </form>
</body>
</html>
