<%@ control language="VB" autoeventwireup="false" inherits="RCC_O365_CC_UserDetail, MachSol.MachPanel.Web" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>
<%--<%@ Register Src="~/RCC/O365/CC/SfBUserDetail.ascx" TagName="SfBUserDetail" TagPrefix="UC" %>--%>
<%@ Register Src="~/RCC/O365/CC/MBDetails.ascx" TagName="MBDetails" TagPrefix="UC" %>
<%@ Register Src="~/Template/CC/Selectable_Selected_LBX.ascx" TagName="Selectable_Selected_LBX" TagPrefix="EM" %>
<%@ Register Assembly="obout_Editor" Namespace="OboutInc.Editor" TagPrefix="obout" %>

<script type="text/javascript">

    function CopyToDisplayName() {
        $get('<%= TxBx_DisplayName.ClientID%>').value = $get('<%=TxBx_FirstName.ClientID%>').value + ' ' + $get('<%=TxBx_LastName.ClientID%>').value;
        $get('<%= TxBx_UPN.ClientID%>').value = $get('<%=TxBx_DisplayName.ClientID%>').value.replace(/([^a-zA-Z0-9а-яА-Я|\.|_])+/g, '');

        try {
            $get('<%= MBDetails.AliasTxBxClientID %>').value = $get('<%=TxBx_UPN.ClientID%>').value.replace(/([а-яА-Я])+/g, '');
        }
        catch (e) {
        }
        $($get('<%= TxBx_UPN.ClientID%>')).trigger('change');
    }

    function CopyToUPN() {
        $get('<%= TxBx_UPN.ClientID%>').value = $get('<%=TxBx_DisplayName.ClientID%>').value.replace(/([^a-zA-Z0-9а-яА-Я|\.|_])+/g, '');

        try {
            $get('<%= MBDetails.AliasTxBxClientID %>').value = $get('<%=TxBx_UPN.ClientID%>').value.replace(/([а-яА-Я])+/g, '');
        }
        catch (e) {
        }

        $($get('<%= TxBx_UPN.ClientID%>')).trigger('change');
    }

    function CopyToExchangeAlias() {

        //$get('<%= TxBx_UPN.ClientID%>').value = $get('<%=TxBx_UPN.ClientID%>').value.replace(/ /g, '');

        try {
            $get('<%= MBDetails.AliasTxBxClientID %>').value = $get('<%=TxBx_UPN.ClientID%>').value.replace(/([а-яА-Я])+/g, '');
        }
        catch (e) {
        }
    }

    function CopyToPrimaryEmail() {

        try {
            $get('<%= MBDetails.PrimaryEmailTxBxClientID%>').value = $get('<%=TxBx_UPN.ClientID%>').value;
            $get('<%= MBDetails.PrimaryEmailDDLDomainCLientId%>').value = $get('<%= DDL_DomainName.ClientID%>').options[$get('<%= DDL_DomainName.ClientID%>').selectedIndex].value;
            setTimeout(function () { $($get('<%= MBDetails.PrimaryEmailDDLDomainCLientId%>')).trigger('change'); }, 500);
        }
        catch (e) {
        }

    }

    function ShowHideRoleSelection() {
        $('#' + '<%=TR_RoleSelection.ClientID%>').toggle();

        $('#' + '<%=TxBx_AlternateEmail.ClientID%>').val('');
        return false;
    }

    function toggleLicenseDetails(sender) {
        $('.linkButtonToggleDown,.linkButtonToggleUp', $(sender).parent('div')).toggle();
        $(sender).parent('div').next('div.plandetails').slideToggle('slow');
        return false;
    }

    function update() {
        try {
            if (document.getElementById('ctl00_CPH_Content_UserDetail1_MBDetails_ctl15_HF_StartDate') != null) {
                document.getElementById('ctl00_CPH_Content_UserDetail1_MBDetails_ctl15_HF_StartDate').value = document.getElementById('ctl00_CPH_Content_UserDetail1_MBDetails_ctl15_TxBx_StartDate').value;
                document.getElementById('ctl00_CPH_Content_UserDetail1_MBDetails_ctl15_HF_EndDate').value = document.getElementById('ctl00_CPH_Content_UserDetail1_MBDetails_ctl15_TxBx_EndDate').value;
            }
        }
        catch (e) {
        }
    }

    var IsLinkedADUserOptionalFieldsUpdateTriggered = false;
    function TriggerLinkedADUserOptionalFieldsUpdate(DelayInMilliSeconds) {
        if (!IsLinkedADUserOptionalFieldsUpdateTriggered) {
            IsLinkedADUserOptionalFieldsUpdateTriggered = true;
            setTimeout(function () {
                //console.log(Date.now().toString() + ': async trigger started');
                $get('<%= Btn_TriggerLinkedADUserOptionalFieldsUpdate.ClientID %>').click();
            }, DelayInMilliSeconds, null)
        }
    }

</script>

<%--<div class="breadCrumbTrackingBox" id="div_breadCrumbTrackingBox" runat="server">
    <asp:Literal ID="Ltrl_UserDetailsHeading" runat="server" EnableViewState="false"
        Text="<%$ Resources:Content,UserDetails%>" />
    <asp:Label ID="lbl_User" runat="server" />
    &nbsp;
           <asp:LinkButton ID="Lbtn_GoBack" runat="server" Text="<%$ Resources:Content,String1018%>" />
</div>--%>


<asp:Panel ID='Pnl_UserDetails' runat="server" Visible='true'>
    <div class="row">
        <div class="col-xs-12">

            <div class="header">
                <div class="displayInlineBlock">
                    <h3>
                        <asp:Literal ID="lbl_User" runat="server" />
                    </h3>
                </div>
                <asp:LinkButton ID="Lbtn_GoBack" runat="server" Text="<%$ Resources:Content,String1018 %>" CausesValidation="false"
                    class="btn btn-primary waves-effect pull-right m-t--4px" />
            </div>

            <div class="row">
                <div class="col-xs-12">
                    <div class="card">
                        <div class="header">
                            <h3>
                                <asp:Literal ID="Literal36" runat="server" Text="<%$ Resources:Content,SM400028%>" EnableViewState="false" />
                            </h3>
                        </div>
                        <div class="body">
                            <div class="row" id="TR_SelectADUser" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <asp:Literal ID="Ltrl_SelectADUser" runat="server" Text="<%$ Resources:Content,GN00001322%>"></asp:Literal>:
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <asp:DropDownList ID="Ddl_ADUsers" runat="server" onChange="TriggerLinkedADUserOptionalFieldsUpdate(60);"></asp:DropDownList>
                                    </div>
                                </div>
                            </div>
                            <div class="row" id="TR_FirstName" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    *
                                    <asp:Literal ID="Ltrl_FirstName" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN00001132%>" />:
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_FirstName" runat="server" MaxLength="28" onChange="CopyToDisplayName()"></asp:TextBox>
                                        </div>
                                        <asp:RequiredFieldValidator ID="RFV_GivenName" runat="server" ControlToValidate="TxBx_FirstName"
                                            Display="None" SetFocusOnError="True" ValidationGroup="SaveO365User" ErrorMessage="<%$ Resources:Content,GN00008064 %>">
                                        </asp:RequiredFieldValidator>
                                    </div>
                                </div>
                            </div>

                            <div class="row" id="TR_LastName" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    *
                                    <asp:Literal ID="Ltrl_LastName" runat="server" Text="<%$ Resources:Content,GN00001133%>" />:

                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_LastName" runat="server" MaxLength="28" onChange="CopyToDisplayName()" Width="200px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RFV_LastName" runat="server" ControlToValidate="TxBx_LastName"
                                                Display="None" SetFocusOnError="True" ValidationGroup="SaveO365User" ErrorMessage="<%$ Resources:Content,GN00008069 %>">
                                            </asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row" id="TR_DisplayName" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    *<asp:Literal ID="Ltrl_DisplayName" runat="server" Text='<%$Resources:Content, AD0000101%>' EnableViewState="False">                                                         
                                    </asp:Literal>:
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_DisplayName" onKeyup="CopyToUPN()" onChange="CopyToUPN()" runat="server"
                                                MaxLength="64" ValidationGroup="SaveO365User">                               
                                            </asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RFV_UsrDispName" runat="server" ControlToValidate="TxBx_DisplayName"
                                                Display="None" SetFocusOnError="True" ValidationGroup="SaveO365User" ErrorMessage="<%$ Resources:Content,GN0000255 %>">
                                            </asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row" id="TR_UPN" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    *<asp:Literal ID="Literal1" runat="server" Text='<%$Resources:Content, DEV1042%>'
                                        EnableViewState="False">
                                    </asp:Literal>:
                                </div>
                                <%--asdf--%>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_UPN" runat="server" ValidationGroup="SaveO365User" Width="200px"
                                                onKeyup="CopyToExchangeAlias();CopyToPrimaryEmail();"
                                                onChange="CopyToExchangeAlias();CopyToPrimaryEmail();" />
                                            <%--<!--TriggerLinkedADUserOptionalFieldsUpdate(6000);-->--%>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-3 col-xs-12">
                                    <div class="form-group at-the-rate">
                                        @<asp:DropDownList ID="DDL_DomainName" runat="server" onChange="CopyToExchangeAlias();CopyToPrimaryEmail();">
                                            <%--<!--TriggerLinkedADUserOptionalFieldsUpdate(6000);-->--%>
                                        </asp:DropDownList>
                                    </div>
                                </div>

                                <div class="col-sm-2 col-xs-12">
                                    <asp:Button ID="Btn_TriggerLinkedADUserOptionalFieldsUpdate" runat="server" CssClass="hide"
                                        CausesValidation="false" />
                                    <%--<asp:RegularExpressionValidator ID="REV_UPN" runat="server" ValidationExpression="<% $Resources:MPRegex, UPNSuffix %>"
                                        ErrorMessage='<%$Resources:Content, InvalidUPN%>' ControlToValidate="TxBx_UPN"
                                        Display="None" ValidationGroup="SaveO365User"></asp:RegularExpressionValidator>--%>
                                    <asp:RequiredFieldValidator ControlToValidate="TxBx_UPN" ID="RFV_UPN" runat="server"                                        
                                        Display="None" ValidationGroup="SaveO365User" ErrorMessage="<%$ Resources:Content,UPNRequired %>"></asp:RequiredFieldValidator>
                                </div>
                            </div>

                            <div class="row" id="TR_UserPassword" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    *
                                            <asp:Literal ID="Ltrl_UserPassword" runat="server" Text="<%$ Resources:Content,GN0000569 %>" />:

                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_UserPassword" runat="server" MaxLength="20" TextMode="Password"></asp:TextBox>
                                        </div>
                                    </div>
                                    <asp:Literal ID="Ltrl_EditPasswordNote" runat="server" Text="<%$ Resources:Content,UserEditPasswordNote %>" Visible="false"></asp:Literal>
                                </div>
                                <div class="col-sm-5 col-xs-12">
                                    <div class="form-group">
                                        <asp:LinkButton ID="lb_Generate" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,SMI0195%>" CausesValidation="false" TabIndex="-1">   
                                        </asp:LinkButton>
                                        <asp:RequiredFieldValidator ID="RFV_CP_Password" runat="server" ControlToValidate="TxBx_UserPassword"
                                            Display="None" SetFocusOnError="True" ValidationGroup="SaveO365User" ErrorMessage="<%$ Resources:Content,GN00008028 %>"></asp:RequiredFieldValidator>

                                    </div>
                                    <div id="Div_PasswordPolicy" runat="server" class="help-text sm"></div>
                                </div>
                            </div>

                            <div class="row" id="TR_ConfirmUserPassword" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    *
                                         <asp:Literal ID="Ltrl_ConfirmUserPassword" runat="server" Text="<%$ Resources:Content,GN0001196 %>" />:
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_ConfirmUserPassword" runat="server" MaxLength="20" TextMode="Password"></asp:TextBox>
                                        </div>
                                    </div>
                                    <asp:RequiredFieldValidator ID="RFV_CP_CPassword" runat="server" ControlToValidate="TxBx_ConfirmUserPassword"
                                        Display="None" SetFocusOnError="True" ValidationGroup="SaveO365User" ErrorMessage="<%$ Resources:Content,USM0195 %>"></asp:RequiredFieldValidator>
                                    <asp:CompareValidator ID="CompareValidator2" ControlToValidate="TxBx_UserPassword"
                                        ControlToCompare="TxBx_ConfirmUserPassword"
                                        runat="server" Display="none" ErrorMessage='<%$ Resources:Content,DGN1110005 %>'
                                        ValidationGroup="SaveO365User"></asp:CompareValidator>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <br />
                                    <asp:CheckBox ID="CB_Show" runat="server" Text="<%$ Resources:Content,FAM0049 %>" />
                                </div>
                            </div>

                            <div class="row" id="TR_ForceChangePassword" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <asp:Literal ID="Ltrl_ForceChangePassword" runat="server" Text="<%$ Resources:Content,ForcePasswordChange %>"></asp:Literal>:
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:CheckBox ID="CB_ForceChangePassword" runat="server" Text=" " />
                                </div>
                            </div>

                            <div class="row" id="TR_PasswordNeverExp" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <asp:Literal ID="Ltrl_PasswordNeverExpires" runat="server" Text="<%$ Resources:Content,PasswordNeverExpires %>"></asp:Literal>:
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:CheckBox ID="CB_PasswordNeverExpires" Text=" " runat="server" Checked="true" />
                                </div>
                                <div class="col-sm-5 col-xs-12 row-label">
                                    <%= Resources.Content.PasswordPolicyOverriddenByOrg%>
                                </div>
                            </div>
                            <div id="Tr_SendSetupOption" runat="server">
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <asp:Literal ID="Literal80" runat="server" Text="<%$ Resources:Content,GN0000752%>"
                                            EnableViewState="false">
                                        </asp:Literal>:
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <asp:CheckBox ID="ChBx_SendSetupEmail" Text=" " runat="server" />
                                    </div>
                                </div>

                                <div class="row" id="Tr_SendSetupEmail" runat="server" style="display: none;">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        *<asp:Literal ID="Literal79" runat="server" Text="<%$ Resources:Content,String389%>"
                                            EnableViewState="false">
                                        </asp:Literal>:
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_SendSetupEmail" runat="server" ValidationGroup='SaveUser'></asp:TextBox>
                                            </div>
                                        </div>
                                        <asp:RequiredFieldValidator ID="RFV_TxBx_SendSetupEmail" runat="server" ControlToValidate="TxBx_SendSetupEmail"
                                            Display="None" SetFocusOnError="True" ValidationGroup="SaveO365User" Enabled="false"
                                            ErrorMessage="<%$ Resources:Content,SetupEmailRequired %>"></asp:RequiredFieldValidator>
                                        <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage='<%$ Resources:Content,DEV1055%>'
                                            ControlToValidate="TxBx_SendSetupEmail" Display="None" ValidationExpression="<%$ Resources:MPRegex,EmailAddress%>"
                                            ValidationGroup="SaveO365User" SetFocusOnError="true"></asp:RegularExpressionValidator>--%>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-xs-12" id="TR_RolesSection" runat="server">
                    <div class="card">
                        <div class="header">
                            <h3>
                                <asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:Content,M0027%>" EnableViewState="false" />
                            </h3>
                        </div>
                        <div class="body">

                            <div class="row">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <asp:Literal ID="Ltrl_AssignRole" runat="server" Text="<%$ Resources:Content,AssignRole %>"></asp:Literal>:
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:CheckBox ID="CB_AssignRole" Text=" " runat="server" Checked="false" onChange="ShowHideRoleSelection();" />
                                </div>
                            </div>

                            <div class="row" id="TR_RoleSelection" runat="server" style="display: none;">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <asp:Literal ID="Ltrl_SelectRole" runat="server" Text="<%$ Resources:Content,SMI687 %>"></asp:Literal>:                     
                                </div>
                                <div class="col-sm-8 col-xs-12">
                                    <asp:ListBox ID="Lbx_UserRoles" CssClass="ms" runat="server" SelectionMode="Multiple"></asp:ListBox>
                                </div>
                            </div>

                            <div class="row" id="TR_AlternateEmail" runat="server" style="display: '';">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <asp:Literal ID="Ltrl_AlternateEmail" runat="server" Text="<%$ Resources:Content,GN00001526 %>"></asp:Literal>:
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_AlternateEmail" runat="server"></asp:TextBox>
                                        </div>
                                    </div>
                                   <%-- <asp:RegularExpressionValidator ID="REV_AlternateEmail" runat="server" ControlToValidate="TxBx_AlternateEmail"
                                        Display="None" ErrorMessage="<%$ Resources:Content,String1037 %>" SetFocusOnError="true" ValidationExpression="<%$ Resources:MPRegex,EmailAddress%>"
                                        ValidationGroup="SaveO365User">
                                    </asp:RegularExpressionValidator>--%>
                                    <div class="display-block clear-both width-100percent"></div>
                                    <p class="UserRole-O365">
                                        <asp:Literal ID="Ltrl_RoleAssignmentNote" runat="server" Text="<%$ Resources:Content,O365UserRoleAssignmentNote %>"></asp:Literal>
                                    </p>
                                </div>
                            </div>

                            <div class="row" id="TR_SignInStatus" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <asp:Literal ID="Ltrl_SignInStatus" runat="server" Text="<%$ Resources:Content,SignInStatus %>"></asp:Literal>:
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:RadioButton ID="Rbtn_Allowed" runat="server" Text="<%$ Resources:Content,String167 %>" GroupName="SignInStatus" Checked="true" />
                                    <asp:RadioButton ID="Rbtn_Blocked" runat="server" Text="<%$ Resources:Content,SPT002527 %>" GroupName="SignInStatus" />
                                </div>
                            </div>

                        </div>
                    </div>
                </div>

                <div class="col-xs-12" id="TR_LicensesSection" runat="server">
                    <div class="card">
                        <div class="header">
                            <h3>
                                <asp:Literal ID="Ltrl_LicenssHeading" runat="server" Text="<%$ Resources:Content,Licenses %>"></asp:Literal>
                            </h3>
                        </div>
                        <div class="body">

                            <div class="row">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <asp:Literal ID="Ltrl_UsageLocation" runat="server" Text="<%$ Resources:Content,UsageLocation %>"></asp:Literal>:                        
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:DropDownList ID="Ddl_UsageLocation" runat="server"></asp:DropDownList>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <asp:Literal ID="Ltrl_SelectLicense" runat="server" Text="<%$ Resources:Content,AssignLicenses %>"></asp:Literal>:
                                </div>
                                <div class="col-sm-8 col-xs-12">
                                    <asp:Repeater ID="Rep_Licenses" runat="server">
                                        <ItemTemplate>
                                            <div class="licenseItem">
                                                <div class="license">
                                                    <%--AutoPostBack="true" OnCheckedChanged="CBL_LicensePlans_OnSelectedIndexChanged" --%>
                                                    <asp:HiddenField ID="HF_LicId" runat="server" />
                                                    &nbsp;&nbsp;<asp:CheckBox ID="CB_LicenseOption" runat="server" />
                                                    &nbsp;&nbsp;<asp:Literal ID="Ltrl_LicenseAvailable" runat="server"></asp:Literal>
                                                    &nbsp;<asp:LinkButton ID="Lbtn_ViewDetail" runat="server" OnClientClick="return toggleLicenseDetails(this);"
                                                        CssClass="glyphicon glyphicon-plus linkButtonToggleDown"></asp:LinkButton>
                                                    &nbsp;<asp:LinkButton ID="Lbtn_LessDetail" runat="server" OnClientClick="return toggleLicenseDetails(this);"
                                                        CssClass="glyphicon glyphicon-minus linkButtonToggleUp" Style="display: none;"></asp:LinkButton>
                                                </div>
                                                <div class="plandetails" style="display: none;">
                                                    <asp:CheckBoxList ID="CBL_LicensePlans" runat="server" RepeatColumns="1" RepeatDirection="Vertical">
                                                    </asp:CheckBoxList>
                                                </div>
                                            </div>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>

                <div class="col-xs-12">

                    <div class="panel-group" id="accordion_1" role="tablist" aria-multiselectable="true">
                        <div class="panel panel-primary" id="AP_MemberOf" runat="server">
                            <div class="panel-heading" role="tab" id="headingThree_5">
                                <h4 class="panel-title">
                                    <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion_Exch" href="#collapseThree_5" aria-expanded="false" aria-controls="collapseThree_5">
                                        <%= Resources.Content.SMI0418%>
                                    </a>
                                </h4>
                            </div>
                            <div id="collapseThree_5" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree_5" aria-expanded="false">
                                <div class="panel-body">
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <EM:Selectable_Selected_LBX ID="UC_MemberOf" runat="server" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="panel panel-primary" id="AP_OptionalFields" runat="server">
                            <div class="panel-heading" role="tab" id="headingOne_1">
                                <h2 class="panel-title">
                                    <a role="button" data-toggle="collapse" data-parent="#accordion_1" href="#collapseOne_1" aria-expanded="false" aria-controls="collapseOne_1" class="collapsed">
                                        <%= Resources.Content.DGN1110535%>
                                    </a>
                                </h2>
                            </div>

                            <div id="collapseOne_1" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne_1" aria-expanded="false" style="height: 0px;">
                                <div class="panel-body">
                                    <%--id="div_optionalfields" runat="server" style='display: none; clear: both;'--%>
                                    <%--<input id="Txt" runat="server" type="text" style='display: none;' class='hfclass2' />--%>
                                    <div class="row" id="TR_Initials" runat="server">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal51" runat="server" EnableViewState="false" Text="<%$ Resources:Content,DGN1110336%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_Initials" runat="server" MaxLength="6"></asp:TextBox>
                                                </div>
                                                <asp:Literal ID="Literal6" runat="server" Text="<%$ Resources:Content,FAM00205%>" />
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal7" runat="server" EnableViewState="false" Text="<%$ Resources:Content,EmployeeId %>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_EmployeeId" runat="server" MaxLength="128"></asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row" id="TR_JobTitle" runat="server">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal39" runat="server" EnableViewState="false" Text="<%$ Resources:Content,DGN1110358%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_JobTitle" runat="server" MaxLength="128"></asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal68" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN00001134%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_Company" runat="server"></asp:TextBox>
                                                </div>
                                            </div>
                                            &nbsp;&nbsp;<asp:Literal ID="Ltl_Alert" runat="server" Text="<%$ Resources:Content,FAM00205%>" />
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal41" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0000374%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_Department" runat="server" MaxLength="64"></asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Lbl_Office" runat="server" EnableViewState="false" Text="<%$ Resources:Content,DGN1110359%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_Office" runat="server" MaxLength="128"></asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Lbl_BusinessPhone" runat="server" EnableViewState="false" Text="<%$ Resources:Content,DGN1110537%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_BusinessPhone" runat="server" MaxLength="64"></asp:TextBox>
                                                    <asp:RegularExpressionValidator ErrorMessage="<%$ Resources:Content,DGN1110070%>"
                                                        ID="RegularExpressionValidator4" runat="server" ControlToValidate="TxBx_BusinessPhone"
                                                        Display="None" SetFocusOnError="True" ValidationExpression="^([+]?[\s0-9()-]{5,20})$"
                                                        ValidationGroup="SaveO365User"></asp:RegularExpressionValidator>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row" id="TR_Mobile" runat="server">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal31" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN00001524%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_Mobile" runat="server" MaxLength="64"></asp:TextBox>
                                                    <asp:RegularExpressionValidator ErrorMessage="<%$ Resources:Content,DGN1110070%>"
                                                        ID="RegularExpressionValidator3" runat="server" ControlToValidate="TxBx_Mobile"
                                                        Display="None" SetFocusOnError="True" ValidationExpression="^([+]?[\s0-9()-]{5,20})$"
                                                        ValidationGroup="SaveO365User"></asp:RegularExpressionValidator>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row" id="TR_Fax" runat="server">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal32" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0000886%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_Fax" runat="server" MaxLength="64"></asp:TextBox>
                                                </div>
                                            </div>
                                            <ajax:FilteredTextBoxExtender id="FilteredTextBoxExtender2" runat="server" targetcontrolid="TxBx_Fax"
                                                filtertype="Numbers,Custom" validchars="+-() ">
                                            </ajax:FilteredTextBoxExtender>
                                        </div>
                                    </div>

                                    <div class="row" id="TR_HomePhone" runat="server">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal63" runat="server" EnableViewState="false" Text="<%$ Resources:Content,DGN1110538%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_HomePhone" runat="server"></asp:TextBox>
                                                </div>
                                            </div>
                                            <asp:RegularExpressionValidator ErrorMessage="<%$ Resources:Content,DGN1110070%>"
                                                ID="RegularExpressionValidator9" runat="server" ControlToValidate="TxBx_HomePhone"
                                                Display="None" SetFocusOnError="True" ValidationExpression="^([+]?[\s0-9()-]{5,20})$"
                                                ValidationGroup="mbdetails"></asp:RegularExpressionValidator>
                                            &nbsp;&nbsp;<asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:Content,FAM00205%>" />
                                        </div>
                                    </div>

                                    <div class="row" id="TR_WebPage" runat="server">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal75" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0001120%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_WebPage" runat="server"></asp:TextBox>
                                                </div>
                                            </div>
                                            <asp:RegularExpressionValidator ID="REV_WebPage" runat="server" ValidationGroup="order"
                                                ControlToValidate="TxBx_WebPage" Display="None" ValidationExpression="(?<http>(http:[/][/]|www.)([a-z]|[A-Z]|[0-9]|[/.]|[~])*)"></asp:RegularExpressionValidator>
                                            &nbsp;&nbsp;<asp:Literal ID="Literal4" runat="server" Text="<%$ Resources:Content,FAM00205%>" />
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal26" runat="server" EnableViewState="false" Text="<%$ Resources:Content,DGN1110530%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox runat="server" ID="TxBx_Address"></asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal27" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0000880%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox runat="server" ID="TxBx_City" MaxLength="128"></asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal28" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN00001313%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_State" runat="server" MaxLength="128"></asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal29" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN00001522%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_Zip" runat="server" MaxLength="40"></asp:TextBox>
                                                </div>
                                            </div>
                                            <ajax:filteredtextboxextender id="FilteredTextBoxExtender1" runat="server" targetcontrolid="TxBx_Zip"
                                                filtertype="Numbers,UppercaseLetters,LowercaseLetters,Custom" validchars="-_ ">
                                            </ajax:filteredtextboxextender>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal30" runat="server" EnableViewState="false" Text="<%$ Resources:Content,FAM0058%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_Countries" runat="server">
                                                    </asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:Literal ID="Literal64" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN00001336%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <%--<div class="form-group">
                                                        <div class="form-line">--%>
                                            <asp:TextBox ID="TxBx_Notes" runat="server" TextMode="MultiLine" Width="100%" Rows="5"></asp:TextBox>
                                            <%--</div>
                                                    </div>--%>
                                        </div>

                                    </div>

                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                        </div>
                                        <div class="col-sm-8 col-xs-12">
                                            <asp:Literal ID="Literal5" runat="server" Text="<%$ Resources:Content,FAM00205%>" />
                                        </div>
                                    </div>


                                </div>
                            </div>
                        </div>

                    </div>
                </div>

            </div>

            <div id="TR_ServicesDetail" runat="server">
                <asp:Button ID="Btn_ServicesDetailTrigger" runat="server" Style="display: none;" />
                <ajax:UpdatePanel ID="UP_ServicesDetails" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Panel ID="Pnl_MailboxDetails" runat="server" Visible="false">

                            <UC:MBDetails ID="MBDetails" runat="server" />

                        </asp:Panel>
                        <%--
                                <br />
                                <asp:Panel ID="Pnl_SkypeforBusiness" runat="server" Visible="false">

                                    <UC:SfBUserDetail ID="SfBUserDetail1" runat="server" />

                                </asp:Panel>--%>
                    </ContentTemplate>
                    <Triggers>
                        <ajax:AsyncPostBackTrigger ControlID="Btn_ServicesDetailTrigger" EventName="Click" />
                    </Triggers>
                </ajax:UpdatePanel>

            </div>

            <div class="row" id="TR_OperationButtons" runat="server">
                <div class="col-xs-12">
                    <asp:Button ID="Btn_SaveUser" runat="server" OnClientClick="update();" Text="<%$ Resources:Content,GN0000281 %>"
                        class="btn btn-primary waves-effect btnAction" CausesValidation="true" ValidationGroup="SaveO365User" />
                    <asp:Button ID="Btn_Cancel" runat="server" Text="<%$ Resources:Content,GN0000572 %>"
                        class="btn btn-primary waves-effect" CausesValidation="false" />
                    <asp:ValidationSummary ID="VS_SaveUser" runat="server" ShowMessageBox="true" ShowSummary="false"
                        ValidationGroup="SaveO365User" HeaderText="<%$ Resources:Content, EM000001%>" />
                </div>
            </div>

        </div>
    </div>

</asp:Panel>

