<%@ control language="VB" autoeventwireup="false" inherits="RCC_Exchange_CC_MobilePolicy, MachSol.MachPanel.Web" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>
<%@ Register Src="~/Template/CC/Selectable_Selected_LBX.ascx" TagName="AddSelectableSelected" TagPrefix="EM" %>
<%@ Register Assembly="MachSol.MachPanel.Utility" Namespace="MachSol.MachPanel.Utility"
    TagPrefix="CC" %>

<div class="row">
    <div class="col-xs-12">
        <asp:GridView ID="GV_MobilePolicy" CssClass="table table-bordered table-striped table-hover" AllowSorting="true"
            AllowPaging="false" EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server"
            AutoGenerateColumns="False" DataKeyNames="PolicyId, Name">

            <Columns>
                <asp:TemplateField HeaderText="<%$ Resources:Content,GN000170 %>" HeaderStyle-CssClass="col-xs-4" ItemStyle-CssClass="col-xs-4">
                    <ItemTemplate>
                        <asp:Literal ID="ListLtrl_Name" runat="server" Text='<%#Eval("Name")%>'></asp:Literal>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Content,MPo002 %>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                    <ItemTemplate>
                        <asp:Literal ID="ListLtrl_RequirePassword" runat="server" Text='<%#Eval("PasswordEnabled")%>'></asp:Literal>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Content,MPo003 %>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                    <ItemTemplate>
                        <asp:Literal ID="ListLtrl_SimplePassword" runat="server" Text='<%#Eval("AllowSimplePassword")%>'></asp:Literal>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Content,MPo007 %>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                    <ItemTemplate>
                        <asp:Literal ID="ListLtrl_RequireDeviceEncryption" runat="server" Text='<%#Eval("RequireDeviceEncryption")%>'></asp:Literal>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Content, GN0000360 %>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                    <ItemTemplate>
                        <asp:LinkButton ID="LB_Edit" class="btn btn-primary waves-effect" CommandName="Details"
                            CommandArgument='<%# Eval("PolicyId") %>' runat="server" Text="<%$ Resources:Content,GN0000276%>" />
                        <asp:LinkButton class="btn btn-primary waves-effect btnAction" CommandArgument='<%# Eval("PolicyId") %>'
                            ID="LB_Remove" CommandName="RemovePolicy" runat="server" Text="<%$ Resources:Content,GN0000278%>" />
                        <EM:ConfirmButtonExtender ID="CBE_Remove" ConfirmText="<%$ Resources:Content,GN000200%>"
                            TargetControlID="LB_Remove" runat="server">
                        </EM:ConfirmButtonExtender>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <%--PagerTemplate Start
    <PagerTemplate>
        <EM:Pager ID="Pager1" runat="server" />
    </PagerTemplate>
   PagerTemplate End--%>
        </asp:GridView>
    </div>
    <div class="col-xs-12">
        <asp:Panel ID="Panel5" runat="server" DefaultButton="Btn_Save">
            <div class="card">
                <div class="header">
                    <h3>
                        <asp:Literal ID="Ltrl_Policy" runat="server" Text="<%$ Resources:Content,MPo014 %>"></asp:Literal>
                    </h3>
                </div>
                <div class="body">
                    <div class="row">
                        <div class="col-sm-3 col-xs-12 row-label">
                            <label>
                                *<asp:Literal ID="Ltl_Name" runat="server" Text='<%$ Resources:Content, GN000170 %>'></asp:Literal>:</label>
                        </div>
                        <div class="col-sm-5 col-xs-12">
                            <div class="input-group">
                                <span class="input-group-addon">
                                    <asp:Literal ID="Ltl_OrgName" runat="server" Text=""></asp:Literal>
                                </span>
                                <div class="form-line">
                                    <asp:TextBox ID="TxBx_Name" runat="server" MaxLength="100"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator16" runat="server" ControlToValidate="TxBx_Name"
                                        Display="None" SetFocusOnError="True" ValidationGroup="Policy"></asp:RequiredFieldValidator>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-3 col-xs-12 row-label">
                            <label>
                                <asp:Literal ID="Literal13" runat="server" Text='<%$ Resources:Content, MPo001 %>'></asp:Literal>:</label>
                        </div>
                        <div class="col-sm-4 col-xs-12">
                            <div class="form-group">
                                <asp:CheckBox ID="CB_AllowNonProvisionableDevices" runat="server" Text=" "></asp:CheckBox>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-3 col-xs-12 row-label">
                            <label>
                                <asp:Literal ID="Literal15" runat="server" Text='<%$ Resources:Content, MPo002 %>'></asp:Literal>:</label>
                        </div>
                        <div class="col-sm-4 col-xs-12">
                            <div class="form-group">
                                <asp:CheckBox ID="CB_PasswordEnabled" runat="server" Text=" "></asp:CheckBox>
                            </div>
                        </div>
                    </div>
                    <div id="Tbl_Password" runat="server">
                        <div class="row">
                            <div class="col-sm-3 col-xs-12 row-label">
                                <label>
                                    <asp:Literal ID="Literal17" runat="server" Text='<%$ Resources:Content, MPo003 %>'></asp:Literal>:</label>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <asp:CheckBox ID="CB_AllowSimplePassword" runat="server" Text=" "></asp:CheckBox>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-xs-12 row-label">
                                <label>
                                    <asp:Literal ID="Literal1" runat="server" Text='<%$ Resources:Content, MPo004 %>'></asp:Literal>:</label>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <asp:CheckBox ID="CB_AlphanumericPasswordRequired" runat="server" Text=" "></asp:CheckBox>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-xs-12 row-label">
                                <label>
                                    <asp:Literal ID="Literal2" runat="server" Text='<%$ Resources:Content, MPo005 %>'></asp:Literal>:</label>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <asp:DropDownList ID="DDL_MinPasswordComplexCharacters" runat="server">
                                        <asp:ListItem Text="<%$ Resources:Content,GN00001032%>" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="<%$ Resources:Content,GN00001033%>" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="<%$ Resources:Content,GN00001034%>" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="<%$ Resources:Content,GN00001035%>" Value="4"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-sm-5 col-xs-12">
                                <asp:Literal ID="Literal6" runat="server" Text='<%$ Resources:Content, MPo006 %>'></asp:Literal>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-xs-12 row-label">
                                <label>
                                    <asp:Literal ID="Literal14" runat="server" Text='<%$ Resources:Content, MPo007 %>'></asp:Literal>:</label>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <asp:CheckBox ID="CB_RequireDeviceEncryption" runat="server" Text=" "></asp:CheckBox>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-xs-12 row-label">
                                <label>
                                    <asp:Literal ID="Literal16" runat="server" Text='<%$ Resources:Content, MPo008 %>'></asp:Literal>:</label>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_MinPasswordLength" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RFV_TxBx_MinPasswordLength" runat="server" ControlToValidate="TxBx_MinPasswordLength"
                                            Display="None" SetFocusOnError="True" ValidationGroup="Policy"></asp:RequiredFieldValidator>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-5 col-xs-12">
                                <asp:CheckBox ID="CB_MinPasswordLength" runat="server" Text=" "></asp:CheckBox>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-xs-12 row-label">
                                <label>
                                    <asp:Literal ID="Literal18" runat="server" Text='<%$ Resources:Content, MPo009 %>'></asp:Literal>:</label>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_MaxPasswordFailedAttempts" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RFV_TxBx_MaxPasswordFailedAttempts" runat="server" ControlToValidate="TxBx_MaxPasswordFailedAttempts"
                                            Display="None" SetFocusOnError="True" ValidationGroup="Policy"></asp:RequiredFieldValidator>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-5 col-xs-12">
                                <asp:CheckBox ID="CB_MaxPasswordFailedAttempts" runat="server" Text=" "></asp:CheckBox>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-xs-12 row-label">
                                <label>
                                    <asp:Literal ID="Literal19" runat="server" Text='<%$ Resources:Content, MPo010 %>'></asp:Literal>:</label>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_MaxInactivityTimeLock" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RFV_TxBx_MaxInactivityTimeLock" runat="server" ControlToValidate="TxBx_MaxInactivityTimeLock"
                                            Display="None" SetFocusOnError="True" ValidationGroup="Policy"></asp:RequiredFieldValidator>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-5 col-xs-12">
                                <asp:CheckBox ID="CB_MaxInactivityTimeLock" runat="server" Text=" "></asp:CheckBox>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-xs-12 row-label">
                                <label>
                                    <asp:Literal ID="Literal20" runat="server" Text='<%$ Resources:Content, MPo011 %>'></asp:Literal>:</label>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_PasswordExpiration" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RFV_TxBx_PasswordExpiration" runat="server" ControlToValidate="TxBx_PasswordExpiration"
                                            Display="None" SetFocusOnError="True" ValidationGroup="Policy"></asp:RequiredFieldValidator>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-5 col-xs-12">
                                <asp:CheckBox ID="CB_PasswordExpiration" runat="server" Text=" "></asp:CheckBox>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-xs-12 row-label">
                                <label>
                                    <asp:Literal ID="Literal21" runat="server" Text='<%$ Resources:Content, MPo012 %>'></asp:Literal>:</label>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_PasswordHistory" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RFV_TxBx_PasswordHistory" runat="server" ControlToValidate="TxBx_PasswordHistory"
                                            Display="None" SetFocusOnError="True" ValidationGroup="Policy"></asp:RequiredFieldValidator>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-12 row-label">
                            <label>
                                <asp:Literal ID="td_UpGradeHeading" runat="server" Text='<%$ Resources:Content, DGN1110406 %>'></asp:Literal>:</label>
                        </div>
                        <div class="col-xs-12">
                            <EM:AddSelectableSelected ID="UCMbileDevices" runat="server" />
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-12">
                            <asp:ValidationSummary ID="ValidationSummary4" runat="server" ShowMessageBox="true"
                                ShowSummary="false" ValidationGroup="Policy" HeaderText="<%$ Resources:Content,EM000001%>" />
                            <asp:Button ID="Btn_Save" runat="server" Text="<%$ Resources:Content,GN0000281%>"
                                class="btn btn-primary waves-effect btnAction" ValidationGroup="Policy" CausesValidation="true" />
                            <asp:Button ID="Btn_Cancel" Visible="false" runat="server" Text="<%$ Resources:Content,GN0000572%>"
                                class="btn btn-primary waves-effect" CausesValidation="false" />

                            <asp:Button ID="Btn_PostBack" runat="server" Text="" CausesValidation="false" CssClass="hide" />
                        </div>
                    </div>
                </div>
            </div>
        </asp:Panel>
    </div>
</div>
<CC:UpdatePanelInlineScriptControl ID="UpdatePanelInlineScriptControl1" runat="server">
    <script type="text/javascript">

        $(document).ready(function () {

            if ($('#<%=CB_PasswordEnabled.ClientID%>').is(":checked")) {

            $('#<%=Tbl_Password.ClientID%>').show();

        }
        else {

            $('#<%=Tbl_Password.ClientID%>').hide();

        };

        $('#<%=CB_PasswordEnabled.ClientID%>').change(function () {

            if ($('#<%=CB_PasswordEnabled.ClientID%>').is(":checked")) {

                $('#<%=Tbl_Password.ClientID%>').show();

                ValidatorEnable(document.getElementById('<%=RFV_TxBx_PasswordHistory.ClientID%>'), true);

                $('#<%=CB_AllowSimplePassword.ClientID%>').attr("checked", false);
                $('#<%=CB_RequireDeviceEncryption.ClientID%>').attr("checked", false);
                $('#<%=CB_AlphanumericPasswordRequired.ClientID%>').attr("checked", false);
                $('#<%=CB_MinPasswordLength.ClientID%>').attr("checked", false);
                $('#<%=CB_MaxPasswordFailedAttempts.ClientID%>').attr("checked", false);
                $('#<%=CB_MaxInactivityTimeLock.ClientID%>').attr("checked", false);
                $('#<%=CB_PasswordExpiration.ClientID%>').attr("checked", false);
            }
            else {

                $('#<%=Tbl_Password.ClientID%>').hide();

                ValidatorEnable(document.getElementById('<%=RFV_TxBx_PasswordHistory.ClientID%>'), false);

                $('#<%=CB_AllowSimplePassword.ClientID%>').attr("checked", false);
                $('#<%=CB_RequireDeviceEncryption.ClientID%>').attr("checked", false);
                $('#<%=CB_AlphanumericPasswordRequired.ClientID%>').attr("checked", false);
                $('#<%=CB_MinPasswordLength.ClientID%>').attr("checked", false);
                $('#<%=CB_MaxPasswordFailedAttempts.ClientID%>').attr("checked", false);
                $('#<%=CB_MaxInactivityTimeLock.ClientID%>').attr("checked", false);
                $('#<%=CB_PasswordExpiration.ClientID%>').attr("checked", false);

            }

        });



        $('#<%=CB_AlphanumericPasswordRequired.ClientID%>').change(function () {

            $('#<%=Btn_PostBack.ClientID%>').trigger("click");

        });




        if ($('#<%=CB_MinPasswordLength.ClientID%>').is(":checked")) {

            $('#<%=TxBx_MinPasswordLength.ClientID%>').removeAttr("disabled");
            ValidatorEnable(document.getElementById('<%=RFV_TxBx_MinPasswordLength.ClientID%>'), true);

        }
        else {
            $('#<%=TxBx_MinPasswordLength.ClientID%>').attr("disabled", true);
            $('#<%=TxBx_MinPasswordLength.ClientID%>').val("");
            ValidatorEnable(document.getElementById('<%=RFV_TxBx_MinPasswordLength.ClientID%>'), false);
        };

        $('#<%=CB_MinPasswordLength.ClientID%>').change(function () {

            if ($('#<%=CB_MinPasswordLength.ClientID%>').is(":checked")) {

                $('#<%=TxBx_MinPasswordLength.ClientID%>').removeAttr("disabled");
                ValidatorEnable(document.getElementById('<%=RFV_TxBx_MinPasswordLength.ClientID%>'), true);
            }
            else {
                $('#<%=TxBx_MinPasswordLength.ClientID%>').attr("disabled", true);
                $('#<%=TxBx_MinPasswordLength.ClientID%>').val("");
                ValidatorEnable(document.getElementById('<%=RFV_TxBx_MinPasswordLength.ClientID%>'), false);

            }

        });

        if ($('#<%=CB_MaxPasswordFailedAttempts.ClientID%>').is(":checked")) {

            $('#<%=TxBx_MaxPasswordFailedAttempts.ClientID%>').removeAttr("disabled");
            ValidatorEnable(document.getElementById('<%=RFV_TxBx_MaxPasswordFailedAttempts.ClientID%>'), true);

        }
        else {
            $('#<%=TxBx_MaxPasswordFailedAttempts.ClientID%>').attr("disabled", true);
            $('#<%=TxBx_MaxPasswordFailedAttempts.ClientID%>').val("");
            ValidatorEnable(document.getElementById('<%=RFV_TxBx_MaxPasswordFailedAttempts.ClientID%>'), false);
        };

        $('#<%=CB_MaxPasswordFailedAttempts.ClientID%>').change(function () {

            if ($('#<%=CB_MaxPasswordFailedAttempts.ClientID%>').is(":checked")) {

                $('#<%=TxBx_MaxPasswordFailedAttempts.ClientID%>').removeAttr("disabled");
                ValidatorEnable(document.getElementById('<%=RFV_TxBx_MaxPasswordFailedAttempts.ClientID%>'), true);

            }
            else {
                $('#<%=TxBx_MaxPasswordFailedAttempts.ClientID%>').attr("disabled", true);
                $('#<%=TxBx_MaxPasswordFailedAttempts.ClientID%>').val("");
                ValidatorEnable(document.getElementById('<%=RFV_TxBx_MaxPasswordFailedAttempts.ClientID%>'), false);
            }

        });


        if ($('#<%=CB_MaxInactivityTimeLock.ClientID%>').is(":checked")) {

            $('#<%=TxBx_MaxInactivityTimeLock.ClientID%>').removeAttr("disabled");
            ValidatorEnable(document.getElementById('<%=RFV_TxBx_MaxInactivityTimeLock.ClientID%>'), true);
        }
        else {
            $('#<%=TxBx_MaxInactivityTimeLock.ClientID%>').attr("disabled", true);
            $('#<%=TxBx_MaxInactivityTimeLock.ClientID%>').val("");
            ValidatorEnable(document.getElementById('<%=RFV_TxBx_MaxInactivityTimeLock.ClientID%>'), false);
        };

        $('#<%=CB_MaxInactivityTimeLock.ClientID%>').change(function () {

            if ($('#<%=CB_MaxInactivityTimeLock.ClientID%>').is(":checked")) {

                $('#<%=TxBx_MaxInactivityTimeLock.ClientID%>').removeAttr("disabled");
                ValidatorEnable(document.getElementById('<%=RFV_TxBx_MaxInactivityTimeLock.ClientID%>'), true);
            }
            else {
                $('#<%=TxBx_MaxInactivityTimeLock.ClientID%>').attr("disabled", true);
                $('#<%=TxBx_MaxInactivityTimeLock.ClientID%>').val("");
                ValidatorEnable(document.getElementById('<%=RFV_TxBx_MaxInactivityTimeLock.ClientID%>'), false);
            }

        });



        if ($('#<%=CB_PasswordExpiration.ClientID%>').is(":checked")) {

            $('#<%=TxBx_PasswordExpiration.ClientID%>').removeAttr("disabled");
            ValidatorEnable(document.getElementById('<%=RFV_TxBx_PasswordExpiration.ClientID%>'), true);
        }
        else {
            $('#<%=TxBx_PasswordExpiration.ClientID%>').attr("disabled", true);
            $('#<%=TxBx_PasswordExpiration.ClientID%>').val("");
            ValidatorEnable(document.getElementById('<%=RFV_TxBx_PasswordExpiration.ClientID%>'), false);
        };

        $('#<%=CB_PasswordExpiration.ClientID%>').change(function () {

            if ($('#<%=CB_PasswordExpiration.ClientID%>').is(":checked")) {

                $('#<%=TxBx_PasswordExpiration.ClientID%>').removeAttr("disabled");
                ValidatorEnable(document.getElementById('<%=RFV_TxBx_PasswordExpiration.ClientID%>'), true);

            }
            else {
                $('#<%=TxBx_PasswordExpiration.ClientID%>').attr("disabled", true);
                $('#<%=TxBx_PasswordExpiration.ClientID%>').val("");
                ValidatorEnable(document.getElementById('<%=RFV_TxBx_PasswordExpiration.ClientID%>'), false);
            }

        });





        $("#<%=TxBx_MinPasswordLength.ClientID%>").blur(function () {

            var Val = $('#<%=TxBx_MinPasswordLength.ClientID%>').val();

            var number = parseInt(Val);
            if (!number) {
                Val = '1';
            }
            else if (number < 0) {
                Val = '1';
            }
            else if (number > 16) {
                Val = '16';
            }
            else {
                Val = NumberRounding(number, '0');
            }

            $('#<%=TxBx_MinPasswordLength.ClientID%>').val(Val);

        });

        $("#<%=TxBx_MaxInactivityTimeLock.ClientID%>").blur(function () {

            var Val = $('#<%=TxBx_MaxInactivityTimeLock.ClientID%>').val();

            var number = parseInt(Val);
            if (!number) {
                Val = '1';
            }
            else if (number < 0) {
                Val = '1';
            }
            else if (number > 60) {
                Val = '60';
            }
            else {
                Val = NumberRounding(number, '0');
            }

            $('#<%=TxBx_MaxInactivityTimeLock.ClientID%>').val(Val);

        });

        $("#<%=TxBx_MaxPasswordFailedAttempts.ClientID%>").blur(function () {

            var Val = $('#<%=TxBx_MaxPasswordFailedAttempts.ClientID%>').val();

            var number = parseInt(Val);
            if (!number) {
                Val = '4';
            }
            else if (number < 4) {
                Val = '4';
            }
            else if (number > 16) {
                Val = '16';
            }
            else {
                Val = NumberRounding(number, '0');
            }

            $('#<%=TxBx_MaxPasswordFailedAttempts.ClientID%>').val(Val);

        });

        $("#<%=TxBx_PasswordExpiration.ClientID%>").blur(function () {

            var Val = $('#<%=TxBx_PasswordExpiration.ClientID%>').val();

            var number = parseInt(Val);
            if (!number) {
                Val = '1';
            }
            else if (number < 1) {
                Val = '1';
            }
            else if (number > 730) {
                Val = '730';
            }
            else {
                Val = NumberRounding(number, '0');
            }

            $('#<%=TxBx_PasswordExpiration.ClientID%>').val(Val);

        });

        $("#<%=TxBx_PasswordHistory.ClientID%>").blur(function () {

            var Val = $('#<%=TxBx_PasswordHistory.ClientID%>').val();

            var number = parseInt(Val);
            if (!number) {
                Val = '0';
            }
            else if (number < 0) {
                Val = '0';
            }
            else if (number > 50) {
                Val = '50';
            }
            else {
                Val = NumberRounding(number, '0');
            }

            $('#<%=TxBx_PasswordHistory.ClientID%>').val(Val);

        });

    });
    </script>
</CC:UpdatePanelInlineScriptControl>
