<%@ page language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="RCC_CRM_CRMAccountDetail, MachSol.MachPanel.Web" title="Untitled Page" %>

<%@ Register Src="~/RCC/CRM/CC/EditCRMUser.ascx" TagName="EditUser" TagPrefix="UC" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>
<%@ Register Src="~/RCC/CC/CRMBulkUser.ascx" TagName="BulkUser" TagPrefix="UC" %>
<%@ Register Src="~/RCC/Exchange/CC/GroupActions.ascx" TagName="GroupActions" TagPrefix="UC" %>
<%@ Register Src="~/RCC/CRM/CC/CRMGroupOperations.ascx" TagName="GroupOperations"
    TagPrefix="UC" %>

<%@ Register Src="~/RCC/Exchange/CC/AccountGroupActions.ascx" TagName="AccountGroupActions" TagPrefix="EM" %>

<%@ Register Src="~/RCC/Clients/CC/GetComments.ascx" TagName="GetComments" TagPrefix="EM" %>
<%@ Register Src="~/RCC/Clients/CC/CRM.ascx" TagName="CRM" TagPrefix="EM" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="System.Web.UI" TagPrefix="cc1" %>
<%@ Register Src="~/Template/CC/Selectable_Selected_LBX.ascx" TagName="AddSelectableSelected" TagPrefix="EM" %>

<asp:Content ID="Content5" ContentPlaceHolderID="CPH_Content" runat="Server">

    <div class="col-xs-12">
        <div class="card">
            <div class="header" id="hdrGroupAction" runat="server">
                <h3>
                    <%= Resources.Content.L0086%>

                    <asp:HyperLink ID="LB_SubscriptionID" runat="server"></asp:HyperLink>
                </h3>
            </div>
            <div class="body">
                <div class="clearfix">

                    <asp:Button ID="Btn_RefreshTab" CssClass="RefreshTab" runat="server" Style="display: none;" />
                    <EM:TabContainer ID="TC_Accounts" runat="server" OnClientActiveTabChanged="loadTabPanel">
                        <EM:TabPanel ID="Tab_GeneralSettings" runat="server" HeaderText='<%$ Resources:Content,SM400028%>'>
                            <ContentTemplate>
                                <asp:Button ID="Btn_Tab0" runat="server" Style="display: none;" />
                                <asp:Panel ID="Pnl_TabContent0" runat="server">

                                    <EM:CRM ID="CRM01" runat="server" />
                                </asp:Panel>
                            </ContentTemplate>
                        </EM:TabPanel>
                        <%--Portal tab--%>

                        <EM:TabPanel ID="Tab_Organization" runat="server" HeaderText="<%$ Resources:Content,L0035%>">
                            <ContentTemplate>
                                <asp:Button ID="Btn_Tab1" runat="server" Style="display: none;" />
                                <asp:Panel ID="Pnl_TabContent1" runat="server" Visible="false">
                                    <div class="row" id="Tbl_detail" runat="server">
                                        <div class="col-xs-12">
                                            <div class="card">
                                                <div class="body">
                                                    <div class="row">
                                                        <div class="col-md-3 col-xs-12 row-label">
                                                            <asp:Literal ID="Literal28" runat="server" Text="<%$ Resources:Content,GN000125%>"
                                                                EnableViewState="false"></asp:Literal>:
                                                        </div>
                                                        <div class="col-md-9 col-xs-12">
                                                            <asp:Label ID="Lbl_DomainName" runat="server"></asp:Label>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-md-3 col-xs-12 row-label">
                                                            <asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:Content,GN0000280%>"
                                                                EnableViewState="false"></asp:Literal>:
                                                        </div>
                                                        <div class="col-md-9 col-xs-12">
                                                            <asp:Label ID="Lbl_Title" runat="server"></asp:Label>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-md-3 col-xs-12 row-label">
                                                            <asp:Literal ID="Literal5" runat="server" Text="<%$ Resources:Content,GN0000981%>"
                                                                EnableViewState="false"></asp:Literal>:
                                                        </div>
                                                        <div class="col-md-9 col-xs-12">
                                                            <asp:Label ID="Lbl_URL" runat="server"></asp:Label>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-md-3 col-xs-12 row-label">
                                                            <asp:Literal ID="Literal4" runat="server" Text="<%$ Resources:Content,DGN1110360%>"
                                                                EnableViewState="false"></asp:Literal>:
                                                        </div>
                                                        <div class="col-md-9 col-xs-12">
                                                            <asp:Label ID="Lbl_Manager" runat="server"></asp:Label>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-md-3 col-xs-12 row-label">
                                                            <asp:Literal ID="Literal9" runat="server" Text="<%$ Resources:Content,String326%>"
                                                                EnableViewState="false"></asp:Literal>:
                                                        </div>
                                                        <div class="col-md-9 col-xs-12">
                                                            <asp:Label ID="Lbl_Email" runat="server"></asp:Label>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-md-3 col-xs-12 row-label">
                                                            <asp:Literal ID="Literal6" runat="server" Text="<%$ Resources:Content,String385%>"
                                                                EnableViewState="false"></asp:Literal>:
                                                        </div>
                                                        <div class="col-md-9 col-xs-12">
                                                            <asp:Label ID="Lbl_Status" runat="server">
                                                            </asp:Label>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-md-3 col-xs-12 row-label">
                                                            <asp:Literal ID="Literal12" runat="server" Text="<%$ Resources:Content,String261%>"
                                                                EnableViewState="false"></asp:Literal>:
                                                        </div>
                                                        <div class="col-md-9 col-xs-12">
                                                            <asp:LinkButton ID="LB_CRM" runat="server" Text="<%$ Resources:Content,String260%>" CssClass="btn btn-primary btnAction"></asp:LinkButton>
                                                        </div>
                                                    </div>
                                                    <div class="row" style="display: none">
                                                        <div class="col-md-3 col-xs-12 row-label">
                                                        </div>
                                                        <div class="col-md-9 col-xs-12">
                                                            <asp:Button ID="btn_Edit" SkinID="editButton" Text='<%$ Resources:Content,GN0000276%>'
                                                                runat="server" CssClass="btn btn-primary btnAction" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <%--   ////////////////////////////////////////////////////--%>
                                    <%--Edit Organization Form--%>
                                    <table id="Tbl_EditOrg1" runat="server" visible="false" class="tblNewListing">
                                        <tr>
                                            <td colspan="2" class="Heading">
                                                <asp:Label
                                                    ID="Label2" runat="server" Text="<%$ Resources:Content,GN0000276%>" EnableViewState="false" />
                                            </td>
                                        </tr>
                                        <tr runat="server" id="Tr_DispName">
                                            <td class="shade" width="25%">*
                                <asp:Literal ID="Literal23" runat="server" Text="<%$ Resources:Content,L0030%>" EnableViewState="false" />:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxBx_DispName" runat="server" MaxLength="200"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="TxBx_DispName"
                                                    Display="None" SetFocusOnError="True" ValidationGroup="CRM"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr runat="server" id="Tr_UniqName">
                                            <td class="shade">
                                                <asp:Literal ID="Literal24" runat="server" Text="<%$ Resources:Content,L0032%>" EnableViewState="false" />:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxBx_UniqueName" TextMode="SingleLine" runat="server" MaxLength="30"
                                                    Enabled="false"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td>
                                                <asp:ValidationSummary ID="ValidationSummary2" runat="server" HeaderText='<%$ Resources:Content, EM000001 %>'
                                                    ShowMessageBox="True" ShowSummary="False" ValidationGroup="CRM" />
                                                <asp:Button runat="server" ID="Btn_editConfirm" SkinID="saveButton" Text="<%$ Resources:Content,GN0000281%>"
                                                    ValidationGroup="CRM" CssClass="btnAction" />
                                                <asp:Button runat="server" ID="Btn_editCancel" Text="<%$ Resources:Content,GN0000572%>"
                                                    SkinID="cancelButton" CausesValidation="false" />
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                            </ContentTemplate>
                        </EM:TabPanel>
                        <%--CRM Domains--%>
                        <EM:TabPanel ID="Tab_CRMDomains" runat="server" HeaderText='<%$ Resources:Content, String288 %>'>
                            <ContentTemplate>
                                <asp:Button ID="Btn_Tab2" runat="server" Style="display: none;" />
                                <asp:Panel ID="Pnl_TabContent2" runat="server" Visible="false">
                                    <asp:Panel ID="Pnl_Domain" runat="server">
                                        <asp:GridView CssClass="table table-hover table-bordered table-striped table-responsive" EmptyDataText='<%$ Resources:Content, GN00001375 %>'
                                            ID="GV_Domains" runat="server" AutoGenerateColumns="false" AllowPaging="true"
                                            DataKeyNames='DomainID,DomainName'>
                                            <Columns>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,GN0000653%>' >
                                                    <ItemTemplate>
                                                        <%--<asp:Label ID="Lbl_DomainName" runat="server"></asp:Label>--%>
                                                        <asp:HyperLink ID="HL_DomainName" Text='<%#DataBinder.Eval(Container, "DataItem.DomainName")%>' runat="server"></asp:HyperLink>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,GN000171%>' HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2"
                                                    HeaderStyle-HorizontalAlign="Center">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lbl_IsDefaultDomain" runat="server"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,Verified%>' HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2"
                                                    HeaderStyle-HorizontalAlign="Center">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Lbl_IsVerified" runat="server"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,GN0000360%>' HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                                    <ItemTemplate>
                                                        <EM:ConfirmButtonExtender ID="CBE_Remove" ConfirmText="<%$ Resources:Content,CBE001%>"
                                                            TargetControlID="LB_Delete" runat="server">
                                                        </EM:ConfirmButtonExtender>
                                                        <asp:LinkButton ID="LB_SetDefault" Text='<%$ Resources:Content,GN000166%>' SkinID="LinkButtonDefault"
                                                            CommandName="SetDefault" runat="server" CssClass="btn btn-primary btn-sm btnAction" />
                                                        <asp:LinkButton ID="LB_Delete" Text='<%$ Resources:Content,GN0000377%>' SkinID="linkButtonDelete"
                                                            CommandName="DeleteRow" runat="server" CssClass="btn btn-primary btn-sm btnAction" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <%--PagerTemplate Start--%>
                                            <PagerTemplate>
                                                <EM:Pager ID="Pager1" runat="server" />
                                            </PagerTemplate>
                                            <%--PagerTemplate End--%>
                                        </asp:GridView>

                                        <%-- Information--%>

                                        <asp:Panel ID="Pnl_addDomain" runat="server" DefaultButton="Btn_AddNewDmn">
                                            <br />
                                            <div class="row">
                                                <div class="col-xs-12">
                                                    <div class="card">
                                                        <div class="body">
                                                            <div class="row">
                                                                <div class="col-sm-2 col-xs-12 row-label">
                                                                    *
                                                    <asp:Literal ID="Literal22" runat="server" EnableViewState="false" Text='<%$ Resources:Content,DGN1110426%>'></asp:Literal>:

                                                                </div>
                                                                <div class="col-sm-4 col-xs-12">
                                                                    <div class="form-group">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_DomainName" runat="server"></asp:TextBox>
                                                                            <asp:RequiredFieldValidator ID="RFV_DomainName" runat="server" ControlToValidate="TxBx_DomainName"
                                                                                ValidationGroup="Dom" SetFocusOnError="true" Display="None" ErrorMessage="<%$ Resources:Content,String1039%>"></asp:RequiredFieldValidator>

                                                                            <%--<asp:RegularExpressionValidator ID="REV_Domain" runat="server" ValidationGroup="Dom"
                                                                                ControlToValidate="TxBx_DomainName" ErrorMessage="Please enter a valid domain name."
                                                                                Display="None" ValidationExpression="^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$"></asp:RegularExpressionValidator>--%>
                                                                            <asp:ValidationSummary ID="VS_Domain" runat="server" ValidationGroup="Dom" ShowMessageBox="true"
                                                                                ShowSummary="false" />
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="row">
                                                                <div class="col-sm-2 col-xs-12 row-label">
                                                                </div>
                                                                <div class="col-sm-4 col-xs-12">
                                                                    <div class="form-group">
                                                                        <asp:CheckBox ID="ChBx_IsDefaultDomain" runat="server" Text='<%$ Resources:Content,GN000166%>' />
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="row">
                                                                <div class="col-xs-12">
                                                                    <asp:Button ID="Btn_AddNewDmn" ValidationGroup="Dom" runat="server" Text="<%$ Resources:Content,GN0000281%>"
                                                                        SkinID="saveButton" CssClass="btn btn-primary btnAction" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                        </asp:Panel>

                                    </asp:Panel>
                                </asp:Panel>
                            </ContentTemplate>
                        </EM:TabPanel>
                        <%--Business Units--%>
                        <EM:TabPanel ID='Tab_BUs' runat='server' HeaderText="<%$ Resources:Content,String527%>">
                            <ContentTemplate>
                                <asp:Button ID='Btn_Tab3' runat='server' Style='display: none;' Text='' />
                                <asp:Panel ID='Pnl_TabContent3' runat='server' Visible='false'>
                                    <asp:Panel ID='Pnl_Listing' runat='server'>
                                        <asp:Panel ID="Pnl_SearchBU" runat="server" DefaultButton="Btn_SearchBU">
                                            <div class="row">
                                                <div class="panel-group search-panel" id="AS_CRMBusinessUnits" role="tablist" aria-multiselectable="true">
                                                    <div class="col-xs-12" role="tab" id="SH_CRMBusinessUnits">
                                                        <div class="card">
                                                            <div class="header" role="button" data-toggle="collapse" data-parent="#AS_CRMBusinessUnits" href="#<%= CSB_CRMBusinessUnits.ClientID%>" aria-expanded="true" aria-controls="SH_CRMBusinessUnits">
                                                                <h3>
                                                                    <%= Resources.Content.GN0000395%>
                                                                </h3>
                                                            </div>
                                                            <div id="CSB_CRMBusinessUnits" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_ClientList" aria-expanded="false">
                                                                <div class="row">
                                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                                        <div class="form-group form-float">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_SearchBU" runat="server" MaxLength="99" Width="90%"></asp:TextBox>
                                                                                <asp:Label ID="Lbl_BU" runat="server" EnableViewState="false" Text="<%$ Resources:Content,USM0078%>" CssClass="form-label"></asp:Label>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                                        <div class="form-group form-float">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_SearchParentBU" runat="server" MaxLength="99" Width="90%"></asp:TextBox>
                                                                                <asp:Label ID="Lbl_ParentBU" runat="server" EnableViewState="false" Text="<%$ Resources:Content,SMI0196%>" CssClass="form-label"></asp:Label>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                                        <div class="form-group form-float">
                                                                            <asp:DropDownList ID='Ddl_SearchBUStatus' runat='server'>
                                                                                <asp:ListItem Text="<%$ Resources:Content,GN0000934%>" Value='-1' Selected='True'></asp:ListItem>
                                                                                <asp:ListItem Text="<%$ Resources:Content,USM0103%>" Value='0'></asp:ListItem>
                                                                                <asp:ListItem Text="<%$ Resources:Content,SMI0366%>" Value='1'></asp:ListItem>
                                                                            </asp:DropDownList>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                                        <div class="form-group form-float">
                                                                            <asp:Button ID="Btn_SearchBU" SkinID="searchButton" runat="server" Text="<%$ Resources:Content,GN0000391%>" CssClass="btn btn-primary" />
                                                                            <asp:Button ID="Btn_ClearBU" SkinID="searchButton" runat="server" Visible='false'
                                                                                Text="<%$ Resources:Content,String289 %>" CssClass="btn btn-primary" />
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                        </asp:Panel>

                                        <asp:Panel ID="Pnl_BusinessUnits" runat="server">
                                            <%--Add Button--%>
                                            <div class="row Div_OpsRow" id="Div_BUOperations" runat="server">
                                                <div class="col-xs-12">
                                                    <div class="card">
                                                        <div class="header">
                                                            <h3>
                                                                <%= Resources.Content.SMI0423%>                                                                                                                                 
                                                            </h3>
                                                        </div>
                                                        <div class="body">
                                                            <asp:Button ID="Btn_AddBU" runat="server" Text="<%$ Resources:Content,SMI0198%>"
                                                                SkinID="addButton" CssClass="btn btn-primary btnAction" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <asp:GridView CssClass="table table-hover table-bordered table-striped table-responsive" EmptyDataText="<%$ Resources:Content, GN00001375 %>"
                                                ID="GV_BUListing" runat="server" AutoGenerateColumns="false" AllowSorting='true'
                                                DataKeyNames='BUName,CrmParentId,IsDisabled,CrmId,BUID'>
                                                <Columns>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,USM0078%>" SortExpression='BUName'
                                                        HeaderStyle-CssClass="col-xs-4" ItemStyle-CssClass="col-xs-4">
                                                        <ItemTemplate>
                                                            <asp:Literal ID='Ltrl_BUName' runat='server' Text='<%# Eval("BUName") %>'></asp:Literal>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,SMI0196%>" SortExpression='ParentBUName'
                                                        HeaderStyle-CssClass="col-xs-5" ItemStyle-CssClass="col-xs-5">
                                                        <ItemTemplate>
                                                            <asp:Literal ID='Ltrl_ParentBUName' runat='server' Text='<%# Eval("ParentBUName") %>'></asp:Literal>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,GN0000360%> " HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="LB_EditBU" CommandArgument='<%#Databinder.Eval(Container,"DataItem.BUID") %>'
                                                                runat="server" Text="<%$ Resources:Content,GN0000276%>" SkinID="linkButtonEdit"
                                                                CommandName="EditBU" Visible='<%# Eval("ParentBUID") > 0%>' CssClass="btn btn-primary" />
                                                            <asp:LinkButton ID="Lbtn_EDable" runat="server" CommandName='<%# IIf(Eval("IsDisabled"), "enable", "disable")%>'
                                                                Text='<%# IIf(Eval("IsDisabled"), Resources.Content.GN00001024, Resources.Content.GN00001025)%>'
                                                                Visible='<%# Eval("ParentBUID") > 0%>' CssClass="btn btn-primary btnAction" />
                                                            <asp:LinkButton ID="LB_Delete" Text='<%$ Resources:Content,GN0000377%>' Visible='<%# Eval("ParentBUID") > 0%>'
                                                                SkinID="linkButtonDelete"
                                                                CommandName="DeleteRow" runat="server" CssClass="btn btn-primary btnAction" />
                                                            <EM:ConfirmButtonExtender ID="CBE_Remove" ConfirmText="<%$ Resources:Content,CBE001%>"
                                                                TargetControlID="LB_Delete" runat="server">
                                                            </EM:ConfirmButtonExtender>

                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                        </asp:Panel>
                                    </asp:Panel>
                                    <asp:Panel ID='Pnl_AddBU' runat='server' Visible='false'>
                                        <div class="row">
                                            <div class="col-xs-12">
                                                <div class="card">
                                                    <div class="header">
                                                        <h3>
                                                            <%= Resources.Content.SMI0198%>                                                                                                                                 
                                                        </h3>
                                                    </div>
                                                    <div class="body">
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Literal29" runat="server" EnableViewState="false" Text="<%$ Resources:Content,SMI0196%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID='Ddl_ParentBU' runat='server'>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Ltrl_BUName" runat="server" EnableViewState="false" Text="<%$ Resources:Content,SMI0199%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID='TxBx_AddBUName' runat='server' ValidationGroup="AddBU"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID='RFV_AddBUName' runat='server' ControlToValidate='TxBx_AddBUName'
                                                                            Display='None' ErrorMessage='Business Unit Name is mandatory' SetFocusOnError='true'
                                                                            ValidationGroup="AddBU"></asp:RequiredFieldValidator>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-12">

                                                                <asp:ValidationSummary ID="VS_AddBU" runat="server" HeaderText='<%$ Resources:Content, EM000001 %>'
                                                                    ShowMessageBox="True" ShowSummary="False" ValidationGroup="AddBU" />
                                                                <asp:Button ID="Btn_BUAdd" ValidationGroup="AddBU" runat="server" SkinID="saveButton"
                                                                    Text="<%$ Resources:Content,GN0000281%>" CssClass="btn btn-primary btnAction" />
                                                                <asp:Button ID="Btn_BUAddClose" runat="server" SkinID="cancelButton"
                                                                    Text="<%$ Resources:Content,GN0000572%>" CausesValidation='false' CssClass="btn btn-primary" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>
                                    <asp:Panel ID='Pnl_EditBU' runat='server' Visible='false'>
                                        <div class="row">
                                            <div class="col-xs-12">
                                                <div class="card">
                                                    <div class="header">
                                                        <h3>
                                                            <%= Resources.Content.SMI0200%>                                                                                                                                 
                                                        </h3>
                                                    </div>
                                                    <div class="body">
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Literal38" runat="server" EnableViewState="false" Text="<%$ Resources:Content,SMI0196%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID='Ddl_EditParentBU' runat='server'>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Literal39" runat="server" EnableViewState="false" Text="<%$ Resources:Content,SMI0199%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">

                                                                        <asp:HiddenField ID='HF_EditBUID' runat='server' />
                                                                        <asp:HiddenField ID='HF_EditBUCrmId' runat='server' />
                                                                        <asp:TextBox ID='TxBx_EditBUName' runat='server' ValidationGroup="EditBU"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID='RFV_EditBUName' runat='server' ControlToValidate='TxBx_EditBUName'
                                                                            Display='None' ErrorMessage='Business Unit Name is mandatory' SetFocusOnError='true'
                                                                            ValidationGroup="EditBU"></asp:RequiredFieldValidator>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-12">
                                                                <asp:ValidationSummary ID="VS_EditBU" runat="server" HeaderText='<%$ Resources:Content, EM000001 %>'
                                                                    ShowMessageBox="True" ShowSummary="False" ValidationGroup="EditBU" />
                                                                <asp:Button ID="Btn_EditBUSave" ValidationGroup="EditBU" runat="server" SkinID="saveButton"
                                                                    Text="<%$ Resources:Content,GN0000281%>" CssClass="btn btn-primary btnAction" />
                                                                <asp:Button ID="Btn_EditBUClose" runat="server" SkinID="cancelButton"
                                                                    Text="<%$ Resources:Content,GN0000572%>" CausesValidation='false' CssClass="btn btn-primary" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>
                                </asp:Panel>
                            </ContentTemplate>
                        </EM:TabPanel>
                        <%--Users tab--%>
                        <EM:TabPanel ID="Tab_Users" runat="server" HeaderText="<%$ Resources:Content,USM0025%>">
                            <ContentTemplate>
                                <asp:Button ID="Btn_Tab4" runat="server" Style="display: none;" />
                                <asp:Panel ID="Pnl_TabContent4" runat="server" Visible="false">
                                    <asp:Panel ID="Pnl_Search" runat="server" DefaultButton="Btn_Search">

                                        <div class="row">
                                            <div class="panel-group search-panel" id="AS_CRMUsers" role="tablist" aria-multiselectable="true">
                                                <div class="col-xs-12" role="tab" id="SH_CRMUsers">
                                                    <div class="card">
                                                        <div class="header" role="button" data-toggle="collapse" data-parent="#AS_CRMUsers" href="#<%= CSB_CRMUsers.ClientID%>" aria-expanded="true" aria-controls="SH_CRMUsers">
                                                            <h3>
                                                                <%= Resources.Content.GN0000395%>
                                                            </h3>
                                                        </div>
                                                        <div id="CSB_CRMUsers" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_CRMUsers" aria-expanded="false">
                                                            <div class="row">
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">
                                                                            <td>
                                                                                <asp:TextBox ID="TxBx_UserNames" runat="server" MaxLength="99" Width="90%"></asp:TextBox>
                                                                                <asp:Label ID="Label144" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0000567%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_DisplayNames" runat="server" MaxLength="99" Width="90%"></asp:TextBox>
                                                                            <asp:Label ID="Label66" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN00001113%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_Emails" runat="server" MaxLength="99" Width="90%"></asp:TextBox>
                                                                            <EM:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" TargetControlID="TxBx_Emails"
                                                                                FilterType="Numbers,UppercaseLetters,LowercaseLetters,Custom" ValidChars=".-_@ ">
                                                                            </EM:FilteredTextBoxExtender>
                                                                            <asp:Label ID="Label55" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0000652%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <asp:DropDownList ID="DDL_Status" runat="server">
                                                                            <asp:ListItem Text="<%$ Resources:Content, GN0000261 %>" Value="-1" Selected="True"></asp:ListItem>
                                                                            <asp:ListItem Text="<%$ Resources:Content, GN000195 %>" Value="1"></asp:ListItem>
                                                                            <asp:ListItem Text="<%$ Resources:Content, GN0000860 %>" Value="2"></asp:ListItem>
                                                                        </asp:DropDownList>
                                                                    </div>
                                                                </div>
                                                                <div class="clearfix"></div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_Address" runat="server" MaxLength="200"></asp:TextBox>
                                                                            <asp:Label ID="Label20" runat="server" EnableViewState="false" Text="<%$ Resources:Content,strAddress%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">

                                                                            <asp:TextBox ID="TxBx_City" runat="server" MaxLength="70"></asp:TextBox>

                                                                            <asp:Label ID="Label21" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0000880%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_State" runat="server" MaxLength="70"></asp:TextBox>
                                                                            <asp:Label ID="Label22" runat="server" EnableViewState="false" Text="<%$ Resources:Content,DEV1130%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">

                                                                            <asp:TextBox ID="TxBx_Zip" runat="server" MaxLength="40"></asp:TextBox>
                                                                            <asp:Label ID="Label1" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN00001081%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">

                                                                            <asp:TextBox ID="TxBx_SAM" runat="server" MaxLength="100"></asp:TextBox>
                                                                            <asp:Label ID="Label19" runat="server" EnableViewState="false" Text="<%$ Resources:Content,strSAMAccountName%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_JobTitle" runat="server" MaxLength="80"></asp:TextBox>
                                                                            <asp:Label ID="Label26" runat="server" EnableViewState="false" Text="<%$ Resources:Content,DGN1110358%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_Company" runat="server" MaxLength="80"></asp:TextBox>
                                                                            <asp:Label ID="Label27" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN00001134%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_Department" runat="server" MaxLength="80"></asp:TextBox>
                                                                            <asp:Label ID="Label28" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0000374%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_Office" runat="server" MaxLength="80"></asp:TextBox>
                                                                            <asp:Label ID="Label29" runat="server" EnableViewState="false" Text="<%$ Resources:Content,DGN1110359%>" CssClass="form-label"></asp:Label>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                                    <div class="form-group form-float">
                                                                        <asp:DropDownList ID="Ddl_Country" runat="server"></asp:DropDownList>
                                                                    </div>
                                                                </div>
                                                                <div class="col-xs-12">
                                                                    <asp:Button ID="Btn_Search" SkinID="searchButton" runat="server" Text="<%$ Resources:Content,GN0000391%>" CssClass="btn btn-primary" />
                                                                    <asp:Button ID="Btn_Clear" Visible="false" SkinID="searchButton" runat="server" Text="<%$ Resources:Content,String289 %>" CssClass="btn btn-primary" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        </div>
                                    </asp:Panel>

                                    <asp:Panel ID="Pnl_Users" runat="server">
                                        <%--Uses Operations--%>
                                        <div class="row Div_OpsRow" id="Div_UserOperations" runat="server">
                                            <div class="col-xs-12">
                                                <div class="card">
                                                    <div class="header">
                                                        <h3>
                                                            <%= Resources.Content.GN00001320%>                                                                                                                                 
                                                        </h3>
                                                    </div>
                                                    <div class="body">
                                                        <asp:Button ID="Btn_AddNewUser" runat="server" Text="<%$ Resources:Content,DEV1101%>"
                                                            SkinID="addButton" CssClass="btn btn-primary btnAction" />
                                                        <asp:Button ID="Btn_AddBulkUser" runat="server" SkinID="defaultButton" Text='<%$ Resources:Content,Str00089%>' CssClass="btn btn-primary btnAction" />
                                                        <asp:Button ID="Btn_GroupActions" runat="server" SkinID="defaultButton" Text="<%$ Resources:Content,String7772%>" CssClass="btn btn-primary btnAction" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <%--Quota code here--%>
                                        <asp:GridView CssClass="table table-hover table-bordered table-striped table-responsive" EmptyDataText="<%$ Resources:Content, GN00001375 %>"
                                            ID="GV_Users" AllowPaging="True" runat="server" AutoGenerateColumns="false" AllowSorting='true'
                                            DataKeyNames="UserId,UserName,ADUserId,ADDomainID">
                                            <Columns>
                                                <asp:TemplateField HeaderText="<%$ Resources:Content,strUser%>" SortExpression="DisplayName" HeaderStyle-CssClass="col-sm-5">
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="LB_Name" CommandArgument='<%#Databinder.Eval(Container,"DataItem.UserID") %>' CommandName="Edit_User" runat="server"></asp:LinkButton>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="<%$ Resources:Content,DGN1110431%>" HeaderStyle-CssClass="col-xs-6" ItemStyle-CssClass="col-xs-6">
                                                    <ItemTemplate>
                                                        <table class="table small">
                                                            <tr class="row">
                                                                <td class="row-label col-xs-2"><%= Resources.Content.String385%>:</td>
                                                                <td class="col-xs-5">
                                                                    <asp:LinkButton ID="LB_Status" CommandArgument='<%#Databinder.Eval(Container,"DataItem.UserID") %>' CommandName="Edit_User" runat="server"></asp:LinkButton>
                                                                </td>
                                                                <td class="row-label col-xs-3"><%= Resources.Content.GN00001496%>:</td>
                                                                <td class="col-xs-2">
                                                                    <asp:Label ID="Lbl_DateCreated" runat="server"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr class="row">
                                                                <td class="row-label col-xs-2"><%= Resources.Content.String353%>:</td>
                                                                <td class="col-xs-5">
                                                                    <asp:Label ID="Lbl_Role" runat="server"></asp:Label></td>

                                                                <td class="row-label col-xs-3"><%= Resources.Content.USM0078%>:</td>
                                                                <td class="col-xs-2">
                                                                    <asp:Literal ID='Ltrl_BUName' runat='server' Text='<%# Eval("BUName") %>'></asp:Literal>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </ItemTemplate>
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="<%$ Resources:Content,GN0000360%> " HeaderStyle-CssClass="col-xs-1">
                                                    <ItemTemplate>
                                                        <ul class="option-menu" id="ULOption" runat="server">
                                                            <li class="dropdown">
                                                                <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                                                                    <i class="material-icons">menu</i>
                                                                </a>
                                                                <ul class="dropdown-menu pull-right">
                                                                    <li>
                                                                        <asp:LinkButton ID="LB_Edit" CommandArgument='<%#Databinder.Eval(Container,"DataItem.UserID") %>'
                                                                            runat="server" Text="<%$ Resources:Content,GN0000276%>" SkinID="linkButtonEdit"
                                                                            CommandName="Edit_User" Visible="false"  />
                                                                    </li>
                                                                    <li>
                                                                        <asp:LinkButton ID="LB_EDable" runat="server" CssClass="btnAction" /></li>
                                                                    <li>
                                                                        <asp:LinkButton ID="Lbtn_ADUserEnable" CssClass="btnAction" runat="server" data-toggle="tooltip" data-placement="top" title="" data-original-title="Tooltip on top"></asp:LinkButton></li>
                                                                    <li>
                                                                        <asp:LinkButton ID="Lbtn_RemoveAndDeleteADUser" CssClass="btnAction" runat="server" Text="<%$ Resources:Content,RemoveAndDeleteADUserText%>" CommandName="RemoveAndDeleteADUser" /></li>
                                                                    <EM:ConfirmButtonExtender ID="CBE_RemoveAndDeleteADUser" ConfirmText='<%$ Resources:Content,RemoveAndDeleteADUserConfirmAlert %>'
                                                                        TargetControlID="Lbtn_RemoveAndDeleteADUser" runat="server">
                                                                    </EM:ConfirmButtonExtender>
                                                                </ul>
                                                            </li>
                                                        </ul>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <%--PagerTemplate Start--%>
                                            <PagerTemplate>
                                                <EM:Pager ID="Pager2" runat="server" />
                                            </PagerTemplate>
                                            <%--PagerTemplate End--%>
                                        </asp:GridView>
                                    </asp:Panel>
                                    <%--Add user form--%>
                                    <asp:Panel ID="Pnl_AddUser" runat="server" Visible="false">
                                        <div class="row">
                                            <div class="col-xs-12">
                                                <div class="card">
                                                    <div class="header">
                                                        <h3>
                                                            <%= Resources.Content.GN0000637%>                                                                                                                                 
                                                        </h3>
                                                    </div>
                                                    <div class="body">
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Literal14" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0001288%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="DDL_User" AutoPostBack="true" runat="server">
                                                                        <asp:ListItem Text="<%$ Resources:Content,L0028%>" Value="0" Selected="True"></asp:ListItem>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                            <div id="Div_NewUserInputs" runat="server">
                                                                <div class="col-sm-3 col-xs-12">
                                                                    <div class="form-group">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_User" runat="server" MaxLength="50" onblur='CreatePrimaryEmail()'></asp:TextBox>
                                                                            <%--<asp:RegularExpressionValidator ID="REV_UserAlias" runat="server" ValidationGroup="CRMUser" Display="None" ErrorMessage="<%$Resources:Content,InvalidUPN %>"
                                                                                ValidationExpression="<%$Resources:MPRegex,Alias %>" ControlToValidate="TxBx_User" SetFocusOnError="true">
                                                                            </asp:RegularExpressionValidator>--%>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-sm-3 col-xs-12">
                                                                    <div class="form-group">
                                                                        <asp:DropDownList ID="DDL_Domain" runat="server" onchange='CreatePrimaryEmail()'>
                                                                        </asp:DropDownList>
                                                                        <asp:RequiredFieldValidator ID="RFV_User" runat="server" ControlToValidate="TxBx_User"
                                                                            Display="None" SetFocusOnError="True" ValidationGroup="CRMUser"></asp:RequiredFieldValidator>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row" id="Tr_DisplayName" runat="server">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Literal15" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN00001113%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_DisplayName" runat="server" MaxLength="50"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="RFV_DisplayName" runat="server" ControlToValidate="TxBx_DisplayName"
                                                                            Display="None" SetFocusOnError="True" ValidationGroup="CRMUser"></asp:RequiredFieldValidator>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row" id="Tr_FName" runat="server">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Literal10" 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_FName" runat="server" MaxLength="50"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="RFV_FName" runat="server" ControlToValidate="TxBx_FName"
                                                                            Display="None" SetFocusOnError="True" ValidationGroup="CRMUser"></asp:RequiredFieldValidator>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row" id="Tr_LName" runat="server">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Literal11" runat="server" EnableViewState="false" 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_LName" runat="server" MaxLength="50"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="TxBx_LName"
                                                                            Display="None" SetFocusOnError="True" ValidationGroup="CRMUser"></asp:RequiredFieldValidator>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Ltrl_Add_AccessMode" runat="server" EnableViewState="false" Text="<%$ Resources:Content,USM0029%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID='Ddl_Add_AccessMode' runat='server' Width='120px' AutoPostBack='true'>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row" id='Tr_Add_CALtype' runat='server'>
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Ltrl_Add_CALType" runat="server" EnableViewState="false" Text="<%$ Resources:Content,USM0030%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID='Ddl_Add_CALType' runat='server' Width='120px'>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Ltrl_AddUserBU" runat="server" Text="<%$ Resources:Content,USM0078%>" />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID='Ddl_AddUserBU' runat='server' Width='120px' AutoPostBack='true'>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <div class="row">
                                                            <div class="col-xs-12 row-label">
                                                                <asp:Literal ID="Literal13" runat="server" EnableViewState="false" Text="<%$ Resources:Content,String353%>" />:
                                                            </div>
                                                            <div class="col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">

                                                                        <EM:AddSelectableSelected ID="UCRoles" runat="server" SortByValue="false" ClientSideOptimized="true" />
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row" id="Tr_Email" runat="server">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Literal18" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0000652%>" />
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_Email" runat="server" onblur='CopyEmail()' onChange='CopyEmail()'
                                                                            MaxLength="99"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="RFV_Email" runat="server" ControlToValidate="TxBx_Email"
                                                                            Display="None" ValidationGroup="CRMUser" SetFocusOnError="true"></asp:RequiredFieldValidator>
                                                                       <%-- <asp:RegularExpressionValidator ErrorMessage='<%$ Resources:Content,DGN1110038%>'
                                                                            ID="RegularExpressionValidator1" runat="server" ControlToValidate="TxBx_Email"
                                                                            Display="None" ValidationExpression="<%$ Resources:MPRegex,EmailAddress %>"
                                                                            ValidationGroup="CRMUser" SetFocusOnError="True"></asp:RegularExpressionValidator>--%>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row" id="Tr_Pass" runat="server">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *&nbsp;<asp:Literal ID="Literal16" runat="server" EnableViewState="false"
                                                                    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_Password" runat="server" TextMode="Password" MaxLength="30" />
                                                                        <asp:RequiredFieldValidator ID="RFV_Pass" runat="server" ControlToValidate="TxBx_Password"
                                                                            Display="None" SetFocusOnError="True" ValidationGroup="CRMUser"></asp:RequiredFieldValidator>
                                                                    </div>
                                                                </div>
                                                                <br />
                                                                <asp:CheckBox ID="CB_Show" runat="server" Text="<%$ Resources:Content,FAM0049 %>" />
                                                            </div>
                                                            <div class="col-sm-6 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:Button ID="lb_Generate" runat="server" Text="<%$ Resources:Content,SMI0195%>"
                                                                        CausesValidation="false" CssClass="RandomPassword btn btn-primary"
                                                                        TabIndex="-1"></asp:Button>
                                                                </div>
                                                                <div id="Div_PasswordPolicy" runat="server" class="help-text sm"></div>
                                                            </div>
                                                        </div>
                                                        <div class="row" id="Tr_Pass2" runat="server">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *&nbsp;<asp:Literal ID="Literal19" runat="server" EnableViewState="false"
                                                                    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_ConfirmPassword" TextMode="Password" runat="server" MaxLength="30"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="RFV_Pass2" runat="server" ControlToValidate="TxBx_ConfirmPassword"
                                                                            Display="None" SetFocusOnError="True" ValidationGroup="CRMUser"></asp:RequiredFieldValidator>
                                                                        <asp:CompareValidator Display="None" ID="CV_Password" ValidationGroup="CRMUser" runat="server"
                                                                            ErrorMessage='<%$ Resources:Content,DGN1110005 %>' ControlToCompare="TxBx_Password"
                                                                            ControlToValidate="TxBx_ConfirmPassword" SetFocusOnError="true"></asp:CompareValidator>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal20" runat="server" Text="<%$ Resources:Content,GN00001336%>"
                                                                    EnableViewState="false" />:
                                                            </div>
                                                            <div class="col-sm-10 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:TextBox ID="TxBx_Notes" CssClass="col-xs-12" Rows="5" TextMode="MultiLine" runat="server"></asp:TextBox>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal8" runat="server" Text="<%$ Resources:Content,GN0000752%>"
                                                                    EnableViewState="false">
                                                                </asp:Literal>:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:CheckBox ID="CB_AddUserSendEmail" Checked="true" runat="server" Text=" " />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row" id="Tr_AddUserSendEmail" runat="server">
                                                            <div class="col-sm-2 col-xs-12 row-label">
                                                                *
                                    <asp:Literal ID="Literal25" 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_AddUserSendSetupEmail" runat="server"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="RFV_TxBx_AddUserSendEmail" runat="server" ControlToValidate="TxBx_AddUserSendSetupEmail"
                                                                            Display="None" SetFocusOnError="True" ValidationGroup="CRMUser"></asp:RequiredFieldValidator>
                                                                        <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ErrorMessage='<%$ Resources:Content,DEV1055%>'
                                                                            ControlToValidate="TxBx_AddUserSendSetupEmail" Display="None" SetFocusOnError="True"
                                                                            ValidationExpression="<%$ Resources:MPRegex,EmailAddress %>" ValidationGroup="CRMUser"></asp:RegularExpressionValidator>--%>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-12">
                                                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText='<%$ Resources:Content, EM000001 %>'
                                                                    ShowMessageBox="True" ShowSummary="False" ValidationGroup="CRMUser" />
                                                                <asp:Button ID="Btn_UserAdd" ValidationGroup="CRMUser" runat="server" SkinID="saveButton"
                                                                    Text="<%$ Resources:Content,GN0000281%>" CssClass="btn btn-primary btnAction" />
                                                                <asp:Button ID="Btn_UserAddClose" runat="server" SkinID="cancelButton"
                                                                    Text="<%$ Resources:Content,GN0000572%>" CssClass="btn btn-primary" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>
                                    <%--Edit user--%>
                                    <UC:EditUser ID="EditUser1" runat="server" Visible="false" />
                                    <%--Bulk User Start--%>
                                    <asp:Panel ID="Pnl_BulkUser" runat="server" Visible="false">
                                        <UC:BulkUser ID="BulkUser01" runat="server" />
                                    </asp:Panel>
                                    <%--Group Operations --%>
                                    <asp:Panel ID="Pnl_GroupOperation" runat="server" Visible="false">
                                        <div class="row">
                                            <div class="col-xs-12">
                                                <div class="card">
                                                    <div class="header">
                                                        <div class="displayInlineBlock">
                                                            <h2>
                                                                <asp:Literal ID="Literal1" runat="server" EnableViewState="false" Text="<%$ Resources:Content,USM0072%>" /></h2>
                                                        </div>
                                                        <asp:LinkButton ID="LB_GoBackGroupOperation" runat="server" Text="<%$ Resources:Content,DGN1110542%>" CssClass="btn btn-primary pull-right" />
                                                    </div>

                                                    <div class="body">
                                                        <UC:GroupOperations ID="GroupOperation1" runat="server" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <br />
                                    </asp:Panel>
                                </asp:Panel>
                            </ContentTemplate>
                        </EM:TabPanel>
                        <%--Group Actions tab--%>
                        <EM:TabPanel ID="Pnl_GroupActions" runat="server" HeaderText="<%$ Resources:Content,strGroupActionsLog%>">
                            <ContentTemplate>
                                <asp:Button ID="Btn_Tab5" runat="server" Style="display: none;" />
                                <asp:Panel ID="Pnl_TabContent5" runat="server" Visible="false">
                                    <UC:GroupActions ID="GroupActions1" runat="server" />
                                </asp:Panel>
                            </ContentTemplate>
                        </EM:TabPanel>
                    </EM:TabContainer>
                </div>
            </div>
        </div>
    </div>
    <div class="ResourceQuota">
        <asp:Panel ID="Pnl_Resources" runat="server" Style="display: none" CssClass="width-modal-popup-auto">
            <table class="col-xs-12">
            <tr class="row">
                <td class="col-xs-12">
                        <asp:Label ID="Lbl_ResourceError" runat="server" ForeColor="red" Font-Bold="true" Visible="false"></asp:Label>
                    </td>
                </tr>
                <tr class="row">
                <td class="col-xs-12">
                        <asp:GridView ID="GV_Resources" runat="server" AllowPaging="true" CssClass="table table-bordered table-striped table-hover"
                            AutoGenerateColumns="false" EmptyDataText="<%$ Resources:Content,GN00001375%>"
                            PageSize="500">
                            <AlternatingRowStyle CssClass="altRow" />
                            <Columns>
                                <asp:TemplateField HeaderText="<%$Resources:Content,DEV1008%>" HeaderStyle-CssClass="col-xs-3">
                                    <ItemTemplate>
                                        <asp:Label ID="Lbl_ResourceID" runat="server"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="<%$Resources:Content,DEV1002%>" HeaderStyle-CssClass="col-xs-2">
                                    <ItemTemplate>
                                        <asp:Label ID="Lbl_TotalResources" runat="server"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="<%$Resources:Content,DEV1003%>" HeaderStyle-CssClass="col-xs-2">
                                    <ItemTemplate>
                                        <asp:Label ID="Lbl_UsedResources" runat="server"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="<%$Resources:Content,DEV1004%>" HeaderStyle-CssClass="col-xs-2">
                                    <ItemTemplate>
                                        <asp:Label ID="Lbl_AvailableResources" runat="server"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="<%$Resources:Content,DEV1005%>" HeaderStyle-CssClass="col-xs-2">
                                    <ItemTemplate>
                                        <asp:Label ID="Lbl_RequestedResources" runat="server"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
                <tr class="row">
                <td class="col-xs-12">
                        <asp:Button ID="Btn_Done" runat="server" Text="<%$ Resources:Content,GN0000858%>"
                            SkinID="okbutton" CssClass="btn btn-primary waves-effect"  />
                        <asp:Button ID="Btn_Display" runat="server" Style="display: none;" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    <EM:ModalPopupExtender runat="server" ID="MPE_Resource" BackgroundCssClass="modalBackground"
        DropShadow="false" PopupControlID="Pnl_Resources" TargetControlID="Btn_Display"
        OkControlID="Btn_Done">
    </EM:ModalPopupExtender>
    <ajax:UpdatePanel ID="UP_Inter" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Button ID="Button1" Style="display: none" runat="server" />
            <asp:Panel ID="Pnl_Reason" runat="server" Style="display: none" CssClass="width-modal-popup-auto">
                <EM:GetComments ID="GetComments" runat="server" />
            </asp:Panel>
            <EM:ModalPopupExtender runat="server" ID="MPE_GetReason" BackgroundCssClass="modalBackground"
                DropShadow="false" PopupControlID="Pnl_Reason" TargetControlID="Button1">
            </EM:ModalPopupExtender>
        </ContentTemplate>
    </ajax:UpdatePanel>
    <script type="text/javascript">
        function CopyEmail() {
            var parent = document.getElementById("<%=TxBx_Email.ClientID%>");
            var child = document.getElementById("<%=TxBx_AddUserSendSetupEmail.ClientID%>");

            /*alert('Parent : ' + parent + ' Child : ' + child + '\nParent2 : ' + parent2 + ' Child2 : ' + child2);*/
            if (parent != null && child != null) {
                if (document.getElementById('<%=CB_AddUserSendEmail.ClientID%>').checked == true) {
                    child.value = parent.value;
                }
                else {
                    child.value = '';
                }
            }
        }
        function CreatePrimaryEmail() {
            var txbx_user = document.getElementById('<%=TxBx_User.ClientID %>');
            var ddl_domain = document.getElementById('<%=DDL_Domain.ClientID %>');
            var domainname = '';
            if (txbx_user != null && ddl_domain != null)
                if (txbx_user.value.length > 0 && ddl_domain.options.length > 0) {
                    var username = txbx_user.value;
                    for (x = 0; x < ddl_domain.options.length; x++) {
                        if (ddl_domain.options[x].selected) {
                            domainname = ddl_domain.options[x].text;
                            break;
                        }
                    }
                    document.getElementById('<%=TxBx_Email.ClientID %>').value = username + domainname;
                }
                else
                    document.getElementById('<%=TxBx_Email.ClientID %>').value = '';
        }
    </script>


    <asp:Panel ID="Pnl_GroupActionsStatus" runat="server" Style="display: none" CssClass="width-modal-popup-auto">
        <table width="100%">
            <tr>
                <td align="right">
                    <asp:LinkButton ID="LB_GroupActionsStatus" runat="server" Text="<%$ Resources:Content,GN000150%>"
                        Style="display: none;" />
                    <asp:ImageButton ID="IB_CloseGroupActionsStatus" runat="server" ImageUrl="~/App_Themes/Default/Images/icons/disabled-icon.gif"
                        AlternateText="<%$ Resources:Content,GN000150%>" />
                </td>
            </tr>
            <tr>
                <td>

                    <EM:AccountGroupActions ID="GA_GroupActionsStatus" runat="server" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Button ID="Btn_TargetGroupActionsStatus" runat="server" Text="<%$ Resources:Content,SMI0007%>"
        Style="display: none;" />
    <asp:Button ID="Btn_OkGroupActionsStatus" runat="server" Text="<%$ Resources:Content,SMI0007%>"
        Style="display: none;" />
    <EM:ModalPopupExtender runat="server" ID="MPE_GroupActionsStatus" BackgroundCssClass="modalBackground"
        DropShadow="false" PopupControlID="Pnl_GroupActionsStatus" TargetControlID="Btn_TargetGroupActionsStatus"
        OkControlID="Btn_OkGroupActionsStatus" CancelControlID="IB_CloseGroupActionsStatus">
    </EM:ModalPopupExtender>

    <script lang="javascript">
        AllowArrowKeysInFilteredTextBoxExtender('<%=FilteredTextBoxExtender3.ClientID%>');
    </script>
</asp:Content>
