<%@ page language="C#" autoeventwireup="true" inherits="UserInfo_UserInfoUpdata, App_Web_rbxcxpwt" theme="Themes" stylesheettheme="Themes" %>

<!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>
   <script src="../js/artDialog3/artDialog.min.js"></script>
      <script>          (function($) { var d = $.dialog.defaults; d.skin = ['chrome']; })(art);</script>
<script type="text/javascript" src="../js/jquery.js"></script>
    <script type="text/javascript">
        function PasswordStrength(showed) {
            this.showed = (typeof (showed) == "boolean") ? showed : true;
            this.styles = new Array();
            this.styles[0] = { backgroundColor: "#EBEBEB", borderLeft: "solid 1px #FFFFFF", borderRight: "solid 1px #BEBEBE", borderBottom: "solid 1px #BEBEBE" };
            this.styles[1] = { backgroundColor: "#FF4545", borderLeft: "solid 1px #FFFFFF", borderRight: "solid 1px #BB2B2B", borderBottom: "solid 1px #BB2B2B" };
            this.styles[2] = { backgroundColor: "#FFD35E", borderLeft: "solid 1px #FFFFFF", borderRight: "solid 1px #E9AE10", borderBottom: "solid 1px #E9AE10" };
            this.styles[3] = { backgroundColor: "#95EB81", borderLeft: "solid 1px #FFFFFF", borderRight: "solid 1px #3BBC1B", borderBottom: "solid 1px #3BBC1B" };

            this.labels = ["弱", "中", "强"];

            this.divName = "pwd_div_" + Math.ceil(Math.random() * 100000);
            this.minLen = 5;

            this.width = "148px";
            this.height = "16px";

            this.content = "";

            this.selectedIndex = 0;

            this.init();
        }
        PasswordStrength.prototype.init = function() {
            var s = '<table cellpadding="0" id="' + this.divName + '_table" cellspacing="0" style="width:' + this.width + ';height:' + this.height + ';">';
            s += '<tr>';
            for (var i = 0; i < 3; i++) {
                s += '<td id="' + this.divName + '_td_' + i + '" width="33%" align="center"><span style="font-size:1px">&nbsp;</span><span id="' + this.divName + '_label_' + i + '" style="display:none;font-family: Courier New, Courier, mono;font-size: 12px;color: #000000;">' + this.labels[i] + '</span></td>';
            }
            s += '</tr>';
            s += '</table>';
            this.content = s;
            if (this.showed) {
                document.write(s);
                this.copyToStyle(this.selectedIndex);
            }
        }
        PasswordStrength.prototype.copyToObject = function(o1, o2) {
            for (var i in o1) {
                o2[i] = o1[i];
            }
        }
        PasswordStrength.prototype.copyToStyle = function(id) {
            this.selectedIndex = id;
            for (var i = 0; i < 3; i++) {
                if (i == id - 1) {
                    this.$(this.divName + "_label_" + i).style.display = "inline";
                } else {
                    this.$(this.divName + "_label_" + i).style.display = "none";
                }
            }
            for (var i = 0; i < id; i++) {
                this.copyToObject(this.styles[id], this.$(this.divName + "_td_" + i).style);
            }
            for (; i < 3; i++) {
                this.copyToObject(this.styles[0], this.$(this.divName + "_td_" + i).style);
            }
        }
        PasswordStrength.prototype.$ = function(s) {
            return document.getElementById(s);
        }
        PasswordStrength.prototype.setSize = function(w, h) {
            this.width = w;
            this.height = h;
        }
        PasswordStrength.prototype.setMinLength = function(n) {
            if (isNaN(n)) {
                return;
            }
            n = Number(n);
            if (n > 1) {
                this.minLength = n;
            }
        }
        PasswordStrength.prototype.setStyles = function() {
            if (arguments.length == 0) {
                return;
            }
            for (var i = 0; i < arguments.length && i < 4; i++) {
                this.styles[i] = arguments[i];
            }
            this.copyToStyle(this.selectedIndex);
        }
        PasswordStrength.prototype.write = function(s) {
            if (this.showed) {
                return;
            }
            var n = (s == 'string') ? this.$(s) : s;
            if (typeof (n) != "object") {
                return;
            }
            n.innerHTML = this.content;
            this.copyToStyle(this.selectedIndex);
        }
        PasswordStrength.prototype.update = function(s) {
            if (s.length < this.minLen) {
                this.copyToStyle(0);
                return;
            }
            var ls = -1;
            if (s.match(/[a-z]/ig)) {
                ls++;
            }
            if (s.match(/[0-9]/ig)) {
                ls++;
            }
            if (s.match(/(.[^a-z0-9])/ig)) {
                ls++;
            }
            if (s.length < 6 && ls > 0) {
                ls--;
            }
            switch (ls) {
                case 0:
                    this.copyToStyle(1);
                    break;
                case 1:
                    this.copyToStyle(2);
                    break;
                case 2:
                    this.copyToStyle(3);
                    break;
                default:
                    this.copyToStyle(0);
            }
        }
    </script>

    <style type="text/css">
        #innav
        {
            padding-left: 50px;
            color: #d38e0c;
        }
        #innav A
        {
            color: #d38e0c;
        }
        .style6
        {
            width: 14%;
            border: 1px solid #D3EAF8;
        }
        .style1
        {
            border: 1px solid #D3EAF8;
        }
    </style>
    
    
</head>
<body>
<div id="loading">
        <div style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background-color: #ffffff;
            z-index: 10; filter: alpha(opacity=90); opacity: 0.9;">
        </div>
        <div id="msg_area" style="z-index: 200; left: 289px; position: absolute; top: 202px;">
            <div id="msgPanel" style="z-index: 200;" height="24px" width="100px" bordercolor="#eeeeee"
                borderstyle="Solid" borderwidth="1px">
                <asp:Image ID="img" runat="server" ImageUrl="~/images/loading.gif" />
                <font style="font-size: 9pt;color:Gray;">loading...读取中......</font>
            </div>
        </div>
    </div>
    <form id="form1" runat="server">
    <table cellpadding="0" cellspacing="0" class="table_box">
        <tr>
            <td class="right_bg">
                <span class="right_title">
                    <img src="../Images/homen.gif" class="img_style" />
                    您的当前位置：个人管理 > 密码修改</span>
            </td>
        </tr>
        <tr>
            <td>
                <table width="100%" cellpadding="5" cellspacing="1" class="table_notitle">
                    <tr>
                        <td width="10%" align="right" class="td01">
                            旧密码：
                        </td>
                        <td width="43%" align="left">
                            <asp:TextBox ID="txtPasswordOne" runat="server" TextMode="Password" MaxLength="16"  Width="150px"></asp:TextBox>
                        </td>
                        <td width="47%" rowspan="4" align="center" style="cursor: hand;" onclick="window.location.href='GetBackPWDEFRM.aspx'"
                            class="td01">
                            <img src="../images/clock.gif" alt="" />
                            <br />
                            <span style="font-size: 14px; color: #f59d20;">设置密码保护</span>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" class="td01">
                            新密码：
                        </td>
                        <td height="30" width="43%" align="left">
                            <input name="txtPasswordTwo" type="password" id="txtPasswordTwo" runat="server" style="width: 148px"
                                onkeyup="ps.update(this.value);" maxlength="16" class="txt" />
                            <script type="text/javascript" language="javascript">
                                var ps = new PasswordStrength();
                                ps.setSize("200", "20");
                                ps.setMinLength(5);
                            </script>
                            <asp:Label ID="lblinfo" runat="server" Text=""></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" class="td01">
                            确认密码：
                        </td>
                        <td width="43%" align="left">
                            <asp:TextBox ID="txtPasswordThree" runat="server" MaxLength="16" TextMode="Password" Width="150px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        </td>
                        <td align="left">
                            <asp:Button ID="btnOk" runat="server" Text="保 存" OnClick="btnOk_Click" />
                            &nbsp;<input type="reset" id="btnset" value="重 置" class="conn_btn" />
                        </td>
                    </tr>
                </table>
            </td></tr></table>
    </form>
     <script type="text/javascript">
         $("#loading").fadeOut()
</script>
</body>

<script>
    function Determine() {

        var determine = /^[A-Za-z0-9_-]{5,16}$/;
        if (document.getElementById("txtPasswordOne").value == "") {
            art.dialog({ content: '旧密码不能为空！',icon:'alert',id:'art',time:3 }, function() { return true; });
            //alert("旧密码不能为空！");
            document.getElementById("txtPasswordOne").select();
            return false;
        } else if (!determine.exec(document.getElementById("txtPasswordTwo").value)) {
        //alert("新密码只能是5-16位的数字和字母和下划线！");
        art.dialog({ content: '新密码只能是5-16位的数字和字母和下划线！', icon: 'alert', id: 'art', time: 3 }, function() { return true; });
            document.getElementById("txtPasswordTwo").select();
            return false;
        } else if (document.getElementById("txtPasswordThree").value != document.getElementById("txtPasswordTwo").value) {
        //alert("密码确认不一致");
        art.dialog({ content: '密码确认不一致！', icon: 'alert', id: 'art', time: 3 }, function() { return true; });
            document.getElementById("txtPasswordTwo").select();
            return false;
        }
        return true;
    }
</script>

<script src="../js/calendar.js" type="text/javascript"></script>

<script type="text/javascript" src="../Js/jquery.js"></script>

<script type="text/javascript" src="../Js/jquery.pngFix.pack.js"></script>

<script type="text/javascript" src="../Js/WebValidator.js"></script>

<script type="text/javascript" src="../Js/InterfaceContrl.js"></script>

</html>
