<%@ page language="C#" autoeventwireup="true" inherits="ChangePassword, App_Web_changepassword.aspx.de3fb1ff" enableEventValidation="false" %>

<%@ Register Src="~/UserControls/iERPToolBar.ascx" TagName="iERPToolBar" TagPrefix="dsit" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head id="Head1" runat="server">
    <title>..:: ICDAS 2.1 ::..</title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />

    <script type="text/javascript" language="javascript" src="../App_Include/JavaScript/js_functions.js"> </script>
    
    <script type="text/javascript" language="javascript" src="../App_Include/JavaScript/ScreenSaverStar.js"> </script>

    <script type="text/javascript" language="javascript">

        function resizeObject() {
            var w = getBrowserWindowSize().width;
            var h = getBrowserWindowSize().height - 5;
            //window.resizeTo(w, h);
            var cObj = document.getElementById("Form1");
            if (cObj != null) {
                cObj.style.height = (parseInt(h)) + "px";

            }
        }
        function validate() {
            var doc = document.forms[0];
            re = /[0-9]/;
            re1 = /[a-zA-Z]/;
            if (doc.txtOldPassword.value == "") {
                alert("Please Enter Old Password...");
                document.forms[0].txtOldPassword.focus()
                return false;
            }
            if (doc.txtNewPassword.value == "") {
                alert("Please Enter New Password...");
                document.forms[0].txtNewPassword.focus()
                return false;
            }
            if (doc.txtConfPassword.value == "") {
                alert("Please Enter Confirm Password...");
                document.forms[0].txtConfPassword.focus()
                return false;
            }
            //------------------------------------------------------------------
            if (Trim(doc.txtNewPassword.value) != "") {
                var numaric = doc.txtNewPassword.value;
                if (numaric.length < 8) {
                    alert("Enter Password must have more than 8 Char...");
                    document.forms[0].txtNewPassword.focus();
                    return false;
                }
                for (var j = 0; j < numaric.length; j++) {
                    var alphaa = numaric.charAt(j);
                    var hh = alphaa.charCodeAt(0);
                    if ((hh > 47 && hh < 58) || (hh > 64 && hh < 91) || (hh > 96 && hh < 123) || (hh == 32)) {

                    }
                    else {
                        alert("Enter Alfa-Numeric Password...");
                        document.forms[0].txtNewPassword.focus();
                        return false;
                    }
                }
            }
            if (!re.test(doc.txtNewPassword.value)) {
                alert("Password must contain at least one number (0-9)!");
                doc.txtNewPassword.focus();
                return false;
            }
            if (!re1.test(doc.txtNewPassword.value)) {
                alert("Password must contain at least one character (a-zA-Z)!");
                doc.txtNewPassword.focus();
                return false;
            }
            //------------------------------------------------------------------------------------------------------
            if (doc.txtNewPassword.value != doc.txtConfPassword.value) {
                alert("Your New Password And Confirm Password Are Not Same...");
                document.forms[0].txtNewPassword.focus()
                return false;
            }
            if (doc.txtOldPassword.value == doc.txtNewPassword.value) {
                alert("Old Password and New Password should not be Same...");
                document.forms[0].txtNewPassword.focus()
                return false;
            }

        }
        function ClearChangePassword() {
            document.all['txtOldPassword'].value = "";
            document.all['txtNewPassword'].value = "";
            document.all['txtConfPassword'].value = "";
            return true;
        }
    </script>

</head>
<body bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0" onload="resizePage();resizeObject(); initScreenSaver('1',<%=Session["AutoLogOutTime"]%>);">
    <form id="Form1"  runat="server" class="formbg">
    <asp:HiddenField ID="hdnRecordKeyId" runat="server" Value="0" />
    <asp:HiddenField ID="hdnUserPassword" runat="server" Value="0" />
    <asp:HiddenField ID="hdnNewUserPassword" runat="server" Value="0" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="formbg">
        <tr>
            <td valign="top" align="center">
                <table width="99%" cellpadding="1" cellspacing="0" class="tablefont">
                    <tr>
                        <td colspan="2" style="height: 5px">
                        </td>
                    </tr>
                    <tr>
                        <td class="pagetitle" colspan="2">
                            <b>Change Password</b>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="height: 15px">
                        </td>
                    </tr>
                    <tr>
                        <td width="15%">
                            User Name
                        </td>
                        <td>
                            <asp:Label ID="lblUserName" runat="server" Width="304px" Height="18px"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td width="15%">
                            Login Name
                        </td>
                        <td>
                            <asp:Label ID="lblLoginName" runat="server" Width="304px" Height="18px" ></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td width="15%">
                            Old Password*
                        </td>
                        <td>
                            <asp:TextBox ID="txtOldPassword" runat="server" MaxLength="15" Width="304px" TextMode="Password"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            New Password*
                        </td>
                        <td>
                            <asp:TextBox ID="txtNewPassword" runat="server" Width="304px" MaxLength="15" TextMode="Password"></asp:TextBox>
                            &nbsp;(min 8 Char, max 15 Char)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Confirm Password*
                        </td>
                        <td>
                            <asp:TextBox ID="txtConfPassword" runat="server" Width="304px" MaxLength="15" TextMode="Password"></asp:TextBox>
                            &nbsp;(min 8 Char, max 15 Char)
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <asp:Button ID="BtnSubmit" BorderWidth="0" class="submit" runat="server" Text="Change" OnClick="BtnSubmit_Click"  onmousemove="FocusButton(this.id);" onmouseout="LostFocusButton(this.id);" />
                        </td>
                        <td>
                            <asp:Button ID="btnReset" BorderWidth="0" class="submit" runat="server" Text="Reset" OnClick="btnReset_Click"  onmousemove="FocusButton(this.id);" onmouseout="LostFocusButton(this.id);" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
