<%@ page language="C#" masterpagefile="~/MasterPage.master" autoeventwireup="true" inherits="Personnel_PersonnelInsertUpdate, CardAccess.Web.UI_deploy" title="New Personnel" theme="Office2007Black" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="upEditorToolbar" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:LinkButton ID="lnkSave" runat="server" CssClass="button-custom" OnClick="lnkSave_OnClick"
                OnClientClick="return clientClickOnSave();"><img alt="" src="../../TabImages/saveHS.png" /><span><%=Save%></span></asp:LinkButton>
            <asp:LinkButton ID="lnkCancel" runat="server" CssClass="button-custom" OnClick="lnkCancel_OnClick"
                OnClientClick="return clientClickOnCancel();"><img alt="" src="../../TabImages/Edit_UndoHS.png" /><span><%=Cancel%></span></asp:LinkButton>
            <asp:LinkButton ID="lnkBack" runat="server" CssClass="button-custom" OnClientClick="return clientClickOnBack();"><img alt="" src="../../TabImages/GoToPrevious.png" /><span><%=Back%></span></asp:LinkButton>
            <%--<AEL:ConfigurationEditorToolBar ID="editorToolbar" runat="server" ClientSideEvent_Click="CheckAction" OnCancel="editorToolbar_OnCancel" OnSave="editorToolbar_OnSave" />--%>
        </ContentTemplate>
    </asp:UpdatePanel>
    <table width="100%">
        <tr valign="top" style="width: 100%">
            <td style="width: 100%; height: 340px;">
                <asp:UpdatePanel ID="asyncPanel" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:HiddenField ID="timeZonesForPanelReaders" runat="server" />
                        <asp:HiddenField ID="hfBadgeType" runat="server" Value="0" />
                        <asp:HiddenField ID="hfMessage" runat="server" />
                        <ig:WebTab ID="UltraWebTab1" runat="server" SelectedTab="0" Style="width: 100% !important;
                            min-width: 100% !important;" SelectedIndex="0">
                            <PostBackOptions />
                            <Tabs>
                                <ig:ContentTabItem Text="General" Key="tpGeneral">
                                    <Template>
                                        <table style="height: 390px">
                                            <tr id="PIVTab" runat="server" visible="false">
                                                <td colspan="2">
                                                    <asp:RadioButton ID="btnStd" runat="server" Text="Std" Width="100px" Checked="true"
                                                        GroupName="BadgeType" onchange="btnStd_Click()" />
                                                    <asp:RadioButton ID="btnPiv" runat="server" Text="PIV" Width="100px" GroupName="BadgeType"
                                                        onchange="btnPiv_Click()" />
                                                    <asp:RadioButton ID="btnPivi" runat="server" Text="PIV-I" Width="100px" GroupName="BadgeType"
                                                        onchange="btnPivI_Click()" />
                                                </td>
                                            </tr>
                                            <tr id="PIVIRow" runat="server" style="display: none;">
                                                <td style="width: 110px;">
                                                    <asp:Label ID="lblPIVIData" runat="server" Text="PIV-I Data"></asp:Label>
                                                </td>
                                                <td colspan="3">
                                                    <ig:WebTextEditor ID="txtPIVIData" Width="400px" runat="server" MaxLength="32" Text="0">
                                                        <ClientEvents KeyPress="txtPIVIData_KeyPress" />
                                                        <ClientEvents ValueChanged="chkBadgeExists" />
                                                    </ig:WebTextEditor>
                                                </td>
                                            </tr>
                                            <tr id="BadgeRow" runat="server">
                                                <td style="width: 100px;">
                                                    <asp:Label ID="lblBadgeNumber" runat="server" Text="Badge Number"></asp:Label>
                                                </td>
                                                <td>
                                                    <ig:WebTextEditor ID="txtBadgeNumber" Width="175px" runat="server" MaxLength="19">
                                                        <ClientEvents ValueChanged="chkBadgeExists" />
                                                        <ClientEvents KeyPress="txtBadgeNumber_KeyPress" TextChanged="txtBadgeNumber_TextChanged" />
                                                    </ig:WebTextEditor>
                                                    &nbsp;&nbsp;
                                                    <asp:LinkButton ID="btnNewMobileCredential" runat="server" Text="New Mobile Credential"
                                                        OnClick="btnNewMobileCredential_Click"></asp:LinkButton>
                                                    <%--<asp:ImageButton ID="btnNewMobileCredential1" runat="server" Width="20px" ImageAlign="Top"
                                                        ImageUrl="~/Images/phone1.png" OnClick="btnNewMobileCredential_Click" 
                                                        ToolTip="Create New Mobile Credential" />--%>
                                                </td>
                                            </tr>
                                            <tr id="FacBadgeRow" runat="server">
                                                <td colspan="2">
                                                    <igmisc:WebGroupBox ID="gboFacBadge" runat="server" BackColor="Transparent">
                                                        <Template>
                                                            <asp:Label ID="lblFacBadge" runat="server" Text="Facility Code/Badge No:"></asp:Label>
                                                            &nbsp;&nbsp;
                                                            <ig:WebNumericEditor ID="txtFacBadgeFacility" runat="server" Width="48px">
                                                                <ClientEvents KeyPress="txtFacBadgeFacility_KeyPress" />
                                                            </ig:WebNumericEditor>
                                                            &nbsp;
                                                            <ig:WebNumericEditor ID="txtFacBadgeBadge" runat="server">
                                                                <ClientEvents KeyPress="txtFacBadgeBadge_KeyPress" />
                                                            </ig:WebNumericEditor>
                                                        </Template>
                                                    </igmisc:WebGroupBox>
                                                </td>
                                            </tr>
                                            <tr valign="Top">
                                                <td colspan="2">
                                                    <table border="0" cellpadding="1" cellspacing="1" width="600px">
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblFirstName" runat="server" Text="First Name"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebTextEditor ID="txtFirstName" Width="175px" runat="server" />
                                                            </td>
                                                            <td>
                                                                <asp:Label ID="lblLastName" runat="server" Text="Last Name"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebTextEditor ID="txtLastName" Width="175px" runat="server" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblMiddleName" runat="server" Text="Middle Name"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebTextEditor ID="txtMiddleName" Width="175px" runat="server">
                                                                    <ClientEvents Initialize="txtMiddleName_Initialize" TextChanged="txtMiddleName_TextChanged" />
                                                                </ig:WebTextEditor>
                                                            </td>
                                                            <td>
                                                                <asp:Label ID="lblHolidayCalendar" runat="server" Text="Holiday Calendar"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebDropDown ID="cboHolidayCalendar" runat="server" Visible="true" DisplayMode="DropDownList"
                                                                    Width="177px">
                                                                </ig:WebDropDown>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblBadgeUseLimit" runat="server" Text="Badge Use Limit"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebNumericEditor ID="seBadgeUseLimit" Width="177px" runat="server">
                                                                    <Buttons SpinButtonsDisplay="OnRight" CustomButtonDisplay="None">
                                                                    </Buttons>
                                                                </ig:WebNumericEditor>
                                                            </td>
                                                            <td>
                                                                <asp:Label ID="lblAccessTime" runat="server" Text="Access Time"></asp:Label>
                                                            </td>
                                                            <td colspan="3">
                                                                <ig:WebNumericEditor ID="seAccessTime" Width="177px" runat="server">
                                                                    <Buttons SpinButtonsDisplay="OnRight" CustomButtonDisplay="None">
                                                                    </Buttons>
                                                                </ig:WebNumericEditor>
                                                            </td>
                                                        </tr>
                                                        <tr id="PersonRow" runat="server">
                                                            <td>
                                                                <asp:Label runat="server" ID="lblPersonId" Text="Person Id" />
                                                            </td>
                                                            <td>
                                                                <ig:WebTextEditor ID="txtPersonId" Width="175px" MaxLength="10" runat="server" Text="0">
                                                                    <ClientEvents KeyPress="txtPINCode_KeyPress" />
                                                                </ig:WebTextEditor>
                                                            </td>
                                                            <td>
                                                                <asp:Label runat="server" ID="lblPersOrg" Text="Pers/Org" />
                                                            </td>
                                                            <td>
                                                                <ig:WebDropDown ID="cmbPersOrg" runat="server" Visible="true" DisplayMode="DropDownList"
                                                                    EnableDropDownAsChild="false" Width="120px">
                                                                </ig:WebDropDown>
                                                            </td>
                                                        </tr>
                                                        <tr id="OrgRow" runat="server">
                                                            <td>
                                                                <asp:Label runat="server" ID="lblOrgCategory" Text="Org. Category" />
                                                            </td>
                                                            <td>
                                                                <ig:WebDropDown ID="cmbOrgCategory" runat="server" Visible="true" DisplayMode="DropDownList"
                                                                    EnableDropDownAsChild="false" Width="178px">
                                                                </ig:WebDropDown>
                                                            </td>
                                                            <td>
                                                                <asp:Label runat="server" ID="lblOrdId" Text="Org. Id" />
                                                            </td>
                                                            <td>
                                                                <ig:WebTextEditor ID="txtOrgId" MaxLength="4" Width="175px" runat="server">
                                                                    <ClientEvents KeyPress="txtPINCode_KeyPress" />
                                                                </ig:WebTextEditor>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblActivationDate" runat="server" Text="Activation Date"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebDatePicker ID="deActivationDate" runat="server" Width="177px" EditModeFormat="MM/dd/yyyy hh tt"
                                                                    DropDownCalendarID="ActivationDateCalendarView">
                                                                    <ClientSideEvents ValueChanged="listenerOfDateChanged" CalendarClosed="WebDatePicker_CalendarClosed" />
                                                                </ig:WebDatePicker>
                                                                <ig:WebMonthCalendar runat="server" ID="ActivationDateCalendarView" EnableWeekNumbers="true"
                                                                    ChangeMonthToDateClicked="true" EnableMonthDropDown="True" EnableYearDropDown="True">
                                                                </ig:WebMonthCalendar>
                                                            </td>
                                                            <td>
                                                                <asp:Label ID="lblExpirationDate" runat="server" Text="Expiration Date"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebDatePicker ID="deExpirationDate" runat="server" Width="177px" EditModeFormat="MM/dd/yyyy hh tt"
                                                                    DropDownCalendarID="ExpirationDateCalendarView">
                                                                    <ClientSideEvents ValueChanged="listenerOfExpirationDateChanged" CalendarClosed="WebDatePicker_CalendarClosed" />
                                                                </ig:WebDatePicker>
                                                                <ig:WebMonthCalendar runat="server" ID="ExpirationDateCalendarView" EnableWeekNumbers="true"
                                                                    ChangeMonthToDateClicked="true" EnableMonthDropDown="True" EnableYearDropDown="True">
                                                                </ig:WebMonthCalendar>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblPartitionGroup" Text="Partition Group" runat="server"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebDropDown ID="cboPartitionGroup" runat="server" DisplayMode="DropDownList"
                                                                    Width="180px" EnableDropDownAsChild="false" EnableMultipleSelection="True" MultiSelectValueDelimiter=" | ">
                                                                    <ClientEvents />
                                                                </ig:WebDropDown>
                                                            </td>
                                                        </tr>
                                                        <tr id="FacilityRow" runat="server">
                                                            <td style="width: 100px;">
                                                                <asp:Label ID="lblFacility" runat="server" Text="Facility No"></asp:Label>
                                                            </td>
                                                            <td style="width: 220px;">
                                                                <ig:WebNumericEditor ID="seFacility" Width="177px" runat="server">
                                                                    <Buttons SpinButtonsDisplay="OnRight" CustomButtonDisplay="None">
                                                                    </Buttons>
                                                                    <ClientEvents ValueChanged="chkBadgeExists" />
                                                                </ig:WebNumericEditor>
                                                            </td>
                                                        </tr>
                                                        <tr id="SiteNoRow" runat="server">
                                                            <td style="width: 100px;">
                                                                <asp:Label ID="lblSiteNo" runat="server" Text="Site No:"></asp:Label>
                                                            </td>
                                                            <td style="width: 220px;">
                                                                <ig:WebTextEditor ID="txtSiteNo" MaxLength="4" Width="175px" runat="server" Text="0">
                                                                    <ClientEvents KeyPress="txtPINCode_KeyPress" />
                                                                </ig:WebTextEditor>
                                                            </td>
                                                            <td>
                                                                <asp:Label ID="lblAgencyCell" runat="server" Text="Agency Code" />
                                                            </td>
                                                            <td>
                                                                <ig:WebTextEditor ID="txtAgencyCode" MaxLength="4" Width="175px" runat="server" Text="0">
                                                                    <ClientEvents KeyPress="txtPINCode_KeyPress" />
                                                                </ig:WebTextEditor>
                                                            </td>
                                                        </tr>
                                                        <tr id="ReIssueRow" runat="server">
                                                            <td>
                                                                <asp:Label ID="lblReIssue" runat="server" Text="Re-Issue"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebNumericEditor ID="seReIssue" Width="177px" runat="server">
                                                                    <Buttons SpinButtonsDisplay="OnRight" CustomButtonDisplay="None">
                                                                    </Buttons>
                                                                </ig:WebNumericEditor>
                                                            </td>
                                                        </tr>
                                                        <tr id="CredSeriesRow" runat="server">
                                                            <td>
                                                                <asp:Label runat="server" ID="lblCrdSeries" Text="Credential Series" />
                                                            </td>
                                                            <td>
                                                                <ig:WebNumericEditor ID="txtCrdSeries" MaxLength="9" Width="175px" runat="server">
                                                                    <Buttons SpinButtonsDisplay="OnRight" CustomButtonDisplay="None">
                                                                    </Buttons>
                                                                </ig:WebNumericEditor>
                                                            </td>
                                                        </tr>
                                                        <tr id="EmbrossRowId" runat="server">
                                                            <td>
                                                                <asp:Label ID="lblEmbossedID" runat="server" Text="Embossed ID"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebTextEditor ID="txtEmbossedID" Width="175px" runat="server">
                                                                    <ClientEvents KeyPress="txtPINCode_KeyPress" />
                                                                </ig:WebTextEditor>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblPINCode" runat="server" Text="PIN Code"></asp:Label>
                                                            </td>
                                                            <td colspan="3">
                                                                <ig:WebTextEditor ID="txtPINCode" Width="175px" runat="server" Text="11">
                                                                    <ClientEvents Initialize="txtPINCode_Initialize" KeyPress="txtPINCode_KeyPress" TextChanged="txtPINCode_TextChanged" />
                                                                </ig:WebTextEditor>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="4">
                                                                <div runat="server" id="reTypePinRow">
                                                                    <asp:Label ID="lblrePINCode" Width="100px" runat="server" Text="Re-Type PIN Code"></asp:Label>
                                                                    <ig:WebTextEditor ID="txtrePINCode" Width="175px" runat="server">
                                                                        <ClientEvents Initialize="txtrePINCode_Initialize" KeyPress="txtPINCode_KeyPress"
                                                                            TextChanged="txtrePINCode_TextChanged" />
                                                                    </ig:WebTextEditor>
                                                                    &nbsp;&nbsp;
                                                                    <asp:Label ID="lblRePinCodeWarning" runat="server" Text="" ForeColor="Red"></asp:Label>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblNAPCOPermissions" runat="server" Text="NAPCO Permissions"></asp:Label>
                                                            </td>
                                                            <td colspan="3">
                                                                <ig:WebDropDown ID="cboNAPCOPermissions" runat="server" Visible="true" DisplayMode="DropDown"
                                                                    Width="178px" EnableDropDownAsChild="false">
                                                                </ig:WebDropDown>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                                <td>
                                                    <table border="0" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td>
                                                                <asp:CheckBox ID="chkEnabled" runat="server" Text="Enabled" onChange="checkedChanged();" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:CheckBox ID="chkStayonPanel" runat="server" Text="Stay on Panel" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:CheckBox ID="chkTracked" runat="server" Text="Tracked" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:CheckBox ID="chkInitialDownload" runat="server" Text="Initial Download" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:CheckBox ID="chkEscorted" runat="server" Text="Escorted" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:CheckBox ID="chkVehicleTag" runat="server" Text="Vehicle Tag" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:CheckBox ID="chkFirstInControl" runat="server" Text="First In Control" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:CheckBox ID="chkSupervisor" runat="server" Text="Supervisor" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:CheckBox ID="chkExcludeFromPrivacyMode" runat="server" Text="Exclude From Privacy Mode" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <igmisc:WebGroupBox ID="gboLastValidAccess" runat="server" Text="Last Valid Access"
                                                                    BackColor="Transparent">
                                                                    <Template>
                                                                        <table>
                                                                            <tr>
                                                                                <td>
                                                                                    <asp:Label ID="lblTimeFormat" runat="server" Text="Current Time Format"></asp:Label>
                                                                                </td>
                                                                                <td>
                                                                                    <ig:WebDropDown ID="cboTimeFormat" runat="server" Visible="true" Width="150px" DisplayMode="DropDownList"
                                                                                        EnableDropDownAsChild="false" DropDownContainerHeight="60px" AutoPostBack="true"
                                                                                        OnSelectionChanged="cboTimeFormat_SelectedRowChangedEventArgs">
                                                                                    </ig:WebDropDown>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    <asp:Label ID="lblAt" runat="server" Text="At"></asp:Label>
                                                                                </td>
                                                                                <td>
                                                                                    <ig:WebTextEditor ID="txtAt" runat="server" ReadOnly="true" Width="100%">
                                                                                    </ig:WebTextEditor>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    <asp:Label ID="lblOn" runat="server" Text="On"></asp:Label>
                                                                                </td>
                                                                                <td>
                                                                                    <ig:WebTextEditor ID="txtOn" runat="server" ReadOnly="true" Width="100%">
                                                                                    </ig:WebTextEditor>
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </Template>
                                                                </igmisc:WebGroupBox>
                                                                <asp:LinkButton ID="lnkSendMobileCredential" runat="server" Visible="false"></asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </Template>
                                </ig:ContentTabItem>
                                <ig:ContentTabItem Key="tpAccessGroups" Text="Access Groups">
                                    <Template>
                                        <asp:UpdatePanel ID="asyncAGD" runat="server" UpdateMode="Conditional">
                                            <ContentTemplate>
                                                <table width="100%" style="height: 350px">
                                                    <tr valign="top">
                                                        <td style="width: 750px">
                                                            <igmisc:WebGroupBox ID="gboAccessGroups" runat="server" Text="" BackColor="Transparent"
                                                                Height="100%">
                                                                <Template>
                                                                    <table width="100%" style="height: 90%;">
                                                                        <tr valign="top">
                                                                            <td style="padding-top: 5px;">
                                                                                <ig:WebDataGrid ID="grdAccessGroups" runat="server" Width="100%" DataKeyFields="caObjectID"
                                                                                    EnableDataViewState="true" EnableViewState="true" AutoGenerateColumns="true"
                                                                                    OnInitializeRow="grdAccessGroups_OnInitializeRow" OnRowUpdating="grdAccessGroups_OnRowUpdating">
                                                                                    <EditorProviders>
                                                                                        <ig:DropDownProvider ID="ddlAGroupNo" EditorControl-DisplayMode="DropDownList">
                                                                                            <EditorControl ID="EditorControlAGroupNo" runat="server" EnableDropDownAsChild="False"
                                                                                                DisplayMode="DropDownList" DropDownContainerMaxHeight="200px" OnSelectionChanged="cboAccessGroup_SelectedRowChanged">
                                                                                            </EditorControl>
                                                                                        </ig:DropDownProvider>
                                                                                        <ig:DatePickerProvider ID="dppAGroupActivationDate">
                                                                                            <EditorControl ID="EditorControlAGroupActivationDate" runat="server" DataMode="DateOrDBNull"
                                                                                                SpinOnlyOneField="false" DropDownCalendarID="AGroupActivationDateCalendarView">
                                                                                                <ClientSideEvents CalendarClosed="WebDatePicker_CalendarClosed" />
                                                                                            </EditorControl>
                                                                                        </ig:DatePickerProvider>
                                                                                        <ig:DatePickerProvider ID="dppAGroupExpirationDate">
                                                                                            <EditorControl ID="EditorControlAGroupExpirationDate" runat="server" DataMode="DateOrDBNull"
                                                                                                DropDownCalendarID="AGroupExpirationDateCalendarView">
                                                                                                <ClientSideEvents CalendarClosed="WebDatePicker_CalendarClosed" />
                                                                                            </EditorControl>
                                                                                        </ig:DatePickerProvider>
                                                                                    </EditorProviders>
                                                                                    <Columns>
                                                                                        <ig:BoundDataField DataFieldName="AGSeq" Key="AGSeq">
                                                                                        </ig:BoundDataField>
                                                                                        <ig:BoundDataField DataFieldName="AGroupNo" Key="AGroupNo">
                                                                                        </ig:BoundDataField>
                                                                                        <ig:BoundDataField DataFormatString="{0:MM/dd/yyyy hh tt}" DataFieldName="AGroupActivationDate"
                                                                                            Key="AGroupActivationDate">
                                                                                        </ig:BoundDataField>
                                                                                        <ig:BoundDataField DataFormatString="{0:MM/dd/yyyy hh tt}" DataFieldName="AGroupExpirationDate"
                                                                                            Key="AGroupExpirationDate">
                                                                                        </ig:BoundDataField>
                                                                                    </Columns>
                                                                                    <Behaviors>
                                                                                        <ig:Activation Enabled="true">
                                                                                        </ig:Activation>
                                                                                        <ig:EditingCore>
                                                                                            <Behaviors>
                                                                                                <ig:RowAdding>
                                                                                                </ig:RowAdding>
                                                                                                <ig:CellEditing>
                                                                                                    <EditModeActions MouseClick="Single" />
                                                                                                    <ColumnSettings>
                                                                                                        <ig:EditingColumnSetting ReadOnly="true" ColumnKey="AGSeq" />
                                                                                                        <ig:EditingColumnSetting EditorID="ddlAGroupNo" ColumnKey="AGroupNo" />
                                                                                                        <ig:EditingColumnSetting EditorID="dppAGroupActivationDate" ColumnKey="AGroupActivationDate" />
                                                                                                        <ig:EditingColumnSetting EditorID="dppAGroupExpirationDate" ColumnKey="AGroupExpirationDate" />
                                                                                                    </ColumnSettings>
                                                                                                    <CellEditingClientEvents ExitedEditMode="grdAccessGroups_CellEditing_ExitingEditMode"
                                                                                                        EnteringEditMode="grdAccessGroups_CellEditing_EnteringEditMode" />
                                                                                                </ig:CellEditing>
                                                                                            </Behaviors>
                                                                                        </ig:EditingCore>
                                                                                        <ig:Selection CellClickAction="Row" RowSelectType="Single">
                                                                                        </ig:Selection>
                                                                                    </Behaviors>
                                                                                </ig:WebDataGrid>
                                                                                <ig:WebMonthCalendar runat="server" ID="AGroupActivationDateCalendarView" EnableWeekNumbers="true"
                                                                                    ChangeMonthToDateClicked="true" EnableMonthDropDown="True" EnableYearDropDown="True">
                                                                                </ig:WebMonthCalendar>
                                                                                <ig:WebMonthCalendar runat="server" ID="AGroupExpirationDateCalendarView" EnableWeekNumbers="true"
                                                                                    ChangeMonthToDateClicked="true" EnableMonthDropDown="True" EnableYearDropDown="True">
                                                                                </ig:WebMonthCalendar>
                                                                            </td>
                                                                            <td>
                                                                            </td>
                                                                            <td valign="top">
                                                                                <table>
                                                                                    <tr>
                                                                                        <td>
                                                                                            <asp:CheckBox ID="chkDedicatedAccess" runat="server" Text="Dedicated Access" onClick="return checkDedicatedAccess();"
                                                                                                OnCheckedChanged="chkDedicatedAccess_CheckedChanged" />
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </Template>
                                                            </igmisc:WebGroupBox>
                                                        </td>
                                                        <td>
                                                            <igmisc:WebGroupBox ID="gboDedicated" runat="server" Text="" Height="100%" Width="500px"
                                                                BackColor="Transparent">
                                                                <Template>
                                                                    <table width="100%">
                                                                        <tr>
                                                                            <td>
                                                                                <table width="100%">
                                                                                    <tr>
                                                                                        <td style="width: 120px;">
                                                                                            <asp:Label ID="lblAccessGroupName" runat="server" Text="Access Group Name"></asp:Label>
                                                                                        </td>
                                                                                        <td style="text-align: left">
                                                                                            <ig:WebTextEditor ID="txtAccessGroupName" runat="server" Width="200px">
                                                                                            </ig:WebTextEditor>
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                                <ig:WebHierarchicalDataGrid ID="accessGroupTree" runat="server" Width="100%" DataKeyFields="pnlNo"
                                                                                    DataMember="panel" AutoGenerateColumns="false" AutoGenerateBands="false" InitialExpandDepth="0"
                                                                                    InitialDataBindDepth="1" Key="Panel" EnableDataViewState="true" EnableViewState="true"
                                                                                    EnableAjax="false" OnInitializeRow="accessGroupTree_OnInitializeRow">
                                                                                    <EmptyRowsTemplate>
                                                                                        No Record Found...
                                                                                    </EmptyRowsTemplate>
                                                                                    <ExpandCollapseAnimation SlideOpenDirection="Auto" SlideOpenDuration="300" SlideCloseDirection="Auto"
                                                                                        SlideCloseDuration="300" />
                                                                                    <Columns>
                                                                                        <ig:BoundDataField DataFieldName="pnlNo" Key="pnlNo" Header-Text="pnlNo" Hidden="true">
                                                                                        </ig:BoundDataField>
                                                                                        <ig:BoundDataField DataFieldName="Panel" Key="Panel" Header-Text="Panel" VisibleIndex="0">
                                                                                        </ig:BoundDataField>
                                                                                    </Columns>
                                                                                    <EditorProviders>
                                                                                        <ig:DropDownProvider ID="ddlTimeZone" EditorControl-DisplayMode="DropDownList">
                                                                                            <EditorControl ID="EditorControlTimeZone" runat="server" EnableDropDownAsChild="False"
                                                                                                DisplayMode="DropDownList" DropDownContainerMaxHeight="200px">
                                                                                                <Items>
                                                                                                </Items>
                                                                                            </EditorControl>
                                                                                        </ig:DropDownProvider>
                                                                                    </EditorProviders>
                                                                                    <Bands>
                                                                                        <ig:Band Key="Reader" ShowHeader="true" DataKeyFields="rdrNo" DataMember="dedicatedaccessgrid"
                                                                                            AutoGenerateColumns="false">
                                                                                            <Columns>
                                                                                                <ig:BoundDataField DataFieldName="pnlNo" Key="pnlNo" Header-Text="pnlNo" Hidden="true">
                                                                                                </ig:BoundDataField>
                                                                                                <ig:BoundDataField DataFieldName="Panel" Key="Panel" Header-Text="Panel" Hidden="true">
                                                                                                </ig:BoundDataField>
                                                                                                <ig:BoundDataField DataFieldName="rdrNo" Key="rdrNo" Header-Text="rdrNo" Hidden="true">
                                                                                                </ig:BoundDataField>
                                                                                                <ig:BoundDataField DataFieldName="Reader" Key="Reader" Header-Text="Reader" VisibleIndex="0">
                                                                                                </ig:BoundDataField>
                                                                                                <ig:BoundDataField DataFieldName="TimeZone" Key="TimeZone" Header-Text="TimeZone"
                                                                                                    VisibleIndex="1">
                                                                                                </ig:BoundDataField>
                                                                                                 <ig:TemplateDataField Key="bugFixKey"  Header-CssClass="hidden" />
                                                                                            </Columns>
                                                                                            <Behaviors>
                                                                                                <ig:EditingCore AutoCRUD="false">
                                                                                                    <Behaviors>
                                                                                                        <ig:CellEditing>
                                                                                                            <EditModeActions MouseClick="Single" />
                                                                                                            <ColumnSettings>
                                                                                                                <ig:EditingColumnSetting ColumnKey="Reader" ReadOnly="true" />
                                                                                                                <ig:EditingColumnSetting ColumnKey="TimeZone" ReadOnly="false" EditorID="ddlTimeZone" />
                                                                                                            </ColumnSettings>
                                                                                                        </ig:CellEditing>
                                                                                                    </Behaviors>
                                                                                                </ig:EditingCore>
                                                                                            </Behaviors>
                                                                                        </ig:Band>
                                                                                    </Bands>
                                                                                    <Behaviors>
                                                                                        <ig:Activation Enabled="true">
                                                                                        </ig:Activation>
                                                                                        <ig:EditingCore EnableInheritance="true">
                                                                                            <Behaviors>
                                                                                                <ig:CellEditing>
                                                                                                    <ColumnSettings>
                                                                                                        <ig:EditingColumnSetting ColumnKey="Panel" ReadOnly="true" />
                                                                                                    </ColumnSettings>
                                                                                                </ig:CellEditing>
                                                                                            </Behaviors>
                                                                                        </ig:EditingCore>
                                                                                        <ig:Selection CellClickAction="Cell" CellSelectType="Single" RowSelectType="Single">
                                                                                        </ig:Selection>
                                                                                    </Behaviors>
                                                                                </ig:WebHierarchicalDataGrid>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </Template>
                                                            </igmisc:WebGroupBox>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </Template>
                                </ig:ContentTabItem>
                                <ig:ContentTabItem Key="tpControl" Text="Control">
                                    <Template>
                                        <table style="height: 350px;">
                                            <tr valign="top">
                                                <td style="width: 270px" valign="top">
                                                    <igmisc:WebGroupBox ID="gboApbControl" runat="server" Text="Apb Control" Width="270"
                                                        Height="230" BackColor="Transparent">
                                                        <Template>
                                                            <table width="100%">
                                                                <tr>
                                                                    <td colspan="2" align="left">
                                                                        <asp:CheckBox ID="chkDurationUse" runat="server" Text="Duration Use" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="2" style="padding-left: 25px;">
                                                                        <table>
                                                                            <tr>
                                                                                <td>
                                                                                    <asp:RadioButton ID="rbSetINOUTonNextUse" runat="server" Text="Set IN/OUT on Next Use"
                                                                                        GroupName="apbControl" />
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    <asp:RadioButton ID="rbAPBOut" runat="server" Text="APB Out" GroupName="apbControl" />
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    <asp:RadioButton ID="rbAPBIn" runat="server" Text="APB In" GroupName="apbControl" />
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    <asp:RadioButton ID="rbExemptfromAPB" runat="server" Text="Exempt from APB" GroupName="apbControl" />
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="2">
                                                                        <hr style="height: 0.5px; width: 100%" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="width: 800px; padding-left: 5px;">
                                                                        <asp:Label ID="lblInArea" runat="server" Text="In Area"></asp:Label>
                                                                    </td>
                                                                    <td>
                                                                        <ig:WebDropDown ID="cboInArea" runat="server" Visible="true" DisplayMode="DropDownList"
                                                                            Width="180px" EnableDropDownAsChild="false">
                                                                        </ig:WebDropDown>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="2">
                                                                        <asp:CheckBox ID="chkExemptfromAPBAreaChecking" runat="server" Text="Exempt from APB Area Checking" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </Template>
                                                    </igmisc:WebGroupBox>
                                                </td>
                                                <td style="width: 250px" valign="top">
                                                    <igmisc:WebGroupBox ID="gboAlarmShuntControl" runat="server" Text="Alarm Shunt Control"
                                                        Width="250" Height="230" BackColor="Transparent">
                                                        <Template>
                                                            <table>
                                                                <tr>
                                                                    <td style="padding-left: 5px;">
                                                                        <asp:Label ID="lblShuntGroup" runat="server" Text="Shunt Group"></asp:Label>
                                                                    </td>
                                                                    <td>
                                                                        <ig:WebDropDown ID="cboShuntGroup" runat="server" Visible="true" DisplayMode="DropDownList"
                                                                            Width="160px" AutoPostBack="true" OnSelectionChanged="cboShuntGroup_OnSelectionChanged">
                                                                        </ig:WebDropDown>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="2" valign="middle">
                                                                        <asp:CheckBox ID="chkShuntByDesignatedReader" runat="server" Text="Shunt By Designated Reader" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="2">
                                                                        <hr style="height: 0.5px; width: 232px" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td rowspan="2" style="padding-left: 5px;">
                                                                        <asp:LinkButton ID="lnkCurrentState" runat="server" Text="Current State" OnClientClick="return lnkCurrentState_OnClientClick();"
                                                                            OnClick="lnkCurrentState_OnClick"></asp:LinkButton>
                                                                    </td>
                                                                    <td rowspan="2">
                                                                        <asp:RadioButton ID="rbInactive" runat="server" Text="Inactive" GroupName="almShuntControl" />&nbsp;
                                                                        <asp:RadioButton ID="rbShunting" runat="server" Text="Shunting" GroupName="almShuntControl" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </Template>
                                                    </igmisc:WebGroupBox>
                                                </td>
                                                <td style="min-width: 220px">
                                                    <igmisc:WebGroupBox ID="gboCategoryCounters" runat="server" Text="Category Counters"
                                                        Width="100%" Height="230" BackColor="Transparent">
                                                        <Template>
                                                            <table width="100%" cellpadding="1" cellspacing="1">
                                                                <tr>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory1" runat="server" Text="Category 1" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory2" runat="server" Text="Category 2" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory3" runat="server" Text="Category 3" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory4" runat="server" Text="Category 4" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory5" runat="server" Text="Category 5" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory6" runat="server" Text="Category 6" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory7" runat="server" Text="Category 7" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory8" runat="server" Text="Category 8" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory9" runat="server" Text="Category 9" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory10" runat="server" Text="Category 10" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory11" runat="server" Text="Category 11" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory12" runat="server" Text="Category 12" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory13" runat="server" Text="Category 13" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory14" runat="server" Text="Category 14" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory15" runat="server" Text="Category 15" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkCategory16" runat="server" Text="Category 16" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </Template>
                                                    </igmisc:WebGroupBox>
                                                </td>
                                            </tr>
                                        </table>
                                    </Template>
                                </ig:ContentTabItem>
                                <ig:ContentTabItem Key="tpPersonal" Text="Personal">
                                    <Template>
                                        <table style="height: 350px;">
                                            <tr>
                                                <td style="width: 83px;">
                                                    <asp:Label ID="lblSocSecNum" runat="server" Text="Soc. Sec. #"></asp:Label>
                                                </td>
                                                <td>
                                                    <ig:WebTextEditor ID="txtSocSecNum" runat="server" Width="172">
                                                        <ClientEvents Initialize="txtSSN_Initialize" KeyPress="txtPINCode_KeyPress" TextChanged="txtSSN_TextChanged" />
                                                    </ig:WebTextEditor>
                                                </td>
                                                <td>
                                                    <div runat="server" id="ReTypeSSNDiv" style="padding-left: 25px;">
                                                        <asp:Label ID="lblReTypeSSN" Width="83px" runat="server" Text="Re-Type"></asp:Label>
                                                        <ig:WebTextEditor ID="txtreSSN" Width="172px" runat="server">
                                                            <ClientEvents Initialize="txtreSSN_Initialize" KeyPress="txtPINCode_KeyPress" TextChanged="txtreSSN_TextChanged" />
                                                        </ig:WebTextEditor>
                                                        &nbsp;&nbsp;
                                                        <asp:Label ID="lblReTypeSSNError" runat="server" Text="" ForeColor="Red"></asp:Label>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr valign="top">
                                                <td colspan="2">
                                                    <table style="margin-top: -4px;">
                                                        <tr>
                                                            <td style="width: 80px;">
                                                                <asp:Label ID="lblCompanyID" runat="server" Text="Company ID"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebDropDown ID="cboCompanyID" runat="server" Visible="true" DisplayMode="DropDown"
                                                                    Width="177px" EnableDropDownAsChild="false" AutoFilterQueryType="StartsWith"
                                                                    EnableAutoFiltering="Off" EnableCustomValues="true" EnableCustomValueSelection="true"
                                                                    KeepFocusOnSelection="false" EnableClosingDropDownOnBlur="true" EnableClosingDropDownOnSelect="true">
                                                                </ig:WebDropDown>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblDepartment" runat="server" Text="Department"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebDropDown ID="cboDepartment" runat="server" Visible="true" DisplayMode="DropDown"
                                                                    Width="177px" EnableDropDownAsChild="false" AutoFilterQueryType="StartsWith"
                                                                    EnableAutoFiltering="Off" EnableCustomValues="true" EnableCustomValueSelection="true"
                                                                    KeepFocusOnSelection="false" EnableClosingDropDownOnBlur="true" EnableClosingDropDownOnSelect="true">
                                                                </ig:WebDropDown>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblLocation" runat="server" Text="Location"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebDropDown ID="cboLocation" runat="server" Visible="true" DisplayMode="DropDown"
                                                                    Width="177px" EnableDropDownAsChild="false" AutoFilterQueryType="StartsWith"
                                                                    EnableAutoFiltering="Off" EnableCustomValues="true" EnableCustomValueSelection="true"
                                                                    KeepFocusOnSelection="false" EnableClosingDropDownOnBlur="true" EnableClosingDropDownOnSelect="true">
                                                                </ig:WebDropDown>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblHireDate" runat="server" Text="Hire Date"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebDatePicker ID="deHireDate" runat="server" Width="177px" DropDownCalendarID="HireDateCalendarView">
                                                                </ig:WebDatePicker>
                                                                <ig:WebMonthCalendar runat="server" ID="HireDateCalendarView" EnableWeekNumbers="true"
                                                                    ChangeMonthToDateClicked="true" EnableMonthDropDown="True" EnableYearDropDown="True" >
                                                                </ig:WebMonthCalendar>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblSupervisor" runat="server" Text="Supervisor"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebDropDown ID="cboSupervisor" runat="server" Visible="true" DisplayMode="DropDownList"
                                                                    Width="177px" EnableDropDownAsChild="false">
                                                                </ig:WebDropDown>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <%--<asp:Label ID="lblDateofBirth" runat="server" Text="Date of Birth"></asp:Label>--%>
                                                            </td>
                                                            <td>
                                                                <%--<ig:WebDatePicker ID="deDateofBirth" runat="server" Width="177px" DropDownCalendarID="DateofBirthCalendarView">
                                                                </ig:WebDatePicker>
                                                                <ig:WebMonthCalendar runat="server" ID="DateofBirthCalendarView" EnableWeekNumbers="true"
                                                                    ChangeMonthToDateClicked="true" EnableMonthDropDown="True" EnableYearDropDown="True">
                                                                </ig:WebMonthCalendar>--%>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                                <td>
                                                    <table style="margin-top: -4px;">
                                                        <tr>
                                                            <td class="personnel-tab-padding">
                                                                <asp:Label ID="lblPhone" runat="server" Text="Phone"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebTextEditor ID="txtPhone" runat="server" Width="172">
                                                                </ig:WebTextEditor>
                                                            </td>
                                                            <td>
                                                                <asp:Label ID="lblGender" runat="server" Text="Gender"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebDropDown ID="cboGender" runat="server" Visible="true" DisplayMode="DropDown"
                                                                    Width="175px" EnableDropDownAsChild="false">
                                                                </ig:WebDropDown>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="personnel-tab-padding">
                                                                <asp:Label ID="lblPhoneExt" runat="server" Text="Phone Ext"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebTextEditor ID="txtPhoneExt" runat="server" Width="172">
                                                                </ig:WebTextEditor>
                                                            </td>
                                                            <td style="display: none;">
                                                                <asp:Label ID="lblMiddleNamePersonal" runat="server" Text="Middle Name"></asp:Label>
                                                            </td>
                                                            <td style="display: none;">
                                                                <ig:WebTextEditor ID="txtMiddleNamePersonal" Width="172" runat="server" Visible="false">
                                                                    <ClientEvents Initialize="txtMiddleNamePersonal_Initialize" TextChanged="txtMiddleNamePersonal_TextChanged" />
                                                                </ig:WebTextEditor>
                                                            </td>
                                                            <td>
                                                                <asp:Label ID="lblDateofBirth" runat="server" Text="Date of Birth"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <ig:WebDatePicker ID="deDateofBirth" runat="server" Width="173px" DropDownCalendarID="DateofBirthCalendarView">
                                                                </ig:WebDatePicker>
                                                                <ig:WebMonthCalendar runat="server" ID="DateofBirthCalendarView" EnableWeekNumbers="true"
                                                                    ChangeMonthToDateClicked="true" EnableMonthDropDown="True" EnableYearDropDown="True">
                                                                </ig:WebMonthCalendar>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="personnel-tab-padding">
                                                                <asp:Label ID="lblVehicleMake" runat="server" Text="Vehicle Make"></asp:Label>
                                                            </td>
                                                            <td colspan="3">
                                                                <ig:WebTextEditor ID="txtVehicleMake" runat="server" Width="172">
                                                                </ig:WebTextEditor>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="personnel-tab-padding">
                                                                <asp:Label ID="lblLicensePlate" runat="server" Text="License Plate"></asp:Label>
                                                            </td>
                                                            <td colspan="3">
                                                                <ig:WebTextEditor ID="txtLicensePlate" runat="server" Width="172">
                                                                </ig:WebTextEditor>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="personnel-tab-padding">
                                                                <asp:Label ID="lblRemarks" runat="server" Text="Remarks"></asp:Label>
                                                            </td>
                                                            <td colspan="3" rowspan="3">
                                                                <asp:TextBox ID="txtRemarks" runat="server" Height="70px" Width="460px" TextMode="MultiLine"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </Template>
                                </ig:ContentTabItem>
                                <ig:ContentTabItem Key="tpPhoto" Text="Photo">
                                    <Template>
                                        <igmisc:WebGroupBox ID="WebGroupBox1" runat="server" BackColor="Transparent">
                                            <Template>
                                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                                    <ContentTemplate>
                                                        <table style="width: 600px;">
                                                            <tr>
                                                                <td>
                                                                    <div style="float: left;">
                                                                        <asp:FileUpload ID="fileUploadPhoto" runat="server" Width="200px" />
                                                                        <asp:RegularExpressionValidator ID="regexValidator" runat="server" ControlToValidate="fileUploadPhoto"
                                                                            CssClass="badge-image-validation" ErrorMessage="Only image are allowed." ValidationExpression="(.*\.([Jj][Pp][Gg])|.*\.([Jj][Pp][Ee][Gg])|.*\.([Gg][Ii][Ff])|.*\.([Pp][Nn][Gg])|.*\.([Bb][Mm][Pp])|.*\.([Ii][Cc][Oo])$)">
                                                                        </asp:RegularExpressionValidator>
                                                                    </div>
                                                                </td>
                                                                <td>
                                                                    <div style="float: left;" class="ig_Office_2007ReportPreViewBg">
                                                                        <asp:LinkButton runat="server" ID="lnkImportPhoto" Style="margin-top: 10px; text-decoration: none;
                                                                            color: #033E82" OnClick="lnkImportPhoto_OnClick">Import Photo</asp:LinkButton>
                                                                    </div>
                                                                </td>
                                                                <td>
                                                                    <div style="float: left;" class="ig_Office_2007ReportPreViewBg">
                                                                        <asp:LinkButton runat="server" ID="lnkClearPhoto" Style="margin-top: 10px; text-decoration: none;
                                                                            color: #033E82" OnClick="lnkClearPhoto_OnClick">Clear Photo</asp:LinkButton>
                                                                    </div>
                                                                </td>
                                                                <td>
                                                                    <div style="float: left;" class="ig_Office_2007ReportPreViewBg">
                                                                        <asp:LinkButton runat="server" ID="lnkExportPhoto" Style="margin-top: 10px; text-decoration: none;
                                                                            color: #033E82" OnClick="lnkExportPhoto_OnClick">Export Photo</asp:LinkButton>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td colspan="4">
                                                                    <asp:Image ID="imgPhoto" runat="server" BorderWidth="1" CssClass="badge-photo-personnel-setwidth"/>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </ContentTemplate>
                                                    <Triggers>
                                                        <asp:PostBackTrigger ControlID="lnkImportPhoto" />
                                                    </Triggers>
                                                </asp:UpdatePanel>
                                            </Template>
                                        </igmisc:WebGroupBox>
                                    </Template>
                                </ig:ContentTabItem>
                                <ig:ContentTabItem Key="tpElevator" Text="Elevator">
                                    <Template>
                                        <table>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblDefaultFloor" runat="server" Text="Default Floor"></asp:Label>
                                                </td>
                                                <td>
                                                    <ig:WebNumericEditor ID="seDefaultFloor" Width="177px" runat="server" MinValue="-127"
                                                        MaxValue="127">
                                                        <Buttons SpinButtonsDisplay="OnRight" CustomButtonDisplay="None">
                                                        </Buttons>
                                                    </ig:WebNumericEditor>
                                                </td>
                                                <td>
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblDoor" runat="server" Text="Door"></asp:Label>
                                                </td>
                                                <td>
                                                    <ig:WebDropDown ID="cboElevetorDoorType" runat="server" Visible="true" DisplayMode="DropDownList"
                                                        EnableDropDownAsChild="false" Width="178px">
                                                    </ig:WebDropDown>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="5">
                                                    <igmisc:WebGroupBox ID="gbFeatures" runat="server" Text="Special Features(Person Type)"
                                                        BackColor="Transparent">
                                                        <Template>
                                                            <asp:CheckBoxList ID="chkFeatures" runat="server">
                                                            </asp:CheckBoxList>
                                                        </Template>
                                                    </igmisc:WebGroupBox>
                                                </td>
                                            </tr>
                                        </table>
                                    </Template>
                                </ig:ContentTabItem>
                            </Tabs>
                        </ig:WebTab>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
    <script type="text/javascript" language="javascript">
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            if (args.get_error() != undefined) {
                args.set_errorHandled(true);
            }
        }
    </script>
    <script type="text/javascript">
        ShowBusyPopup();

        function openReaderLookup() {
            var qs = window.location.search;
            qs = qs + "&mob=" + document.getElementById('<%=txtPhone.ClientID %>').value;
            window.location = "ReaderLookup.aspx" + qs;
            return false;
        }

        function checkDedicatedAccess() {
            if ($("#<%=chkDedicatedAccess.ClientID %>").is(':checked') == false) {
                var result = confirm("<%= this.DedicatedAccessWarn %>");
                if (result) {
                    __doPostBack("<%= chkDedicatedAccess.ClientID %>", "");
                }
                else {
                    return false;
                }
            }
            else {
                __doPostBack("<%= chkDedicatedAccess.ClientID %>", "");
            }
        }
        function checkedChanged() {
            var actDate = $find("<%=deActivationDate.ClientID %>").get_value();
            actDate = new Date(actDate);
            if ($find("<%=deActivationDate.ClientID %>").get_text().length > 0) {
                var objParms = {
                    actDateDay: actDate.getDate(),
                    actDateMon: actDate.getMonth(),
                    actDateYear: actDate.getFullYear(),
                    actDateHour: actDate.getHours(),
                    enabledChecked: $("#<%=chkEnabled.ClientID %>").is(':checked')
                };
                $.ajax({
                    type: "POST",
                    url: "PersonnelInsertUpdate.aspx/CheckActivation",
                    data: JSON.stringify(objParms),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    async: false,
                    success: function (msg) {
                        if (msg.d) {
                            var disableEnable = "<%=this.DisableEnable %>";
                            disableEnable = "<%=ActivationDate %>" + " : " + $find("<%=deActivationDate.ClientID %>").get_text() + "\n\n" + disableEnable;
                            var con = false;
                            if ($("#<%=chkEnabled.ClientID %>").is(':checked')) {
                                con = confirm(disableEnable);
                                if (con) {
                                    $find("<%=deActivationDate.ClientID %>").set_value('');
                                    $("#<%=chkEnabled.ClientID %>").attr('checked', true);
                                }
                                else {
                                    $("#<%=chkEnabled.ClientID %>").attr('checked', false);
                                }
                            }
                            else {
                                con = confirm(disableEnable);
                                if (con) {
                                    $find("<%=deActivationDate.ClientID %>").set_value('');
                                    $("#<%=chkEnabled.ClientID %>").attr('checked', false);
                                }
                                else {
                                    $("#<%=chkEnabled.ClientID %>").attr('checked', true);
                                }
                            }
                            return;
                        }
                    },
                    failure: function (msg) {
                        console.log("Failure: CheckActivation");
                    }
                });
            }

            if ($find("<%=deExpirationDate.ClientID %>").get_text().length > 0) {
                var expDate = $find("<%=deExpirationDate.ClientID %>").get_value();
                expDate = new Date(expDate);
                var objExpParms = {
                    expDateDay: expDate.getDate(),
                    expDateMon: expDate.getMonth(),
                    expDateYear: expDate.getFullYear(),
                    expDateHour: expDate.getHours(),
                    enabledChecked: $("#<%=chkEnabled.ClientID %>").is(':checked')
                };
                $.ajax({
                    type: "POST",
                    url: "PersonnelInsertUpdate.aspx/CheckExpiration",
                    data: JSON.stringify(objExpParms),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    async: false,
                    success: function (msg) {
                        if ((msg.d)) {
                            var expirationPassed = "<%=this.ExpirationPassed %>";
                            expirationPassed = "<%=ExpirationDate %>" + " : " + $find("<%=deExpirationDate.ClientID %>").get_text() + "\n\n" + expirationPassed;
                            var con = false;
                            if ($("#<%=chkEnabled.ClientID %>").is(':checked')) {
                                con = confirm(expirationPassed);
                                if (con) {
                                    $find("<%=deExpirationDate.ClientID %>").set_value('');
                                    $("#<%=chkEnabled.ClientID %>").attr('checked', true);
                                }
                                else {
                                    $("#<%=chkEnabled.ClientID %>").attr('checked', false);
                                }
                            }
                            return;
                        }
                    },
                    failure: function (msg) {
                        console.log("Failure: CheckExpiration");
                    }
                });
            }
        }

        function sameDay(d1, d2) {
            return d1.getFullYear() == d2.getFullYear() && d1.getMonth() == d2.getMonth() && d1.getDate() == d2.getDate();
        }

        function WebDatePicker_CalendarClosed(sender, e) {
            var newValue = e.get_value();

            if (newValue === undefined) return;

            var currntDate = new Date();
            var hour = currntDate.getHours();

            if (sameDay(new Date(newValue), new Date(currntDate.setHours(0, 0, 0, 0)))) {
                newValue.setHours(hour);
                e.set_value(newValue);
            }
        }

        function listenerOfDateChanged(webDatePicker, evntArgs) {
            // raise postback when 2nd day of any month is clicked
            if (evntArgs.get_value() != null) {
                var oDate = new Date(evntArgs.get_value());
                var today = new Date();
                if (oDate > today) {
                    $("#<%=chkEnabled.ClientID %>").attr('checked', false);
                }
            }
        }

        function listenerOfExpirationDateChanged(webDatePicker, evntArgs) {
            // raise postback when 2nd day of any month is clicked
            if (evntArgs.get_value() != null) {
                var oDate = new Date(evntArgs.get_value());
                var today = new Date();
                if (oDate < today) {
                    $("#<%=chkEnabled.ClientID %>").attr('checked', false);
                }
            }
            if ($("#<%=chkEnabled.ClientID %>").is(':checked') == true) {
                checkedChanged();
            }
        }

        function StringMatch(text1, text2) {
            return text1 != text2;
        }

        function clientClickOnCancel() {
            //            console.log('clientClickOnCancel');
            duplicateBadge = false;
            return true;
        }

        function clientClickOnBack() {
            //            console.log('clientClickOnBack');
            <%Session["IU"] = true;%>
            window.history.back();
            return false;
        }

        function clientClickOnSave() {
            //            console.log('clientClickOnSave');
            var relID = document.getElementById("<%=txtLastName.ClientID %>");
            var relName = relID == null ? '' : relID.value.trim();
            var pinCkh = StringMatch((txtPinCodeID == null ? '' : txtPinCodeID.get_text()), txtrePINCodeID.get_text());
            var SSNCkh = StringMatch((txtSSNID == null ? '' : txtSSNID.get_text()), txtreSSNID.get_text());
            var NewBadge;
            if ("<%=this.FacBadge %>" == "False") {
                if (document.getElementById("<%=hfBadgeType.ClientID %>").value == "2") {
                    if ($find("<%=txtPIVIData.ClientID %>").get_text().length < 32) {
                        alert("<%=this.ValidPIVIData %>");
                        return false;
                    }
                    else
                        NewBadge = 1;
                }
                else {
                    NewBadge = document.getElementById('<%=txtBadgeNumber.ClientID %>') == null ? 0 : parseInt(document.getElementById('<%=txtBadgeNumber.ClientID %>').value);
                }
            }
            else {
                NewBadge = document.getElementById('<%=txtFacBadgeBadge.ClientID %>') == null ? 0 : parseInt(document.getElementById('<%=txtFacBadgeBadge.ClientID %>').value);
            }

            if (NewBadge == 0 || isNaN(NewBadge)) {
                if (document.getElementById("<%=hfBadgeType.ClientID %>").value != 2) {
                    alert("<%=this.ZeroBadge %>");
                    return false;
                }
            }
            else if (relName.length <= 0) {
                alert("<%=this.LastNameErrMsg %>");
                return false;
            }
            else if (PinChange == true && pinCkh == true) {
                alert("<%=this.PinCodecfmMsg %>");
                return false;
            }
            else if (SSNChange == true && SSNCkh == true) {
                alert("<%=this.SSNCfmMsg %>");
                return false;
            }
            else if (duplicateBadge) {
                alert("<%=this.BadgeExist %>");
                return false;
            }
            return true;
        }
        
        var duplicateBadge = false;
        function chkBadgeExists(oEdit, keyCode, oEvent) {
            var badgeType = document.getElementById("<%=hfBadgeType.ClientID %>").value;
            var sndargs = "BadgeNumberDuplicateValidation#";
            sndargs = sndargs + $find('<%=txtBadgeNumber.ClientID %>').get_text();
            sndargs = sndargs + "," + $find('<%=seFacility.ClientID %>').get_text();
            if ($find('<%=txtPIVIData.ClientID %>').get_text().length == 0) {
                sndargs = sndargs + ",0," + badgeType;
            }
            else {
                sndargs = sndargs + "," + $find('<%=txtPIVIData.ClientID %>').get_text() + "," + badgeType;
            }
            WebForm_DoCallback('__Page', sndargs, ClientCallback, null, null, true);
        }

        function ClientCallback(result, context) {
            if (result == "true") {
                duplicateBadge = true;
                alert("<%=this.BadgeExist %>");
            }
            else if (result == "false") {
                duplicateBadge = false;
            }
        }

        var lblRePinCodeWarning = "<%=this.lblRePinCodeWarning.ClientID %>";
        function txtrePINCode_TextChanged(oEdit, newText, oEvent) {
            var pinCode = txtPinCodeID.get_text();
            chkValidity(pinCode, newText.get_text(), lblRePinCodeWarning, "<%=this.ReEnterPin %>");
        }

        function chkValidity(PinCode, RePinCode, control, msg) {
            if (PinCode != RePinCode) {
                document.getElementById(control).style.display = 'inline';
                document.getElementById(control).style.visibility = 'visible';
                document.getElementById(control).innerHTML = msg;
            }
            else {
                document.getElementById(control).style.display = 'none';
                document.getElementById(control).style.visibility = 'hidden';
            }
        }

        function InLineControl(control) {
            document.getElementById(control).style.display = 'inline';
            document.getElementById(control).style.visibility = 'visible';
        }

        function HideControl(control) {
            document.getElementById(control).style.display = 'none';
            document.getElementById(control).style.visibility = 'hidden';
        }

        var reTypePinRowID = "<%=this.reTypePinRow.ClientID %>";
        var PinChange = false;

        function txtPINCode_TextChanged(oEdit, newText, oEvent) {
            var pinHideShow = "<%=this.hidePinCode %>";
            var lengthcheck = newText.get_text().length > 0;
            if (pinHideShow == 'True' && lengthcheck == true) {
                PinChange = true;
                var pinCode = txtrePINCodeID.get_text();
                InLineControl(reTypePinRowID);
                chkValidity(newText.get_text(), pinCode, lblRePinCodeWarning, "<%=this.ReEnterPin %>");
            }
            else {
                PinChange = false;
                txtrePINCodeID.set_text("");
                HideControl(reTypePinRowID);
            }
        }

        var reTypeSSNDivID = "<%=this.ReTypeSSNDiv.ClientID %>";
        var SSNChange = false;

        function txtSSN_TextChanged(oEdit, newText, oEvent) {
            var SSNHideShow = "<%=this.hideSSN %>";
            var lengthcheck = newText.get_text().length > 0;
            if (SSNHideShow == 'True' && lengthcheck == true) {
                SSNChange = true;
                var SSNCode = txtreSSNID.get_text();
                InLineControl(reTypeSSNDivID);
                chkValidity(newText.get_text(), SSNCode, lblReSSNWarning, "<%=this.ReEnterSSN %>");
            }
            else {
                SSNChange = false;
                txtreSSNID.set_text("");
                HideControl(reTypeSSNDivID);
            }
        }

        var lblReSSNWarning = "<%=this.lblReTypeSSNError.ClientID %>";
        function txtreSSN_TextChanged(oEdit, newText, oEvent) {
            var SSN = txtSSNID.get_text();
            chkValidity(SSN, newText.get_text(), lblReSSNWarning, "<%=this.ReEnterSSN %>");
        }

        var txtPinCodeID;
        var txtrePINCodeID;
        function txtPINCode_Initialize(oEdit, text) {
            txtPinCodeID = oEdit;
        }

        function txtrePINCode_Initialize(oEdit, text) {
            txtrePINCodeID = oEdit;
            HideControl(reTypePinRowID);
        }

        var txtSSNID;
        var txtreSSNID;
        function txtSSN_Initialize(oEdit, text) {
            txtSSNID = oEdit;
        }

        function txtreSSN_Initialize(oEdit, text) {
            txtreSSNID = oEdit;
            HideControl(reTypeSSNDivID);
        }

        var txtMiddleNameID;
        var txtMiddleNamePersonalID;

        function txtMiddleName_TextChanged(oEdit, newText, oEvent) {
            txtMiddleNamePersonalID.set_text(newText.get_text());
        }
        function txtMiddleNamePersonal_TextChanged(oEdit, newText, oEvent) {
            txtMiddleNameID.set_text(newText.get_text());
        }
        function txtMiddleName_Initialize(oEdit, text) {
            txtMiddleNameID = oEdit;
        }
        function txtMiddleNamePersonal_Initialize(oEdit, text) {
            txtMiddleNamePersonalID = oEdit;
        }

        function txtPIVIData_KeyPress(oEdit, keyCode, oEvent) {
            if (keyCode.get_keyCode() < 48 || keyCode.get_keyCode() > 57) {
                keyCode.set_cancel(true);
            }

            if (oEdit.get_text().length == 32) {
                var btnStd = document.getElementById("<%=btnStd.ClientID %>");
                btnStd.style.display = 'none';
                btnStd.nextSibling.style.visibility = "hidden";
                var btnPiv = document.getElementById("<%=btnPiv.ClientID %>");
                btnPiv.style.display = 'none';
                btnPiv.nextSibling.style.visibility = "hidden";
            }
        }

        function txtPINCode_KeyPress(oEdit, keyCode, oEvent) {
            if (keyCode.get_keyCode() < 48 || keyCode.get_keyCode() > 57) {
                keyCode.set_cancel(true);
            }
        }

        function txtBadgeNumber_TextChanged(oEdit, keyCode, oEvent) {
            duplicateBadge = false;
        }

        function txtBadgeNumber_KeyPress(oEdit, keyCode, oEvent) {
            if (keyCode.get_keyCode() < 48 || keyCode.get_keyCode() > 57) {
                keyCode.set_cancel(true);
            }

            if (oEdit.get_text().length >= parseInt("<%= this.BadgeLen %>")) {
                alert("<%=this.BadgeTooLarge %>");
                keyCode.set_cancel(true);
            }
        }

        function txtFacBadgeFacility_KeyPress(oEdit, keyCode, oEvent) {
            if (oEdit.get_text().length >= 4) {
                alert("<%=this.FACLarge %>");
                keyCode.set_cancel(true);
            }
        }

        function txtFacBadgeBadge_KeyPress(oEdit, keyCode, oEvent) {
            if (oEdit.get_text().length >= 4) {
                alert("<%=this.MaxDigit %>");
                keyCode.set_cancel(true);
            }
        }

        function CheckShuntActive(shunt) {
            var result = false;
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                data: "{'shunt': '" + shunt + "'}",
                url: "PersonnelInsertUpdate.aspx/CheckShuntActive",
                dataType: "json",
                async: false,
                success: function (data) {
                    result = data.d;
                },
                error: function (x, e) {
                    alert("The call to the server side failed. " + x.responseText);
                }
            });
            return result;
        }

        function lnkCurrentState_OnClientClick() {
            var shunt = $find("<%= cboShuntGroup.ClientID %>").get_selectedItem().get_value();
            if (shunt > 0) {
                var isActive = CheckShuntActive(shunt);
                var bContinue = false;
                if (isActive) {
                    bContinue = confirm("<%= this.DeactivateAlarmShunts %>");
                    if (bContinue) {
                        __doPostBack("<%= asyncPanel.UniqueID %>", "1");
                    }
                    else
                        return false;
                }
                else {
                    bContinue = confirm("<%= this.ActivateAlarmShunts %>");
                    if (bContinue) {
                        __doPostBack("<%= asyncPanel.UniqueID %>", "0");
                    }
                    else
                        return false;
                }
            }
            else {
                return false;
            }
        }

        var _UsePiv = "<%=CardAccess.BL.ClientDataHandler.ClientData.SystemSettings().UsePIV %>";
        function btnStd_Click() {
            if (document.getElementById("<%=btnStd.ClientID %>").value == "btnStd") {
                document.getElementById("<%=hfBadgeType.ClientID %>").value = '0';
                $find('<%=txtBadgeNumber.ClientID %>').set_text("0");
                document.getElementById("<%=lblBadgeNumber.ClientID %>").innerHTML = "<%= this.BadgeNo %>:";

                var BadgeRow = document.getElementById("<%=BadgeRow.ClientID %>");
                BadgeRow.style.display = "";

                var ctltSiteNoRow = document.getElementById("<%=SiteNoRow.ClientID %>")
                ctltSiteNoRow.style.display = "none";

                var ctlFacilityRow = document.getElementById("<%=FacilityRow.ClientID %>")
                ctlFacilityRow.style.display = "";

                var ctlPersonRow = document.getElementById("<%=PersonRow.ClientID %>")
                ctlPersonRow.style.display = "none";

                var ctlCredSeries = document.getElementById("<%=CredSeriesRow.ClientID %>")
                ctlCredSeries.style.display = "none";

                var ctlOrgRow = document.getElementById("<%=OrgRow.ClientID %>")
                ctlOrgRow.style.display = "none";

                var ctlEmbossedRow = document.getElementById("<%=EmbrossRowId.ClientID %>");
                ctlEmbossedRow.style.display = "";

                var PIVIRow = document.getElementById("<%=PIVIRow.ClientID %>");
                PIVIRow.style.display = "none";

                var ReIssueRow = document.getElementById("<%=ReIssueRow.ClientID %>");
                ReIssueRow.style.display = "";
            }
        }

        function btnPiv_Click() {
            document.getElementById("<%=lblBadgeNumber.ClientID %>").innerHTML = "<%=this.BadgeCredential %>:";

            document.getElementById("<%=hfBadgeType.ClientID %>").value = '1';
            $find('<%=txtBadgeNumber.ClientID %>').set_text("0");
            if (document.getElementById("<%=btnPiv.ClientID %>").value == "btnPiv") {
                var BadgeRow = document.getElementById("<%=BadgeRow.ClientID %>");
                BadgeRow.style.display = "";

                var ctlPersonRow = document.getElementById("<%=PersonRow.ClientID %>");
                ctlPersonRow.style.display = "";

                var ctlOrgRow = document.getElementById("<%=OrgRow.ClientID %>");
                ctlOrgRow.style.display = "";

                var ctltSiteNoRow = document.getElementById("<%=SiteNoRow.ClientID %>")
                ctltSiteNoRow.style.display = "";

                var ctlCredSeries = document.getElementById("<%=CredSeriesRow.ClientID %>");
                ctlCredSeries.style.display = "";

                var ctlFacilityRow = document.getElementById("<%=FacilityRow.ClientID %>")
                ctlFacilityRow.style.display = "none";

                var ctlEmbossedRow = document.getElementById("<%=EmbrossRowId.ClientID %>");
                ctlEmbossedRow.style.display = "none";

                var PIVIRow = document.getElementById("<%=PIVIRow.ClientID %>");
                PIVIRow.style.display = "none";

                var ReIssueRow = document.getElementById("<%=ReIssueRow.ClientID %>");
                ReIssueRow.style.display = "";
            }
        }

        function btnPivI_Click() {
            if (document.getElementById("<%=btnPivi.ClientID %>").value == "btnPivi") {
                $find('<%=txtBadgeNumber.ClientID %>').set_text("0");
                document.getElementById("<%=hfBadgeType.ClientID %>").value = '2';

                var BadgeRow = document.getElementById("<%=BadgeRow.ClientID %>");
                BadgeRow.style.display = "none";

                var ctlPersonRow = document.getElementById("<%=PersonRow.ClientID %>");
                ctlPersonRow.style.display = "none";

                var ctlOrgRow = document.getElementById("<%=OrgRow.ClientID %>");
                ctlOrgRow.style.display = "none";

                var ctltSiteNoRow = document.getElementById("<%=SiteNoRow.ClientID %>")
                ctltSiteNoRow.style.display = "none";

                var ctlCredSeries = document.getElementById("<%=CredSeriesRow.ClientID %>");
                ctlCredSeries.style.display = "none";

                var ctlFacilityRow = document.getElementById("<%=FacilityRow.ClientID %>")
                ctlFacilityRow.style.display = "none";

                var ctlEmbossedRow = document.getElementById("<%=EmbrossRowId.ClientID %>");
                ctlEmbossedRow.style.display = "none";

                var PIVIRow = document.getElementById("<%=PIVIRow.ClientID %>");
                PIVIRow.style.display = "";

                var ReIssueRow = document.getElementById("<%=ReIssueRow.ClientID %>");
                ReIssueRow.style.display = "none";
            }
        }

        function grdAccessGroups_CellEditing_ExitingEditMode(sender, eventArgs) {
            if (eventArgs.getCell().get_column().get_index() == 3 || eventArgs.getCell().get_column().get_index() == 1) {
                sender.get_behaviors().get_editingCore().commit();
            }
        }

        function grdAccessGroups_CellEditing_EnteringEditMode(sender, eventArgs) {
            if (eventArgs.getCell().get_row().get_index() == 0 && eventArgs.getCell().get_column().get_index() == 1 && document.getElementById("<%=chkDedicatedAccess.ClientID %>").checked) {
                eventArgs.getCell().get_column().set_cancel(true);
            }
        } 
    </script>
</asp:Content>
