<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Localize.ascx.vb" Inherits="Controls_Localize" %>
<%@ Register Src="~/Controls/CustomContent.ascx" TagName="CustomContent" TagPrefix="uc" %>
    <script type="text/JavaScript">
      window.onload = function()
      {
            var myBoxObject = new curvyCorners(settings, "ValidationSummary");
            myBoxObject.applyCornersToAll();
      }
    </script>

<script type="text/javascript">
var isNN = (navigator.appName.indexOf("Netscape") != -1);

function autoTab(input, len, e) 
{
  var keyCode = (isNN) ? e.which : e.keyCode; 
  var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
  
  if(input.value.length >= len && !containsElement(filter,keyCode))
  {
    input.value = input.value.slice(0, len);
    input.form[(getIndex(input)+1) % input.form.length].focus();
  }

  function containsElement(arr, ele) 
  {
    var found = false, index = 0;
    while(!found && index < arr.length)
    if(arr[index] == ele)
    found = true;
    else
    index++;
    return found;
  }

  function getIndex(input) 
  {
    var index = -1, i = 0, found = false;
    while (i < input.form.length && index == -1)
    if (input.form[i] == input)index = i;
    else i++;
    return index;
  }
  return true;
}

function digitCheck(input)
{
    if (isNaN(input.value) && input.value.length > 0)
    {
        alert("Phone number may contain digits only.");
        input.focus();
    }
}
</script>
<asp:Panel ID="pnlEnterInfo" runat="server" DefaultButton="btnContinue">
    <div class="sectionName" style="padding-left:15px; font-size:large;">
        <strong>Find What's Available at Your Address</strong></div>
    <div style="width: 95%; padding-left: 20px;">
        <div style="background-color: #FFFFFF;">
            <div>
   <!-- there should be no space between summarBox div and the asp:label -->
    <!-- the following div (summaryBox) must be there to display the rounded border and must not have any space after it -->
        <div id="summaryBox" style="padding-left:10px; padding-bottom:10px;"><asp:Label runat="server" ID="lblErrorMessage" Style="color: red;"></asp:Label></div>
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="background-color: #FFFFFF">
                            <table width="100%" cellpadding="0" cellspacing="0" style="margin-left:40px;">
                                <tr>
                                    <td colspan="2" style="background-color: #FFFFFF" nowrap>
                                        <div align="center"><span style="font-weight: bolder; font-size: 13px;">Check by address: </span><span
                                            class="smallInstOrange">(*Required)</span></div></td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="background-color: #FFFFFF" nowrap>&nbsp;
                                        </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right; background-color: #FFFFFF" nowrap>
                                        <label for="txtStreet1">
                                            <span class="orange">*</span>Street Address</label>&nbsp;
                                    </td>
                                    <td style="background-color: #FFFFFF; width: 162px;" nowrap>
                                        <asp:TextBox ID="txtStreet1" runat="server" MaxLength="60" TabIndex="1" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right; background-color: #FFFFFF" nowrap>&nbsp;
                                        </td>
                                    <td style="background-color: #FFFFFF; width: 162px;" nowrap>&nbsp;
                                        </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right; background-color: #FFFFFF" nowrap>
                                        <label for="txtStreet2">
                                            Apt. or Unit&nbsp;</label></td>
                                    <td style="background-color: #FFFFFF; width: 162px;" nowrap>
                                        <asp:TextBox ID="txtStreet2" runat="server" MaxLength="60" TabIndex="2" /></td>
                                </tr>
                                <tr>
                                    <td style="text-align: right; background-color: #FFFFFF" nowrap>&nbsp;
                                        </td>
                                    <td style="background-color: #FFFFFF; width: 162px;" nowrap>&nbsp;
                                        </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right; background-color: #FFFFFF" nowrap>
                                        <label for="txtZipCode">
                                            <span class="orange">*</span>Zip Code&nbsp;</label>
                                    </td>
                                    <td style="background-color: #FFFFFF; width: 162px;" nowrap>
                                        <asp:TextBox ID="txtZipCode" runat="server" MaxLength="5" TabIndex="3" /></td>
                                </tr>
                                <tr>
                                    <td style="text-align: right; background-color: #FFFFFF" nowrap>&nbsp;
                                        </td>
                                    <td style="background-color: #FFFFFF; width: 162px;" nowrap>&nbsp;
                                        </td>
                                </tr>
                                <tr>
                                    <td style="background-color: #FFFFFF; text-align: center" colspan="2" nowrap>
                                        <asp:CheckBox ID="chkRememberMe" runat="server" TabIndex="4" />
                                        Remember my address
                                        information
                                        </td>
                                </tr>
                            </table>
                        </td>
                        <td style="background-color: #FFFFFF; vertical-align: middle; text-align: center;
                            padding: 15px;">
                            <div align="center">
                                <img src="../Images/or2_transp.ccom" alt="Use your address OR phone number to look for Charter services" />
                            </div>
                        </td>
                        <td style="background-color: #FFFFFF">
                            <table cellpadding="0" cellspacing="0">
                                <tr>
                                    <td colspan="2" style="background-color: #FFFFFF" nowrap>
                                        <div align="center"><span style="font-weight: bolder; font-size: 13px;">Check by phone number:</span><span
                                            class="smallInstOrange">(* Required)</span>
                                            <br />
                                        </div></td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="background-color: #FFFFFF" nowrap>&nbsp;
                                        </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right; background-color: #FFFFFF" nowrap>
                                        <label for="txtPhone1">
                                            <span class="orange">*</span>Phone Number&nbsp;</label>
                                    </td>
                                    <td style="background-color: #FFFFFF" nowrap>
                                        <asp:TextBox ID="txtPhone1" runat="server" onKeyUp="return autoTab(this, 3, event);"
                                            Width="20px" MaxLength="3" TabIndex="5"  ValidationGroup="localize" />-
                                        <asp:TextBox ID="txtPhone2" runat="server" onKeyUp="return autoTab(this, 3, event);"
                                            Width="20px" MaxLength="3" TabIndex="6"  ValidationGroup="localize" />-
                                        <asp:TextBox ID="txtPhone3" runat="server" Width="28px" MaxLength="4" TabIndex="7" ValidationGroup="localize" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="background-color: #FFFFFF" colspan="2">
                                    </td>
                                </tr>
                                <tr>
                                    <td style="background-color: #FFFFFF">&nbsp;
                                        
                                    </td>
                                    <td style="background-color: #FFFFFF" colspan="2">
                                    </td>
                                </tr>
                                <tr>
                                    <td style="background-color: #FFFFFF">&nbsp;
                                        
                                    </td>
                                    <td style="background-color: #FFFFFF" colspan="2">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>



        </div>
        </div>
        <br />
        <asp:Panel runat="server" ID="pnlPromoCode" Visible="false">
            <div>
                <h3 class="blue" style="margin-left: 15px;">
                    Do you have a promotion code? <span class="smallInst">(* Optional)</span></h3>
                <div class="formContainer">
                    <div id="basic">
                        <div style="margin-left: 0px;">
                            <label for="txtPromotionCode">
                                Promotion Code:</label>
                            <asp:TextBox ID="txtPromotionCode" runat="server" MaxLength="30" TabIndex="8"  ValidationGroup="localize" />
                        </div>
                        <div class="fm-req">
                            <label class="small">
                                &nbsp;</label>
                        </div>
                    </div>
                </div>
                <div class="solidRoundedBot">
                    <div>
                    </div>
                </div>
            </div>
            <br />
        </asp:Panel>
        <div style="text-align: right; padding-right: 50px;">            
            <asp:ImageButton ID="btnContinue" runat="server" ImageUrl="continuenew.ccom" AlternateText="Continue" />            
        </div>
        <asp:PlaceHolder ID="phAddressValidators" runat="server">
            <asp:RequiredFieldValidator ID="vldStreet1Required" runat="server" ControlToValidate="txtStreet1"
                Enabled="False" Display="None" ErrorMessage="If Address is used then <b>Street Address</b> is required." />
            <asp:RequiredFieldValidator ID="vldZipCodeRequired" runat="server" ControlToValidate="txtZipCode"
                Enabled="False" Display="None" ErrorMessage="If Address is used then a 5 digit <b>Zip Code</b> is required." />
            <asp:RegularExpressionValidator ID="vldZipCodeRegExp" runat="server" ControlToValidate="txtZipCode"
                Enabled="False" Display="None" ErrorMessage="If Address is used then the <b>Zip Code</b> must be 5 digits."
                ValidationExpression="\d{5}(-\d{4})?" />
        </asp:PlaceHolder>
        <asp:PlaceHolder ID="phPhoneValidators" runat="server">
            <asp:RequiredFieldValidator ID="vldPhone1Required" runat="server" ControlToValidate="txtPhone1"
                Enabled="False" Display="None" ErrorMessage="If Phone Number is used then an <b>Area Code</b> is required." />
            <asp:RegularExpressionValidator ID="vldPhone1" runat="server" ValidationExpression="\d{3}"
                Display="None" Enabled="False" ErrorMessage="If Phone Number is used then the <b>Area Code</b> must be 3 digits."
                ControlToValidate="txtPhone1" />
            <asp:RequiredFieldValidator ID="vldPhone2Required" runat="server" ControlToValidate="txtPhone2"
                Enabled="False" Display="None" ErrorMessage="If Phone Number is used then a <b>Prefix</b> is required." />
            <asp:RegularExpressionValidator ID="vldPhone2" runat="server" ValidationExpression="\d{3}"
                Display="None" Enabled="False" ErrorMessage="If Phone Number is used then the <b>Prefix</b> must be 3 digits."
                ControlToValidate="txtPhone2" />
            <asp:RequiredFieldValidator ID="vldPhone3Required" runat="server" ControlToValidate="txtPhone3"
                Enabled="False" Display="None" ErrorMessage="If Phone Number is used then a <b>Line Number</b> is required." />
            <asp:RegularExpressionValidator ID="vldPhone3" runat="server" ValidationExpression="\d{4}"
                Display="None" Enabled="False" ErrorMessage="If Phone Number is used then the <b>Line Number</b> must be 4 digits."
                ControlToValidate="txtPhone3" />
        </asp:PlaceHolder>
    </div>
</asp:Panel>
<asp:Panel ID="pnlNotFound" runat="server">
    <h2>
        Address Not Found</h2>
    <p>
        Your address was not found in our records.</p>
    <p>
        If one of the following are your address, please click it to continue.</p>
    <ul>
        <asp:Repeater ID="rprAddress" runat="server">
            <ItemTemplate>
                <li>
                    <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "Key")%>'> 
						<%#DataBinder.Eval(Container.DataItem, "Value.Street1")%> 
						<%#DataBinder.Eval(Container.DataItem, "Value.Street2")%>,
						<%#DataBinder.Eval(Container.DataItem, "Value.City")%>,
						<%#DataBinder.Eval(Container.DataItem, "Value.State")%>
						<%#DataBinder.Eval(Container.DataItem, "Value.Zip")%>
                    </asp:LinkButton>
                </li>
            </ItemTemplate>
        </asp:Repeater>
    </ul>
</asp:Panel>
<asp:Panel ID="pnlTryAnother" runat="server">
    <uc:CustomContent ID="ucLocalizeAddressNotFoundContent" ContentKey="Localize:AddressNotFound"
        runat="server" />
</asp:Panel>
<asp:Panel ID="pnlLeadSharing" runat="server" Visible="false">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" id="offercopy">
        <tr>
            <td style="padding-right: 20px; line-height: 150%">
                <div style="margin-left: 75px; width: 551px">
                    <div style="background-position: 50% bottom; background-image: url(../Images/boxtop.jpg);
                        background-repeat: no-repeat; height: 7px">
                    </div>
                    <div style="border-right: #003366 1px solid; padding-right: 25px; background-position: 50% bottom;
                        padding-left: 15px; background-image: url(../Images/boxbg.jpg); padding-bottom: 10px;
                        border-left: #003366 1px solid; padding-top: 15px; background-repeat: repeat-x;
                        height: 136px">
                        <div style="margin-top: 15px; float: right; margin-left: 25px">
                            <a id="LeapFrog" href="<%=FormatUrl()%>">
                                <img src="../Images/orderbutton.gif" alt="click here" border="0" /></a></div>
                        <p class="blue">
                            <strong>We're sorry, Charter Communications does not provide service in your area.</strong></p>
                        <p>
                            Please click on the button to the right to receive offers available in your area.</p>
                    </div>
                    <div style="background-image: url(../Images/boxbot.jpg); background-repeat: no-repeat;
                        height: 10px">
                    </div>
                </div>
                <p>
                    &nbsp;</p>
                <p>
                    &nbsp;</p>
                <p>
                    &nbsp;</p>
                <p>
                    &nbsp;</p>
                <!-- END PROD TABLE -->
            </td>
        </tr>
    </table>
</asp:Panel>
<asp:Panel ID="pnlSmallEnterInfo" runat="server" Visible="false">
    <div style="height: 193px; width: 185px; background: url(../Images/homelocalize.jpg);
        background-repeat: no-repeat;">
        <p style="padding-top: 53px; padding-left: 18px;">
            <strong>Phone:</strong>
            <asp:TextBox ID="txtSmallPhone1" runat="server" onKeyUp="return autoTab(this, 3, event);"
                Width="20px" MaxLength="3" TabIndex="5" />-
            <asp:TextBox ID="txtSmallPhone2" runat="server" onKeyUp="return autoTab(this, 3, event);"
                Width="20px" MaxLength="3" TabIndex="6" />-
            <asp:TextBox ID="txtSmallPhone3" runat="server" Width="28px" MaxLength="4" TabIndex="7" />
        </p>
        <p style="text-align: center;">
            OR
        </p>
        <p style="padding-left: 5px;">
            <strong>Address:</strong>
            <asp:TextBox ID="txtSmallAddress1" runat="server" Width="100px" MaxLength="60" TabIndex="20"
                Text="Enter Address" />
        </p>
        <p style="padding-left: 59px;">
            <asp:TextBox ID="txtSmallAddress2" runat="server" Width="30px" MaxLength="60" TabIndex="21"
                Text="Apt #" />
            <asp:TextBox ID="txtSmallZip" runat="server" Width="40px" MaxLength="5" TabIndex="22"
                Text="Zip" />
        </p>
        <p style="text-align: center; position: relative; top: -3px;">
            <asp:LinkButton ID="btnLocalizeContinue" runat="server"><img src="../Images/homelocalizebutton.jpg" alt="Continue"/></asp:LinkButton>
        </p>
    </div>
</asp:Panel>
