<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SpecialOffers.ascx.vb" Inherits="Controls_SpecialOffers" %>

<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="specialOfferPnl" DefaultButton ="imgbtnFind1" runat ="server">				
    <img id="Img1" src="/CMS_IMAGES/site_check_offers.ccom" runat="server" alt="CHECK SPECIAL OFFERS in your neighborhood" />
    <div id="rightColLocalizePhoneForm" style="display: block;">
	    <label for="rightColLocalizePhoneInpA"></label><p>Enter Your Home Phone:</p>
	    <asp:TextBox runat="server" ID="txtSmallPhone1" CssClass="txtInput" onKeyUp="return autoTab(this, 3, event);" MaxLength="3" Width="20px" ></asp:TextBox>
        <span>-</span>
        <asp:TextBox runat="server" ID="txtSmallPhone2" CssClass="txtInput" onKeyUp="return autoTab(this, 3, event);" MaxLength="3" Width="20px" ></asp:TextBox>
        <span>-</span>
        <asp:TextBox runat="server" ID="txtSmallPhone3" CssClass="txtInput" MaxLength="4" Width="28px" ></asp:TextBox>
        <div>
		    <a href="#">Or enter address</a>
		    <asp:ImageButton id="imgbtnFind1" runat="server" CssClass="btnSubmit" ImageUrl="btn_site_specoffers_find.ccom" AlternateText="CLICK HERE TO FIND OFFERS" OnClick="Find1_ServerClick"/>
		</div>
		    
    </div>
    <div id="rightColLocalizeAddressForm" style="display: none;">
	    <label for="rightColLocalizeAddressInpAddr">Address:</label>
	    <asp:TextBox runat="server" ID="txtSmallAddress1" CssClass="txtInput" MaxLength="60" Width="100px" ></asp:TextBox>
	    <br />
	    <label for="rightColLocalizeAddressInpUnit">Unit/Apt. No.:</label>
	    <asp:TextBox runat="server" ID="txtSmallAddress2" CssClass="txtInput" MaxLength="60" Width="30px" ></asp:TextBox>
	    <label for="rightColLocalizeAddressInpZip">Zip:</label>
	    <asp:TextBox runat="server" ID="txtSmallZip" CssClass="txtInput" MaxLength="5" Width="40px" ></asp:TextBox>
        <div>
            <a href="#">Or enter home phone</a><asp:ImageButton id="imgbtnFind2" runat="server" CssClass="btnSubmit" ImageUrl="btn_site_specoffers_find.ccom" AlternateText="CLICK HERE TO FIND OFFERS" OnClick="Find1_ServerClick"/>
        </div>
    </div>
</asp:Panel>
