<%@ Page Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="True"
    Inherits="site_HITS_Subscriber_Default" Title="Brightstar Device Protection: Subscriber Master"
    Theme="eMain" Culture="auto" UICulture="auto"
    CodeBehind="Default.aspx.cs" %>

<%@ Register Src="~/Controls/PhoneNumber.ascx" TagName="PhoneNumber" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/ScriptingHelper.ascx" TagName="ScriptingHelper" TagPrefix="uc" %>
<%@ Register Src="~/Controls/DefaultHeader.ascx" TagName="DefaultHeader" TagPrefix="uc" %>
<%@ Register Src="~/Controls/PersistNav.ascx" TagName="PersistNav" TagPrefix="uc" %>
<%@ Register Src="~/Controls/HITSCalendar.ascx" TagName="HITSCalendar" TagPrefix="uc" %>
<%@ Register Src="~/Controls/CustomSorter.ascx" TagName="CustomSorter" TagPrefix="uc" %>
<%@ Register Assembly="eSecuritel.HITS.UI.Components" Namespace="eSecuritel.HITS.UI.Components" TagPrefix="cc1" %>
<%@ Register src="~/Controls/ClientCarrierDropDowns.ascx" tagname="ClientCarrierDropDowns" tagprefix="uc1" %>
    
<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="Server">

    <script src="../../../script/eSetFormControls.js" type="text/javascript"></script>

    <script src="../../../script/eGridHelper.js" type="text/javascript"></script>
    
 <script language="javascript" type="text/javascript">
     
     var skipValidation = '<%=SkipValidation %>';

     function onPhoneNumberkeyup() {

         if (skipValidation === 'True') return;

         var account = document.all ? document.all["ctl00_eContent_m_txtAccountNumber"] : document.getElementById("ctl00_eContent_m_txtAccountNumber");
         var mdn = document.all ? document.all["ctl00_eContent_m_ucMDN_m_txtPhoneNumber"] : document.getElementById("ctl00_eContent_m_ucMDN_m_txtPhoneNumber");
         var AccountLabel = document.all ? document.all["ctl00_eContent_m_litAccountNumber"] : document.getElementById("ctl00_eContent_m_litAccountNumber");
         var Client = document.all ? document.all["ctl00_eContent_ucClientCarrierDropDowns_ddlClient"] : document.getElementById("ctl00_eContent_ucClientCarrierDropDowns_ddlClient");
         var ClientLabel = document.all ? document.all["ctl00_eContent_ucClientCarrierDropDowns_lblClient"] : document.getElementById("ctl00_eContent_ucClientCarrierDropDowns_lblClient");
         var esn = document.all ? document.all["ctl00_eContent_m_txtESN"] : document.getElementById("ctl00_eContent_m_txtESN");
         var esnLabel = document.all ? document.all["ctl00_eContent_m_litESN"] : document.getElementById("ctl00_eContent_m_litESN");
         var taxExemptCodeLabel = document.all ? document.all["ctl00_eContent_m_litTaxExemptCode"] : document.getElementById("ctl00_eContent_m_litTaxExemptCode");
         var taxExemptCode = document.all ? document.all["ctl00_eContent_m_txtTaxExemptCode"] : document.getElementById("ctl00_eContent_m_txtTaxExemptCode");
         

         if (mdn.value ==null || mdn.value == '') {
             account.disabled = false;
             esn.disabled = false;
             Client.disabled = false;
             taxExemptCode.disabled = false;
             AccountLabel.style.color = "Black";
             esnLabel.style.color = "Black";
             taxExemptCodeLabel.style.color = "Black";
             if (ClientLabel != null) ClientLabel.style.color = "Black";
         }
         else {
             account.disabled = true;
             esn.disabled = true;
             Client.disabled = true;
             taxExemptCode.disabled = true;
             AccountLabel.style.color = "Gray";
             esnLabel.style.color = "Gray";
             taxExemptCodeLabel.style.color = "Gray";
             account.value = "";
             esn.value = "";
             taxExemptCode.value = "";
             if (ClientLabel != null) ClientLabel.style.color = "Gray";
              
         }
     }

     function onAccountkeyup() {

         if (skipValidation === 'True') return;

         var account = document.all ? document.all["ctl00_eContent_m_txtAccountNumber"] : document.getElementById("ctl00_eContent_m_txtAccountNumber");
         var mdn = document.all ? document.all["ctl00_eContent_m_ucMDN_m_txtPhoneNumber"] : document.getElementById("ctl00_eContent_m_ucMDN_m_txtPhoneNumber");
         var mdnlabel = document.all ? document.all["ctl00_eContent_m_litMDN"] : document.getElementById("ctl00_eContent_m_litMDN");
         var Client = document.all ? document.all["ctl00_eContent_ucClientCarrierDropDowns_ddlClient"] : document.getElementById("ctl00_eContent_ucClientCarrierDropDowns_ddlClient");
         var ClientLabel = document.all ? document.all["ctl00_eContent_ucClientCarrierDropDowns_lblClient"] : document.getElementById("ctl00_eContent_ucClientCarrierDropDowns_lblClient");
         var esn = document.all ? document.all["ctl00_eContent_m_txtESN"] : document.getElementById("ctl00_eContent_m_txtESN");
         var esnLabel = document.all ? document.all["ctl00_eContent_m_litESN"] : document.getElementById("ctl00_eContent_m_litESN");
         var taxExemptCodeLabel = document.all ? document.all["ctl00_eContent_m_litTaxExemptCode"] : document.getElementById("ctl00_eContent_m_litTaxExemptCode");
         var taxExemptCode = document.all ? document.all["ctl00_eContent_m_txtTaxExemptCode"] : document.getElementById("ctl00_eContent_m_txtTaxExemptCode");


         if (account.value == null || account.value == '') {
             mdn.disabled = false;
             esn.disabled = false;
             Client.disabled = false;
             taxExemptCode.disabled = false;
             mdnlabel.style.color = "Black";
             esnLabel.style.color = "Black";
             taxExemptCodeLabel.style.color = "Black";
             if (ClientLabel != null) ClientLabel.style.color = "Black";           
         }
         else {
             mdn.disabled = true;
             esn.disabled = true;
             Client.disabled = true;
             taxExemptCode.disabled = true;
             mdnlabel.style.color = "Gray";
             esnLabel.style.color = "Gray";
             taxExemptCodeLabel.style.color = "Gray";
             mdn.value = "";
             esn.value = "";
             taxExemptCode.value = "";
             if (ClientLabel != null) ClientLabel.style.color = "Gray";
         }
     }

     function onESNkeyup() {

         if (skipValidation === 'True') return;

         var account = document.all ? document.all["ctl00_eContent_m_txtAccountNumber"] : document.getElementById("ctl00_eContent_m_txtAccountNumber");
         var mdn = document.all ? document.all["ctl00_eContent_m_ucMDN_m_txtPhoneNumber"] : document.getElementById("ctl00_eContent_m_ucMDN_m_txtPhoneNumber");
         var mdnlabel = document.all ? document.all["ctl00_eContent_m_litMDN"] : document.getElementById("ctl00_eContent_m_litMDN");
         var client = document.all ? document.all["ctl00_eContent_ucClientCarrierDropDowns_ddlClient"] : document.getElementById("ctl00_eContent_ucClientCarrierDropDowns_ddlClient");
         var clientLabel = document.all ? document.all["ctl00_eContent_ucClientCarrierDropDowns_lblClient"] : document.getElementById("ctl00_eContent_ucClientCarrierDropDowns_lblClient");
         var accountLabel = document.all ? document.all["ctl00_eContent_m_litAccountNumber"] : document.getElementById("ctl00_eContent_m_litAccountNumber");
         var esn = document.all ? document.all["ctl00_eContent_m_txtESN"] : document.getElementById("ctl00_eContent_m_txtESN");
         var taxExemptCodeLabel = document.all ? document.all["ctl00_eContent_m_litTaxExemptCode"] : document.getElementById("ctl00_eContent_m_litTaxExemptCode");
         var taxExemptCode = document.all ? document.all["ctl00_eContent_m_txtTaxExemptCode"] : document.getElementById("ctl00_eContent_m_txtTaxExemptCode");

         if (esn.value == null || esn.value == '') {
             account.disabled = false;
             mdn.disabled = false;
             client.disabled = false;
             taxExemptCode.disabled = false;
             mdnlabel.style.color = "Black";
             accountLabel.style.color = "Black";
             taxExemptCodeLabel.style.color = "Black";
             if (clientLabel != null) clientLabel.style.color = "Black";
         } else {
             mdn.disabled = true;
             account.disabled = true;
             client.disabled = true;
             taxExemptCode.disabled = true;
             mdnlabel.style.color = "Gray";
             accountLabel.style.color = "Gray";
             taxExemptCodeLabel.style.color = "Gray";
             mdn.value = "";
             account.value = "";
             taxExemptCode.value = "";
             if (clientLabel != null) clientLabel.style.color = "Gray";
         }
     }

     function onTaxExemptCodeKeyup() {

         if (skipValidation === 'True') return;

         var account = document.all ? document.all["ctl00_eContent_m_txtAccountNumber"] : document.getElementById("ctl00_eContent_m_txtAccountNumber");
         var mdn = document.all ? document.all["ctl00_eContent_m_ucMDN_m_txtPhoneNumber"] : document.getElementById("ctl00_eContent_m_ucMDN_m_txtPhoneNumber");
         var mdnlabel = document.all ? document.all["ctl00_eContent_m_litMDN"] : document.getElementById("ctl00_eContent_m_litMDN");
         var client = document.all ? document.all["ctl00_eContent_ucClientCarrierDropDowns_ddlClient"] : document.getElementById("ctl00_eContent_ucClientCarrierDropDowns_ddlClient");
         var clientLabel = document.all ? document.all["ctl00_eContent_ucClientCarrierDropDowns_lblClient"] : document.getElementById("ctl00_eContent_ucClientCarrierDropDowns_lblClient");
         var accountLabel = document.all ? document.all["ctl00_eContent_m_litAccountNumber"] : document.getElementById("ctl00_eContent_m_litAccountNumber");
         var esn = document.all ? document.all["ctl00_eContent_m_txtESN"] : document.getElementById("ctl00_eContent_m_txtESN");
         var taxExemptCode = document.all ? document.all["ctl00_eContent_m_txtTaxExemptCode"] : document.getElementById("ctl00_eContent_m_txtTaxExemptCode");
         var esnLabel = document.all ? document.all["ctl00_eContent_m_litESN"] : document.getElementById("ctl00_eContent_m_litESN");

         if (taxExemptCode.value == null || taxExemptCode.value == '') {
             account.disabled = false;
             mdn.disabled = false;
             client.disabled = false;
             esn.disabled = false;
             mdnlabel.style.color = "Black";
             accountLabel.style.color = "Black";
             esnLabel.style.color = "Black";
             if (clientLabel != null) clientLabel.style.color = "Black";
         } else {
             mdn.disabled = true;
             account.disabled = true;
             client.disabled = true;
             esn.disabled = true;
             mdnlabel.style.color = "Gray";
             accountLabel.style.color = "Gray";
             esnLabel.style.color = "Gray";
             mdn.value = "";
             account.value = "";
             esn.value = "";
             if (clientLabel != null) clientLabel.style.color = "Gray";
         }

     }

     function clearControls() {
         var AccountLabel = document.all ? document.all["ctl00_eContent_m_litAccountNumber"] : document.getElementById("ctl00_eContent_m_litAccountNumber");         
         var ClientLabel = document.all ? document.all["ctl00_eContent_ucClientCarrierDropDowns_lblClient"] : document.getElementById("ctl00_eContent_ucClientCarrierDropDowns_lblClient");
         var mdnlabel = document.all ? document.all["ctl00_eContent_m_litMDN"] : document.getElementById("ctl00_eContent_m_litMDN");
         var esnLabel = document.all ? document.all["ctl00_eContent_m_litESN"] : document.getElementById("ctl00_eContent_m_litESN");
         var taxExemptCodeLabel = document.all ? document.all["ctl00_eContent_m_litTaxExemptCode"] : document.getElementById("ctl00_eContent_m_litTaxExemptCode");

         $("#client_dd_subscriberSearchMaster select:first option:selected").removeProp('selected');
         $("#client_dd_subscriberSearchMaster select:first option[value='0']").prop('selected', true);

         if (ClientLabel != null) ClientLabel.style.color = "Black";
         mdnlabel.style.color = "Black";
         AccountLabel.style.color = "Black";
         esnLabel.style.color = "Black";
         taxExemptCodeLabel.style.color = "Black";

         var account = document.all ? document.all["ctl00_eContent_m_txtAccountNumber"] : document.getElementById("ctl00_eContent_m_txtAccountNumber");
         var mdn = document.all ? document.all["ctl00_eContent_m_ucMDN_m_txtPhoneNumber"] : document.getElementById("ctl00_eContent_m_ucMDN_m_txtPhoneNumber");
         var Client = document.all ? document.all["ctl00_eContent_ucClientCarrierDropDowns_ddlClient"] : document.getElementById("ctl00_eContent_ucClientCarrierDropDowns_ddlClient");
         var esn = document.all ? document.all["ctl00_eContent_m_txtESN"] : document.getElementById("ctl00_eContent_m_txtESN");
         var taxExemptCode = document.all ? document.all["ctl00_eContent_m_txtTaxExemptCode"] : document.getElementById("ctl00_eContent_m_txtTaxExemptCode");

         mdn.disabled = false;
         account.disabled = false;
         Client.disabled = false;
         esn.disabled = false;
         taxExemptCode.disabled = false;
     }


     function disableSearch() {
            
         var isValid = true;

         if (typeof (Page_ClientValidate) == 'function') {
             isValid = Page_ClientValidate();
         }
         if (isValid) {
             this.disabled = true;
             resetStatusText();
         }

         return isValid;
     }

     function isIE() {      
         var ie = (navigator.userAgent.indexOf("MSIE") != -1);          
         return ie;         
     }
     function resetStatusText() {
         var hdnLabelSearching = document.all('ctl00_eContent_hdnLabelSearching');
         if (isIE()) {
             var a = document.getElementById("ctl00_eContent_m_lblStatus");
             if (a != null) {
                 a.innerHTML = hdnLabelSearching.value; 
                 a.className = "successmessage"; 
             }
         }
         else {
             var b = document.all('ctl00_eContent_m_lblStatus');
             if (b != null) {
                 b.innerHTML = hdnLabelSearching.value;
                 b.className = "successmessage";
             }
         }
     }

 </script>
    
    <uc:ScriptingHelper ID="ScriptingHelper1" runat="server"  />
    <asp:Panel ID="m_pnlMain" runat="server">
        <asp:HiddenField runat="server" ID="hdnLabelSearching" Value="<%$ Resources: Default, LabelSearching %>" />
 
        <center>
            <asp:Label ID="m_lblCannotAdd" runat="server" ForeColor="Red" Font-Bold="true" Text="<%$ Resources: SubscriberManagement, NotSearchSubscribersDeactivatedClientLabel %>" />
        </center>
    
        <h1>
            <asp:Literal ID="m_litSubscriberManagementHeader" runat="server" Text="<%$ Resources: SubscriberManagement, SubscribersLabel %>" 
            />
        </h1>
        <uc:DefaultHeader ID="DefaultHeader1" runat="server" />
        <div class="mastersearch">
            <table cellspacing="0" cellpadding="0">
                <tr>
                    <td style="padding-right: 0px">
                        <img id="Img1" runat="server" src="../../../images/Collapse_13x13.jpg" class="showstate"
                            onclick="expandMasterSearch(this, 'm_pnlMasterSearchCriteria')" alt="contract" />
                    </td>
                    <td width="100%" valign="middle">
                        <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources: Default, LabelSearchCriteria %>" />
                    </td>
                </tr>
            </table>
        </div>
        <asp:UpdatePanel runat="server" ID="asp_UpdatePanel4154" UpdateMode="Conditional">
        <Triggers>
            <asp:PostBackTrigger ControlID="ucClientCarrierDropDowns" />
        </Triggers>
        <ContentTemplate>
            
            
        <div id="m_pnlMasterSearchCriteria" class="subscriberSearchMaster" style="background-color: #DBDCDE; "  >
            <br />
            <table id="m_tblSubscriberFilter"   >
                <tr>
                    <td align="left" valign="top" style="width: 348px;padding-left:50px"  >
                    <asp:Panel ID="Panel1" runat="server" BorderStyle="solid" BorderColor="#c3c3c3" BorderWidth="1" style="padding:5px"    >
                        <table >
                            <tr>
                                <td align="right" colspan="2">
                                    <div id="client_dd_subscriberSearchMaster">
        
                                        <uc1:ClientCarrierDropDowns  
                                            ID="ucClientCarrierDropDowns" 
                                            runat="server" 
                                            OrientationOfDropDowns="Vertical"
                                               DefaultCarrierText="<%$ Resources: Default, HeaderListItemAll %>"
                                            OnClientChanged="ucClientCarrierDropDowns_ClientChanged"
                                            OnCarrierChanged="ucClientCarrierDropDowns_CarrierChanged" DropDownWidth="212"
                                            ShowSelectEntry="true"
                                            
                                              ShowAllEntry="false" />        
                                    </div>
                                </td>  
                                                                
                            </tr>
                            
                            <tr>
                                <td  align="right" style="white-space:nowrap;min-width:131px;"><asp:Label ID="m_litSubscriberLastName" runat="server" Text="<%$ Resources: SubscriberManagement, LabelSubscriberLastName %>" />
                                </td>
                                <td  align="left"><asp:TextBox ID="m_txtSubscriberLastName" runat="server" />
                                </td>                                
                            </tr>
                            <tr>
                                <td  align="right"><asp:Label ID="m_litSubscriberFirstName" runat="server" Text="<%$ Resources: SubscriberManagement, LabelSubscriberFirstName %>" />
                                </td>
                                <td align="left"><asp:TextBox ID="m_txtSubscriberFirstName" runat="server" />
                                </td>                                
                            </tr>
                            <tr>
                                <td align="right"> <asp:Label ID="m_litDateFrom" runat="server" Text="<%$ Resources: SubscriberManagement, CoveredSinceLabel %>" />
                                </td>
                                <td align="left"> <uc:HITSCalendar ID="m_calDateFrom" runat="server" />
                                </td>                            
                            </tr>
                        </table>
                    </asp:Panel>    
                    </td>
                    <td align="left" valign="top">
                    <asp:Panel ID="Panel2" runat="server" Width="276px">
                        <table class="subscriberSearchMaster-right">
                            <tr>
                                <td align="right"><asp:Label ID="m_litMDN" runat="server" Text="<%$ Resources : HandsetManagement,LabelMDNColon %>" />
                                </td>
                                <td align="left"> <uc1:PhoneNumber ID="m_ucMDN" runat="server" Required="false" onkeyup="onPhoneNumberkeyup()"      />
                                </td>
                                <td></td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="m_litESN" runat="server"  Text="<%$ Resources: HandsetManagement, LabelESNColon %>" />
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="m_txtESN" runat="server" onkeyup="onESNkeyup()" />
                                </td>
                                <td></td>
                            </tr>
                            <tr>
                                <td align="right"><asp:Label ID="m_litAccountNumber" runat="server"  Text="<%$ Resources: SubscriberManagement, LabelAccountNumberSign %>" />
                                </td>
                                <td align="left"><asp:TextBox ID="m_txtAccountNumber" runat="server" onkeyup="onAccountkeyup()"/>
                                </td>
                                <td></td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="m_litTaxExemptCode" runat="server" Text="<%$ Resources: SubscriberManagement, LabelTaxExemptCode %>"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:TextBox ID="m_txtTaxExemptCode" runat="server" onkeyup="onTaxExemptCodeKeyup()" />
                                </td>
                                <td></td>
                            </tr>
                        </table>    
                    </asp:Panel>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td align="left" class="rp-subscriberSearchMaster">
                        <br/>
                        <asp:Literal ID="m_litPageSize" runat="server" Text="<%$ Resources: Default, LabelRecordsPerPageColon %>" />
                        &nbsp;&nbsp;
                        <asp:DropDownList ID="m_ddlPageSize" runat="server">
                        </asp:DropDownList>
                    </td>
                    <td></td>
                    <td></td>
                </tr>
            </table>
            <br />
        </div>
        
        <div class="masterpadding">
        </div>
        </ContentTemplate>
        </asp:UpdatePanel>       
        
        <div style="text-align: center">
            <asp:Button ID="m_btnSearch" runat="server" Text="<%$ Resources: Default, ButtonSearch %>" OnClick="m_btnSearch_Click" 
            OnClientClick="this.disabled = disableSearch()" UseSubmitBehavior="false" 
                CssClass="pagebutton" />
            <asp:Button id="m_btnClear"  runat="server" Text="<%$ Resources: Default, ButtonClear %>" class="pagebutton" OnClick="m_btnClear_Click" OnClientClick="clearControls()"/>
        </div>



        <br />
        <asp:Label ID="m_lblStatus" runat="server" /><br />
        <asp:Panel ID="m_pnlSearchResults" runat="Server" Visible="False">
            <h2>
                <asp:Literal runat="server" ID="m_litSearchResultsHeader" Text="<%$ Resources: Default, LabelSearchResults %>" />
                
            </h2>
            <asp:Literal ID="m_litNoResultsFound" runat="server" Text="<%$ Resources: Default, LabelNoResultsFound %>" />
            <asp:Panel ID="m_pnlGridViews" runat="server" Visible="False">
                <h3>
                    <asp:Literal ID="m_litSummaryHeader" runat="server" Text="<%$ Resources: SubscriberManagement, SummaryLabel %>" />
                </h3>
                <asp:GridView ID="m_grdViewSummary" runat="server" AutoGenerateColumns="False" OnRowDataBound="m_grdViewSummary_RowDataBound"
                    Width="100%">
                    <Columns>
                        <asp:TemplateField HeaderText="<%$ Resources: SubscriberManagement, CompanyHeaderText %>" >
                            <ItemTemplate>
                                <asp:Label ID="m_lblCompany" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources: SubscriberManagement, ActiveHeaderText %>" >
                            <ItemTemplate>
                                <asp:Label ID="m_lblActive" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources: SubscriberManagement, InactiveHeaderText %>" >
                            <ItemTemplate>
                                <asp:Label ID="m_lblInactive" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                         <asp:TemplateField HeaderText="<%$ Resources: SubscriberManagement, PendingHeaderText %>" >
                            <ItemTemplate>
                                <asp:Label ID="m_lblPending" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources: SubscriberManagement, TotalHeaderText %>" >
                            <ItemTemplate>
                                <asp:Label ID="m_lblTotal" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                         <asp:TemplateField HeaderText="<%$ Resources: Default, HeaderTextCurrentLosses %>" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="m_lblCurrentLosses" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources: SubscriberManagement, CurrentPAIRHeaderText %>" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="m_lblCurrentPair" runat="server" Visible="false" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources: SubscriberManagement, LossesLastMonthHeaderText %>" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="m_lblLossesLastMonth" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources: SubscriberManagement, PAIRLastMonthHeaderText %>" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="m_lblPairLastMonth" runat="server" Visible="false" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources: SubscriberManagement, YTDLossesHeaderText %>" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="m_lblYTDLosses" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="PAIR" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="m_lblPAIR" runat="server" Visible="false"/>
                            </ItemTemplate>
                        </asp:TemplateField>  
                    </Columns>
                    <HeaderStyle HorizontalAlign="Center" />
                    <RowStyle HorizontalAlign="Right" />
                </asp:GridView>
                <h3>
                    <asp:Literal ID="m_litGridViewSubscriberHeader" runat="server" Text="<%$ Resources: SubscriberManagement, ResultsLabel %>" />
                </h3>
                <div style="width: 100%; overflow: auto">
                <cc1:HitsSearchGridView ID="m_grdViewSubscribers" runat="server" Width="100%" AutoGenerateColumns="False"
                    AllowPaging="True" OnRowDataBound="m_grdViewSubscribers_RowDataBound" OnMenuItemCommand="m_grdViewSubscribers_OnMenuItemCommand"
                    ShowMenu="True" ShowSelectField="True" ShowActivateMenu="True" ShowDeActivateMenu="False"
                    ShowEmailMenu="False" ShowPrintMenu="True" ShowHotlineMenu="True" ShowDeHotlineMenu="False"
                    CustomPagerID="HitsPager1" ClientFunctionPrint="window.print();" OnCustomPageIndexChanged="m_grdViewSubscribers_PageIndexChanged"
                    OnCustomPageIndexChanging="m_grdViewSubscribers_PageIndexChanging" ClientFunctionEmailSelected="EmailAllSelected();"
                    ShowDeleteMenu="True" ShowDeSelectMenu="True" ShowSelectMenu="True" AtlasScriptManagerID="ScriptManager"
                    ShowExportCSV="True" ShowExportCSVWithSummary="False" ShowExportMenu="True" ShowExportXML="True"
                    ShowExportXMLWithSummary="False" ShowSetStatus="False" ClientFunctionActivateSelected=""
                    ClientFunctionDeActivateSelected="" ClientFunctionDeHotline="" ClientFunctionDelete=""
                    ClientFunctionExportSelected="" ClientFunctionHotline="" ClientFunctionSetStatus=""
                    CssClassCustomPaging="" CssClassMenu="" PropagateActionToChildID="">
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: SubscriberManagement, NameHeaderText %>" ID="m_lblName" ></asp:Label>
                                <br />
                                <uc:CustomSorter runat="server" ID="m_csName" SortExpression="LastName" OnSortAscendingClicked="CustomSorter_Clicked"
                                    OnSortDescendingClicked="CustomSorter_Clicked"  ></uc:CustomSorter>
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:LinkButton runat="server" ID="m_lbName" OnClick="m_lbName_Click"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Wrap="false">
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="MDN" ID="m_lblMDN"></asp:Label>
                                <br />
                                <uc:CustomSorter runat="server" ID="m_csMDN" SortExpression="MDN" OnSortAscendingClicked="CustomSorter_Clicked"
                                    OnSortDescendingClicked="CustomSorter_Clicked"></uc:CustomSorter>
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:LinkButton runat="server" ID="m_lbMDN" OnClick="m_lbMDN_Clicked"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="ESN/IMEI" ID="m_lblESN_IMEI"></asp:Label>
                                <br />
                                
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:LinkButton runat="server" ID="m_lbESN_IMEI" OnClick="m_lbESN_IMEI_Clicked"></asp:LinkButton>
                                <br />
                                <asp:Label ID="m_lblESN_IMEI_HEX" runat="server"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: SubscriberManagement, AcctNumHeaderText %>" ID="m_lblAcctNumHeader" ></asp:Label>
                                <br />
                                <uc:CustomSorter runat="server" ID="CustomSorter1" SortExpression="ACCT_NO" OnSortAscendingClicked="CustomSorter_Clicked"
                                    OnSortDescendingClicked="CustomSorter_Clicked"></uc:CustomSorter>
                            </HeaderTemplate>
                            <ItemStyle Width="100px" />
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:Label runat="server" ID="m_lblAccountNumber"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: HandsetManagement, HeaderTextHandset %>" ID="m_lblHandsetHeader" ></asp:Label>
                                <br />
                                 
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:LinkButton runat="server" ID="m_lbHandset" OnClick="m_lbHandset_Clicked"></asp:LinkButton>
                                <br />
                                <asp:Label ID="m_lblTechType" runat="server"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: SubscriberManagement, CoveredSinceHeaderText %>" ID="m_lblCoveredSinceHeader"></asp:Label>
                                <br />
                                <uc:CustomSorter runat="server" ID="CustomSorter2" SortExpression="COVERED_SINCE"
                                    OnSortAscendingClicked="CustomSorter_Clicked" OnSortDescendingClicked="CustomSorter_Clicked">
                                </uc:CustomSorter>
                                
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:Label runat="server" ID="m_lblCoveredSince"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField Visible ="False">
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: SubscriberManagement, CoverageEffectiveHeaderText %>" ID="m_lblCoverageEffectiveHeader" 
								></asp:Label>
                                <br />
                                
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:Label runat="server" ID="m_lblCoverageEffectiveDate"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: Default, HeaderTextCurrentLosses %>" ID="m_lblCurrentHeaderLosses" ></asp:Label>
                                <br />
                                
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:Label runat="server" ID="m_lblCurrentLosses"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: Default, LossesHeaderText %>" ID="m_lblLossesHeader" ></asp:Label>
                                <br />
                                
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:Label runat="server" ID="m_lblTotalLosses"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: SubscriberManagement, HotlinedHeaderText %>" ID="m_lblHotlinedHeader" ></asp:Label>
                                <br />
                               
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:Label runat="server" ID="m_lblHotlined"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: SubscriberManagement, StatusHeaderText %>" ID="m_lblActiveHeader" ></asp:Label>
                                <br />
                                
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:Label runat="server" ID="m_lblActive"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: SubscriberManagement, TermDateHeaderText %>" ID="m_lblTermDateHeader" ></asp:Label>
                                <br />
                                
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:Label runat="server" ID="m_lblTermDate"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: SubscriberManagement, ServicePlanHeaderText %>" ID="m_lblRatePlanFeaturesHeader" ></asp:Label>
                                <br />
                               
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:Label runat="server" ID="m_lblRatePlanFeatures"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                         <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: OrganizationManagement, PostalCodeLabel %>" ID="m_lblPostalCodeHeader" ></asp:Label>
                                <br />
                               
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:Label runat="server" ID="m_lblPostalCode"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                         <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label runat="server" Text="<%$ Resources: HandsetManagement, LabelEquipmentPurchaseDate %>" ID="m_lblEquipmentPurchaseDateHeader" ></asp:Label>
                                <br />
                               
                            </HeaderTemplate>
                            <HeaderStyle VerticalAlign="Top" />
                            <ItemTemplate>
                                <asp:Label runat="server" ID="m_lblEquipmentPurchaseDate"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemStyle CssClass="hide" />
                            <HeaderStyle CssClass="hide" />
                            <ItemTemplate>
                                <!-- In order for the Emailing Javascript to work, we must have a visible column with the
                                         email information.  We don't want to have to user see it though, so set the display to none. -->
                                <asp:HyperLink runat="server" CssClass="EmailBox" ID="m_hypEmail"></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerTemplate>
                        <cc1:HitsPager ID="HitsPager1" runat="server" GoButtonText="<%$ Resources: Default, GoButtonText %>" />
                    </PagerTemplate>
                    <PagerSettings Mode="NumericFirstLast" />
                    <HeaderStyle HorizontalAlign="Center" />
                    <RowStyle HorizontalAlign="Left" Wrap="true" />
                    <EditRowStyle HorizontalAlign="Left" VerticalAlign="Top" />
                </cc1:HitsSearchGridView>
               </div>
            </asp:Panel>
        </asp:Panel>
    </asp:Panel>
    <asp:ObjectDataSource ID="m_odsSubscriber" runat="server" SelectMethod="SelectSubscriberMaster" SelectCountMethod="SelectCount"
        TypeName="SubscriberDataSource" EnablePaging="True">
        <SelectParameters>
            <asp:SessionParameter Name="subscriberDataSearchCriteria" SessionField="SubscriberSearchData_SessionKey"
                Type="Object" />
            <asp:ControlParameter ControlID="m_grdViewSubscribers" Name="startRowIndex" PropertyName="PageIndex"
                Type="Int32" />
            <asp:Parameter DefaultValue="10" Name="maximumRows" Type="Int32" />
            <asp:SessionParameter Name="subscriberSortExpression" SessionField="SubscriberSortExpression_SessionKey"
                Type="Object" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <script type="text/javascript">
        Sys.Application.add_load(setStyle);
        function setStyle() {
            var rv = -1; // Return value assumes failure.
            if (navigator.appName == 'Microsoft Internet Explorer') {
                var ua = navigator.userAgent;
                var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
                if (re.exec(ua) != null)
                    rv = parseFloat(RegExp.$1);
                if (rv > 7.0)
                    $('#ctl00_eContent_Panel2').attr('style', 'display: inline');
                else if (rv == 7.0)
                {
                    $('span[id$=_ucClientCarrierDropDowns_lblCarrier]').css('display', '');
                    $('span[id$=_ucClientCarrierDropDowns_lblClient]').css('display', '');
                }

                if (rv > 8.0)
                    $('.rp-subscriberSearchMaster').attr('style', 'padding-left: 86px !important');

            } else if (navigator.appName == 'Netscape') {
                var usAg = navigator.userAgent;
                var reg = new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})");
                if (reg.exec(usAg) != null)
                    rv = parseFloat(RegExp.$1);
                if (rv == 11.0 || rv > 11.0) {
                    $('#ctl00_eContent_Panel2').attr('style', 'display: inline');
                    $('.rp-subscriberSearchMaster').attr('style', 'padding-left: 86px !important');
                }
            }
        }
    </script>
</asp:Content>