<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="View.ascx.cs" Inherits="Christoc.Modules.SuperFormPromotion.View" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<div class="row" id="DivKeys" style="display: none; border: 2px solid green; vertical-align: middle; text-align: center; border-radius: 10px; width: 98%; padding-top: 5px; margin-left: 0px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; background-color: #FFEFD5;">
<div class="col-md-3" id="DivPromotionName">
<label class="visuallyhidden" for="txtdPromotionName"><strong>Promotion Name:</strong></label>
<input id="txtdPromotionName" type="text" class="form-control" style="vertical-align: middle; text-align: center;">
</div>
<div class="col-md-3" id="DivPromotionId">
<label class="visuallyhidden" for="txtdPromotionId"><strong>Promotion Id:</strong></label>
<input id="txtdPromotionId" type="text" class="form-control" style="vertical-align: middle; text-align: center;">
</div>
<div class="col-md-3" id="DivStartDate">
<label class="visuallyhidden" for="txtStartDate"><strong>Start Date:</strong></label>
<input id="txtStartDate" type="text" class="form-control" style="vertical-align: middle; text-align: center;">
</div>
<div class="col-md-3" id="DivEndDate">
<label class="visuallyhidden" for="txtEndDate"><strong>End Date:</strong></label>
<input id="txtEndDate" type="text" class="form-control" style="vertical-align: middle; text-align: center;">
</div>
</div>
<br>
<div class="img-responsive">
<div class="panel panel-primary" id="DivPromoImage" style="display: none; border: 2px solid Blue; border-radius: 10px; width: 98%; text-align: center; vertical-align: middle; margin-left: 0%; padding-bottom: 0px; background-color: aliceblue;">
<%--<img id="ImgPromoImage" src="/DesktopModules/SuperFormPromotion/Images/Sixlets_DisneyCruise.png" class="img-responsive" alt="Updating ..." />--%>
<%--<img id="ImgromoImage" src="https://gobowling.com/Portals/0/images/FloridaLogo800x180.png" class="img-responsive" alt="GoBowling.com" style="margin: auto" />--%>
<img id="ImgPromoImage" src="" class="img-responsive" alt="GoBowling.com" style="margin: auto" />
<div id="PromoBody"></div>
</div>
<br>
<div class="panel panel-primary" id="DivMainForm" style="display: none; border: 2px solid Blue; border-radius: 10px; width: 98%; text-align: center; vertical-align: middle; margin-left: 0%; padding-bottom: 0px;">
<!--Hid the promotion name. Dont think we will need this. -->
<!-- <div class="panel-heading" style="font-size: 20px;">Promotion Name</div> -->
<div class="panel-body" style="padding-left: 15px; padding-right: 15px; display: block;">
<!--Hid the promotion name. Dont think we will need this. -->
<!-- <div class="row">
<div class="col-md-12">
<input id="txtPromotionName" type="text" required class="form-control" />
</div>
</div> -->
<div class="row">
<div class="col-md-12">
<label class="visuallyhidden" for="txtPromotionId"><strong>Promo Id:</strong></label>
<input id="txtPromotionId" type="text" class="form-control" style="display: none;" />
</div>
</div>
<div class="row" id="rowFirstName">
<div class="col-md-12">
<div class="lblFirstName InputSection" style="text-align: left">
<label class="visuallyhidden" for="txtFirstName"><strong>First Name:</strong></label>
<input id="txtFirstName" type="text" autocomplete="on" placeholder="First Name" class="form-control">
</div>
</div>
</div>
<div class="row" id="rowLastName">
<div class="col-md-12">
<div class="lblLastName InputSection" style="text-align: left">
<label class="visuallyhidden" for="txtLastName"><strong>Last Name:</strong></label>
<input id="txtLastName" type="text" autocomplete="on" placeholder="Last Name" class="form-control">
</div>
</div>
</div>
<div class="row" id="rowAddress">
<div class="col-md-12">
<div class="lblAddress1 InputSection" style="text-align: left">
<label class="visuallyhidden" for="txtAddress1"><strong>Address 1:</strong></label>
<input id="txtAddress1" type="text" autocomplete="on" placeholder="Address1" class="form-control">
</div>
</div>
</div>
<div class="row" id="rowAddress2">
<div class="col-md-12">
<div class="lblAddress2 InputSection" style="text-align: left">
<label class="visuallyhidden" for="txtAddress2"><strong>Address 2:</strong></label>
<input id="txtAddress2" type="text" autocomplete="on" placeholder="Address2" class="form-control">
</div>
</div>
</div>
<div class="row" id="rowCity">
<div class="col-md-12">
<div class="lblCity InputSection" style="text-align: left">
<label class="visuallyhidden" for="txtCity"><strong>City:</strong></label>
<input id="txtCity" type="text" autocomplete="on" placeholder="City" class="form-control">
</div>
</div>
</div>
<%-- ------------------------------------------------------------------------------------------------------------------------------------- --%>
<div id="DivImagedownload" style="text-align: center;">
<img id="loading" src="/DesktopModules/SuperFormPromotion/Images/Loading-circle-11.gif" alt="Updating ..." />
</div>
<%-- ------------------------------------------------------------------------------------------------------------------------------------- --%>
<div class="row" id="rowState">
<div class="col-md-12" id="DivState">
<div class="lblState InputSection" style="text-align: left">
<label for="txtState"><strong>State:</strong></label>
<select id="txtState" class="form-control">
<option selected value="0">Select State</option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District Of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT">Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select>
</div>
</div>
</div>
<div class="row" id="rowZipCode">
<div class="col-md-12" id="ZipCode">
<div class="lblZipCode InputSection" style="text-align: left">
<label class="visuallyhidden" for="txtZipCode"><strong>ZipCode:</strong></label>
<input id="txtZipCode" type="text" class="form-control" placeholder="Zip Code Ex: 76011">
</div>
</div>
</div>
<div class="row" id="rowPhone">
<div class="col-md-12" id="DivPhone">
<div class="lblPhone InputSection" style="text-align: left">
<label class="visuallyhidden" for="txtphone"><strong>Phone:</strong></label>
<input id="txtPhone" type="tel" autocomplete="on" placeholder="Phone xxx-xxx-xxxx" class="form-control">
</div>
</div>
</div>
<div class="row" id="rowEmail">
<div class="col-md-12" id="DivEmailAddress">
<div class="lblEmailAddress InputSection" style="text-align: left">
<label class="visuallyhidden" for="txtEmailAddress"><strong>Email Address:</strong></label>
<input id="txtEmailAddress" type="email" autocomplete="on" placeholder="Email Address" class="form-control">
</div>
</div>
</div>
<div class="row" id="rowBirthdate">
<div class="col-md-12" id="DivBirthdate">
<div class="lblEmailAddress InputSection" style="text-align: left">
<label class="visuallyhidden" for="txtBirthdate"><strong>Birthdate:</strong></label>
<input id="txtBirthdate" type="date" autocomplete="on" class="form-control">
</div>
</div>
</div>
<br />
<!-- Put in ID for CSS Purpose -->
<div class="panel panel-default" id="CentOptin">
<div class="panel-body bg-Grey">
<%--<div class="row">
<div class="col-md-12">
<h3><strong>Registration Options</strong></h3>
</div>
</div>--%>
<div class="row bg-info">
<div class="col-md-6" id="DivOptInToGoBowling">
<div class="chkOptInToGoBowling InputSection checkbox">
<label>
<input id="chkOptInToGoBowling" type="checkbox" name="OptInToGoBowling" value="" checked>
Email me GoBowling.com offers.
</label>
</div>
</div>
<div class="col-md-6" id="DivOptInToLocal">
<div class="chkOptInToLocal InputSection checkbox">
<label>
<input id="chkOptInToLocal" type="checkbox" name="OptInToLocal" value="">
Email me local bowling offers.
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" id="DivBowlingCenters" hidden>
<div class="lblCenters InputSection">
<label class="visuallyhidden" id="lblBowlingCenters" for="SelectBowlingCenter"><strong>Bowling Centers:</strong></label>
<p class="White">Select your center from the dropdown list</p>
<select id="SelectBowlingCenter" class="form-control"></select>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12 text-center">
<div class="InputSection">
<input class="btn btn-primary" id="btnAddUser" type="button" value="Submit" onclick="" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<%-------------------------------------------- MapLogo ----------------------------%>
<%--<img class="img-responsive" id="MapLogo" src="/Portals/0/FloridaLogo800x180.png" alt="GoBowling.com" style="margin: auto; display: none;">--%>
<%-- <img id="ImgPromoImage" src="" class="img-responsive" alt="GoBowling.com" style="margin: auto" /> --%>
<img class="img-responsive" id="MapLogo" src="" alt="GoBowling.com" style="margin: auto; display: none;">
<br>
<%-------------------------------------------- Div Search ----------------------------%>
<div class="panel panel-primary" id="Divsearch" style="display: none; border: 2px solid Blue; border-radius: 10px; width: 80%; margin: auto">
<div class="panel-body" style="padding-left: 15px; padding-right: 15px; display: block;">
<div class="row">
<div id="DivZipCode" class="col-md-6 padding-2">
<input id="txtSearchZipCode" type="text" placeholder="Zip Code" class="form-control">
</div>
<%-- <div id="Radius" class="col-md-2 padding-2">
<input id="txtSearchRadius" type="text" placeholder="Radius" class="form-control">
</div>--%>
<div class="col-md-4 padding-2">
<input class="btn btn-primary" id="btnSearchZipCodes" type="button" value="Find Center" onclick="" />
</div>
</div>
</div>
</div>
<%------------------------------maps----------------------------%>
<div class="panel panel-primary" id="Divtopmap" style="display: none; border: 2px solid Blue; border-radius: 10px; margin: auto">
<%--<img class="img-responsive" id="MapLogo" src="/Portals/0/FloridaLogo800x180.png" alt="GoBowling.com">--%>
<%--<div class="panel-heading" style="font-size: 20px; margin: auto">Participating Centers Near You</div>--%>
<div class="panel-body" style="padding-left: 15px; padding-right: 15px;">
<div class="row" id="Divmap">
<div class="container-fluid FAC-Wrapper">
<div class="Nocontainer">
<div class="row">
<div class="col-md-6 FAC-ControlResults" style="background-color: AliceBlue !important;">
<h2>Participating Centers Near You</h2>
<div class="row">
<div class="col-md-12">
<label id="lblResultCount" for="lblResultCount">
</label>
</div>
</div>
<div class="row">
<div id="Div2" class="col-md-12 FAC-SRColumn">
<!-- Repeated -->
<div class="LocationListBox">
<div class="gbbox">
</div>
</div>
<!-- end Repeate -->
</div>
</div>
</div>
<div class="col-md-6 padding-right-0">
<div id="map" style="height: 680px; width: 100%;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<%------------------------------maps----------------------------%>
<div class="modal fade" id="myModalThankyou" tabindex="-1" role="dialog" style="display: none;" aria-labelledby="myModalThankyou">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button id="btnclosemyModalThankyou" type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="H1"></h4>
</div>
<div class="modal-body">
<div class="container-fluid" id="Div4">
<div class="row" style="display: table-cell; vertical-align: middle; text-align: center">
<%--<img id="Modalimages" src="https://gobowling.com/Portals/0/images/GoBowling.png" alt="No image" width="300" height="200" />--%>
<img id="Modalimages" class="img-responsive" src="https://gobowling.com/Portals/0/images/GoBowling.png" alt="No image" style="margin: auto;" />
<h3>Check your email for important follow up information!</h3>
</div>
</div>
</div>
<div id="DivModalfooterThankyou" class="modal-footer">
<button id="btnclosemyModalThankyoux" type="button" class="btn btn-default" data-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<%--------------------------------------Social Media Thank you Message ------------------------%>
<div class="containerText" id="SocialMediaThankYou" style="display: none;">
<div class="SquadLogo"><img src="https://gobowling.com/Portals/0/images/Promos/THANKSFORENTERING300px.png"></div>
<h1 style="color: #fff;">Thank you for entering our $1,000 <br>Macy’s Shopping Spree Sweepstakes!</h1><p>To qualify to win more prizes in our “10 Days of Giveaways” and receive updates on the Macy’s Thanksgiving Day Parade</p>
<p>Follow us on <a href="https://facebook.com/gobowlingdotcom" target="_blank">Facebook</a>, <a href="https://instagram.com/gobowlingdotcom/" target="_blank">Instagram</a> & <a href="https://twitter.com/GoBowlingdotcom" target="_blank">Twitter at GoBowlingDotCom</a></p>
</div>
<%--------------------------------------End of Social Media Thank you Message ----------------%>
<label class="visuallyhidden" for="moduleid"><strong>module id:</strong></label>
<input type="text" id="moduleid" value="<%= ModuleId %>" hidden>
<label class="visuallyhidden" for="urlreferrer"><strong>url referrer:</strong></label>
<input type="text" id="urlreferrer" hidden>
<label class="visuallyhidden" for="txtmycurrentpage"><strong>current page:</strong></label>
<input type="text" id="txtmycurrentpage" hidden>
<label class="visuallyhidden" for="txtPromotionRadius"><strong>Promotion Radius:</strong></label>
<input type="text" id="txtPromotionRadius" hidden>
<link href='http://fonts.googleapis.com/css?family=Schoolbell&v1' rel='stylesheet' type='text/css'>
<%--<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>--%>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA0RUnrf1FKyauOiVijztflaW8TemvN_vI" type="text/javascript"></script>
<script type="text/javascript" src="/DesktopModules/SuperFormPromotion/JavaScriptFiles/ViewJS.js"></script>
<script type="text/javascript">
google.maps.event.addDomListener(window, 'load', initialize);
</script>
var moduleId = $('#moduleid').val();
var browserinformation;
var agent;
var urlreferrer;
var ip;
var RequiredFirstName;
var RequiredLastName;
var RequiredAddress;
var RequiredCity;
var RequiredState;
var RequiredZipCode;
var RequiredPhone;
var RequiredEmail;
var RequiredBirthdate;
var map;
if (typeof map != 'undefined') {
if (typeof myOptions != 'undefined') {
map = new google.maps.Map(document.getElementById('map'), myOptions);
}
}
function initialize() {
var latitude = 32.75625,
longitude = -97.084801,
radius = 8000, //how is this set up
center = new google.maps.LatLng(latitude, longitude),
bounds = new google.maps.Circle({ center: center, radius: radius }).getBounds(),
mapOptions = {
center: center,
zoom: 4,
//zoomControl: false,
//scaleControl: false,
//draggable: false,
//disableDoubleClickZoom: true,
mapTypeId: google.maps.MapTypeId.ROADMAP,
//scrollwheel: false
};
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
//setMarkers(center, radius, map);
}
var gmarkers = [];
function removeMarkers() {
for (i = 0; i < gmarkers.length; i++) {
gmarkers[i].setMap(null);
}
}
function infoBox(map, marker, data) {
var infoWindow = new google.maps.InfoWindow({ content: data });
(function (marker, data) {
// Attaching a click event to the current marker
google.maps.event.addListener(marker, "click", function (e) {
infoWindow.setContent(data);
infoWindow.open(map, marker);
//document.getElementById("txtinputvalue").value = data;
//document.getElementById('<%= txtinputvalue3.ClientID %>').value = data;
});
})(marker, data);
}
// invoked when sending ajax request
$(document).ajaxSend(function () {
$('#DivImagedownload').css('zIndex', 9999);
$('#DivImagedownload').css({ position: 'absolute', top: '50%', left: '50%', margin: 'auto' });
$("#loading").show();
});
// invoked when sending ajax completed
$(document).ajaxComplete(function () {
//document.getElementById("DivAllAttributes").style.paddingBottom = "70px";
$("#loading").hide();
});
// invoked when sending ajax completed
$(document).ajaxError(function () {
$("#loading").hide();
});
$(document).ready(function () {
if ((typeof $.ServicesFramework == 'undefined') || ($.ServicesFramework == null)) {
$("#loading").hide();
//return;
}
if ((typeof moduleId == 'undefined') || (moduleId == null)) {
return;
}
agent = navigator.userAgent;
urlreferrer = document.referrer;
//urlreferrer = window.location.origin;
//$.getJSON("http://jsonip.com?callback=?", function (data) { ip = data.ip; });
//$('html, body').animate({ scrollTop: $('#DivMainForm').offset().top }, 'slow');
//$.getJSON("http://jsonip.com?callback=?", function (data) { $("#txtvip").text(data.ip); });
//$.get("http://ipinfo.io", function (response) { $("#txvtip").text(response.ip); }, "jsonp"); // good
//$.getJSON("https://api.ipify.org/?format=json", function (e) { $("#txvtip").text(e.ip); }); // good
//$.getJSON('//api.ipify.org?format=jsonp&callback=?', function (data) { $("#txtvip").text(data.ip); });
//$.get("http://ipinfo.io", function(response) { alert("1- =" + response.ip); }, "jsonp"); // good
//$.getJSON("https://api.ipify.org/?format=json", function (e) { alert(e.ip); }); // good
//$.getJSON("https://api.ipify.org/?format=json", function (data) { ip = data.ip; $("#txtvip").val(ip); alert(ip); }); //return ip address correctly
//$.getJSON("https://api.ipify.org/?format=json", function (data) { ip = data.ip; $("#txtvip").val(ip); }); //return ip address correctly
$("html, body").animate({ scrollTop: "10px" }, 2);
$("#loading").hide();
//$("#DivKeys").css("display", "none");
//$("#DivPromoImage").css("display", "none");
//$("#DivMainForm").css("display", "none");
//$("#Divtopmap").css("display", "none");
//$("#myModalThankyou").css("display", "none");
// Load the logo
//var storimgLogo = localStorage.getItem("imgLogo");
//document.getElementById("dnn_dnnLOGO_imgLogo").src = "data:image/jpg;charset=utf-8;base64," + storimgLogo;
$("#CentOptin").css('opacity', 0); // hide
});
function ClearFields() {
$('#txtPromotionName').val('');
$('#txtPromotionId').val('');
$('#txtdPromotionName').val('');
$('#txtdPromotionId').val('');
$('#txtStartDate').val('');
$('#txtEndDate').val('');
$('#txtFirstName').val('');
$('#txtLastName').val('');
$('#txtAddress1').val('');
$('#txtAddress2').val('');
$('#txtCity').val('');
//$('#txtState').val('');
$('#txtState').find("option:selected").text(),
$('#txtZipCode').val('');
$('#txtPhone').val('');
$('#txtEmailAddress').val('');
$("#chkOptInToLocal")[0].checked = false;
}
function ClearFormFields() {
$('#txtPromotionName').val('');
$('#txtPromotionId').val('');
$('#txtFirstName').val('');
$('#txtLastName').val('');
$('#txtAddress1').val('');
$('#txtAddress2').val('');
$('#txtCity').val('');
//$('#txtState').val('');
$('#txtState').find("option:selected").text(),
$('#txtZipCode').val('');
$('#txtPhone').val('');
$('#txtEmailAddress').val('');
$("#chkOptInToLocal")[0].checked = false;
}
$("#chkOptInToLocal").change(function () {
var txtzipcode = $("#txtZipCode").val();
if ((typeof txtzipcode !== 'undefined') && (txtzipcode !== null) && (txtzipcode.length >= 5) && ($('#chkOptInToLocal').is(':checked'))) {
$("#DivBowlingCenters").show();
}
else {
//alert("Please Enter a Valid Zipcode");
$("#DivBowlingCenters").hide();
$("#chkOptInToLocal")[0].checked = false;
$("#txtZipCode").focus();
}
});
$("#txtZipCode").change(function () {
var txtzipcode = $("#txtZipCode").val();
var txtPromotionId = $('#txtdPromotionId').val();
if ((typeof txtPromotionId == 'undefined') || (txtPromotionId == null) || (txtPromotionId.length <= 0)) {
alert("Must have a promotion, Please contact your system administrator.");
return;
}
if ((typeof txtzipcode !== 'undefined') && (txtzipcode !== null) && (txtzipcode.length >= 5)) {
//alert( "Handler for .change() called. And Value is " + $("#txtZipCode").val() );
$.ajax({
url: "/DesktopModules/SuperFormPromotion/API/ModuleTask/GetValidCenters?zipcode=" + txtzipcode + '&ModuleId=' + moduleId + "&PromotionId=" + txtPromotionId,
type: "GET",
contentType: 'application/json; charset=utf-8',
//beforeSend: sf.setModuleHeaders,
success: function (data) {
if ((typeof data !== 'undefined') && (data !== null) && (data.length > 0)) {
$('#SelectBowlingCenter').empty();
var options = [];
for (var i = 0; i < data.length; i++) {
options.push('<option value="',
data[i].MemberNo + "--" + data[i].Email + "--" + data[i].CompanyName, '">',
data[i].CompanyName, '</option>');
}
$("#SelectBowlingCenter").html(options.join(''));
$("#SelectBowlingCenter").show();
$("#chkOptInToLocal")[0].checked = false;
$("#DivBowlingCenters").show();
$("#CentOptin").css("display", "block");
$("#CentOptin").css('opacity', 1);
// hide$("#CentOptin").css('opacity', 0); // hide
$("#MapLogo").css("display", "none");
}
else {
$("#SelectBowlingCenter").hide();
//$("#lblBowlingCenters").text("No Centers Found");
$("#chkOptInToLocal")[0].checked = false;
$("#txtZipCode").val('');
$("#txtZipCode").focus();
//alert("No center found within " + $('#txtPromotionRadius').val() + " miles");
alert("No center found within 50 miles");
$("#DivBowlingCenters").hide();
//$("#CentOptin").css("display", "none");
$("#CentOptin").css('opacity', 0);
$("#MapLogo").css("display", "none");
}
},
error: function (data, errorThrown) {
$("#SelectBowlingCenter").hide();
//$("#lblBowlingCenters").text("No Centers Found");
$("#chkOptInToLocal")[0].checked = false;
//$("#CentOptin").css("display", "none");
$("#CentOptin").css('opacity', 0);
$("#DivBowlingCenters").hide();
}
});
}
else {
$("#SelectBowlingCenter").hide();
//$("#lblBowlingCenters").text("No Centers Found");
$("#chkOptInToLocal")[0].checked = false;
//alert("Not Valid Zipcode");
//$("#CentOptin").css("display", "none");
$("#CentOptin").css('opacity', 0);
}
});
function FillUserInformation(promotionname, promotionid, firstname, lastname, address1, address2, city, state, zip, phone, email, Birthdate) {
$('#txtPromotionName').val(promotionname);
//var value = document.getElementById('txtPromotionName').value;
//if (value.length > 2) {
// document.getElementById("txtPromotionName").style['font-size'] = "22px";
// $('#txtPromotionName').css('color', 'blue');
// $('#txtPromotionName').css("font-weight", "Bold");
// $('#txtPromotionName').css("top", "50%");
// $('#txtPromotionName').css('text-align', 'center');
//}
$('#txtPromotionId').val(promotionid);
$('#txtFirstName').val(firstname);
$('#txtLastName').val(lastname);
$('#txtAddress1').val(address1);
$('#txtAddress2').val(address2);
$('#txtCity').val(city);
//$('#txtState').val('');
//$('#txtState').find("option:selected").text(),
$("#txtState").val(state);
$('#txtZipCode').val(zip);
$('#txtPhone').val(phone);
$('#txtEmailAddress').val(email);
$('#txtBirthdate').val(Birthdate);
$("#chkOptInToLocal")[0].checked = false;
if (zip.length == 5) {
$('#txtZipCode').trigger('change');
}
}
function FillPromotionInformation(PromotionName, PromotionId, StartDate, EndDate, PromotionActive, HideFirstName, HideLastName, HideAddress, HideCity, HideState, HideZipCode, HidePhone, HideEmail, HideBirthdate, RequiredFirstName, RequiredLastName, RequiredAddress, RequiredCity, RequiredState, RequiredZipCode, RequiredPhone, RequiredEmail, RequiredBirthdate, PromotionURLImage, ImageFile1, ImageFileLogo, PromotionRadius, PromotionText) {
$("#DivMainForm").css("display", "block");
$("#DivPromoImage").css("display", "block");
$('#txtdPromotionName').val(PromotionName);
$('#txtdPromotionId').val(PromotionId);
$('#txtStartDate').val(StartDate);
$('#txtEndDate').val(EndDate);
//$('#txtExpireDate').val(ExpireDate);
if (HideFirstName == 1) {
$("#rowFirstName").css("display", "none");
} else {
$("#rowFirstName").css("display", "block");
if (RequiredFirstName == 1) {
$("#txtFirstName").attr("required", true);
$("#txtFirstName").prop('required', true);
$('#txtFirstName').attr('required', 'required');
//$('#txtFirstName').css("background-image", "url(/images/r-srchbg_white.png) no-repeat;");
//$('#txtFirstName').css('background-image', 'url(Images/invalid.png)');
//$('#txtFirstName').css({ 'background-image': 'url(Images/invalid.png)', 'background-repeat': 'no-repeat', 'background-position': 'right center', 'background-color': '#fff' });
var storRequiredFirstName = RequiredFirstName;
localStorage.setItem('RequiredFirstName', storRequiredFirstName);
}
}
if (HideLastName == 1) {
$("#rowLastName").css("display", "none");
} else {
$("#rowLastName").css("display", "block");
if (RequiredLastName == 1) {
$("#txtLastName").attr("required", true);
$("#txtLastName").prop('required', true);
//$('#txtLastName').css({ 'background-image': 'url(Images/invalid.png)', 'background-repeat': 'no-repeat', 'background-position': 'right center', 'background-color': '#fff' });
var storRequiredLastName = RequiredLastName;
localStorage.setItem('RequiredLastName', storRequiredLastName);
}
}
if (HideAddress == 1) {
$("#rowAddress").css("display", "none");
$("#rowAddress2").css("display", "none");
$("#rowCity").css("display", "none");
$("#rowState").css("display", "none");
} else {
$("#rowAddress").css("display", "block");
$("#rowAddress2").css("display", "block");
$("#rowCity").css("display", "block");
$("#rowState").css("display", "block");
if (RequiredAddress == 1) {
$("#txtAddress").attr("required", true);
$("#txtCity").attr("required", true);
$("#txtState").attr("required", true);
//$('#txtAddress').css({ 'background-image': 'url(Images/invalid.png)', 'background-repeat': 'no-repeat', 'background-position': 'right center', 'background-color': '#fff' });
var storRequiredAddress = RequiredAddress;
localStorage.setItem('RequiredAddress', storRequiredAddress);
}
}
//if (HideCity == 1) {
// $("#rowCity").css("display", "none");
//} else {
// $("#rowCity").css("display", "block");
// if (RequiredCity == 1) {
// $("#txtCity").attr("required", true);
// }
//}
//if (HideState == 1) {
// $("#rowState").css("display", "none");
//}
if (HideZipCode == 1) {
$("#rowZipCode").css("display", "none");
} else {
$("#rowZipCode").css("display", "block");
if (RequiredZipCode == 1) {
$("#txtZipCode").attr("required", true);
//$('#txtZipCode').css({ 'background-image': 'url(Images/invalid.png)', 'background-repeat': 'no-repeat', 'background-position': 'right center', 'background-color': '#fff' });
var storRequiredZipCode = RequiredZipCode;
localStorage.setItem('RequiredZipCode', storRequiredZipCode);
}
}
if (HidePhone == 1) {
$("#rowPhone").css("display", "none");
} else {
$("#rowPhone").css("display", "block");
if (RequiredPhone == 1) {
$("#txtPhone").attr("required", true);
//$('#txtPhone').css({ 'background-image': 'url(Images/invalid.png)', 'background-repeat': 'no-repeat', 'background-position': 'right center', 'background-color': '#fff' });
var storRequiredPhone = RequiredPhone;
localStorage.setItem('RequiredPhone', storRequiredPhone);
}
}
if (HideEmail == 1) {
$("#rowEmail").css("display", "none");
} else {
$("#rowEmail").css("display", "block");
if (RequiredEmail == 1) {
$("#txtEmailAddress").attr("required", true);
//$('#txtEmailAddress').css({ 'background-image': 'url(Images/invalid.png)', 'background-repeat': 'no-repeat', 'background-position': 'right center', 'background-color': '#fff' });
var storRequiredEmail = RequiredEmail;
localStorage.setItem('RequiredEmail', storRequiredEmail);
}
}
if (HideBirthdate == 1) {
$("#rowBirthdate").css("display", "none");
} else {
$("#rowBirthdate").css("display", "block");
if (RequiredBirthdate == 1) {
$("#txtBirthdate").attr("required", true);
//$('#txtBirthdate').css({ 'background-image': 'url(Images/invalid.png)', 'background-repeat': 'no-repeat', 'background-position': 'right center', 'background-color': '#fff' });
var storRequiredBirthdate = RequiredBirthdate;
localStorage.setItem('RequiredBirthdate', storRequiredBirthdate);
}
}
//$('#txtPromotionRadius').val(PromotionRadius);
if ((typeof PromotionText !== 'undefined') && (PromotionText != null)) {
$('#PromoBody').html(PromotionText);
}
//$("#ImgPromoImage").attr('src', PromotionURLImage);
if ((typeof ImageFile1 !== 'undefined') && (ImageFile1 != null) && (ImageFile1.length > 0)) {
//document.getElementById("ImgPromoImage").src = "data:image/jpg;base64," + ImageFile1;
document.getElementById("ImgPromoImage").src = "data:image/jpg;charset=utf-8;base64," + ImageFile1;
} else {
$("#ImgPromoImage").css("display", "none");
}
if ((typeof ImageFileLogo !== 'undefined') && (ImageFileLogo != null) && (ImageFileLogo.length > 0)) {
if (ImageFileLogo.length > 0) {
document.getElementById("MapLogo").src = "data:image/jpg;charset=utf-8;base64," + ImageFileLogo;
document.getElementById("Modalimages").src = "data:image/jpg;charset=utf-8;base64," + ImageFileLogo;
//var storimgLogo = ImageFileLogo;
//localStorage.setItem('imgLogo', storimgLogo);
} else {
$("#MapLogo").css("display", "none");
}
}
}
function FillPromotionUserInformation(PromotionName, PromotionId, StartDate, EndDate, PromotionURLImage, ImageFile1, ImageFileLogo, PromotionRadius) {
$('#txtdPromotionName').val(PromotionName);
$('#txtdPromotionId').val(PromotionId);
$('#txtStartDate').val(StartDate);
$('#txtEndDate').val(EndDate);
//$('#txtPromotionRadius').val(PromotionRadius);
if ((typeof PromotionText !== 'undefined') && (PromotionText != null)) {
$('#PromoBody').html(PromotionText);
}
//$("#ImgPromoImage").attr('src', PromotionURLImage);
if ((typeof ImageFile1 !== 'undefined') && (ImageFile1 != null) && (ImageFile1.length > 0)) {
document.getElementById("ImgPromoImage").src = "data:image/jpg;base64," + ImageFile1;
} else {
$("#ImgPromoImage").css("display", "none");
}
if ((typeof ImageFileLogo !== 'undefined') && (ImageFileLogo != null) && (ImageFileLogo.length > 0)) {
if (ImageFileLogo.length > 0) {
document.getElementById('MapLogo').src = "data:image/jpg;base64," + ImageFileLogo;
document.getElementById("Modalimages").src = "data:image/jpg;base64," + ImageFileLogo;
}
}
}
function FillPromotionInfo(PromotionName, PromotionId, StartDate, EndDate, PromotionURLImage, ImageFile1, ImageFileLogo, PromotionRadius) {
$("#DivKeys").css("display", "none");
$("#MapLogo").css("display", "block");
$("#DivMainForm").css("display", "none");
$("#Divsearch").css("display", "block");
$("#Divtopmap").css("display", "none");
$('#txtdPromotionName').val(PromotionName);
$('#txtdPromotionId').val(PromotionId);
$('#txtStartDate').val(StartDate);
$('#txtEndDate').val(EndDate);
//$('#txtSearchRadius').val(PromotionRadius);
//if ((typeof ImageFile1 !== 'undefined') && (ImageFile1 != null) && (ImageFile1.length > 0)) {
// document.getElementById("ImgPromoImage").src = "data:image/jpg;base64," + ImageFile1;
//} else {
// $("#ImgPromoImage").css("display", "none");
//}
//if ((typeof ImageFileLogo !== 'undefined') && (ImageFileLogo != null) && (ImageFileLogo.length > 0)) {
// if ($('#dnn_dnnLOGO_imgLogo').length > 0) {
// document.getElementById('dnn_dnnLOGO_imgLogo').src = "data:image/jpg;base64," + ImageFileLogo;
// document.getElementById("Modalimages").src = "data:image/jpg;base64," + ImageFileLogo;
// }
//}
}
function Fillmycurrentpage(mycurrentpage) {
$('#txtmycurrentpage').val(mycurrentpage);
}
function Gotogobowling() {
$(window).attr('location', 'http://gobowling.com/');
//$(window).attr('location', 'http://www.dnndev.me/');
}
$('#btnclosemyModalThankyou').click(function () {
$("#DivPromoImage").css("display", "none");
$("#DivMainForm").css("display", "none");
$("#Divtopmap").css("display", "none");
//$("#myModalThankyou").dialog("close");
(window).attr('location', 'https://gobowling.com/')
//$(window).attr('location', 'http://www.dnndev.me/');
$("#myModalThankyou").closest('.ui-dialog-content').dialog('close');
});
$('#btnclosemyModalThankyoux').click(function () {
$("#DivPromoImage").css("display", "none");
$("#DivMainForm").css("display", "none");
$("#Divtopmap").css("display", "none");
//$("#myModalThankyou").dialog("close");
$(window).attr('location', 'https://gobowling.com/')
//$(window).attr('location', 'http://www.dnndev.me/');
$("#myModalThankyou").closest('.ui-dialog-content').dialog('close');
});
$('#btnAddUser').click(function () {
if ((typeof $.ServicesFramework == 'undefined') || ($.ServicesFramework == null)) {
//return;
}
var OptInToGoBowling;
var OptInToLocal;
var txtmycurrentpage = $('#txtmycurrentpage').val();
if ($('#chkOptInToGoBowling').is(':checked')) {
OptInToGoBowling = 1;
}
else {
OptInToGoBowling = 0;
}
if ($('#chkOptInToLocal').is(':checked')) {
OptInToLocal = 1;
}
else {
OptInToLocal = 0;
}
var txtvalue = $("#SelectBowlingCenter option:selected").val();
if ((typeof txtvalue !== 'undefined') && (txtvalue !== null) && (txtvalue.length > 0)) {
var arr = txtvalue.split('--');
var txtBPAANumber = arr[0];
var txtCenterEmailAddress = arr[1];
var txtCenterName = arr[2];
var centername = txtCenterName.replace(/\(.*?\)/g, '');
var cleancentername = centername.trim();
txtCenterName = cleancentername;
}
else if (((typeof txtvalue == 'undefined') || (txtvalue == null) || (txtvalue.length == 0)) && (OptInToGoBowling == 1) && (OptInToLocal == 0)) {
txtBPAANumber = '9999999999';
$("#chkOptInToLocal")[0].checked = false;
}
else if ((OptInToGoBowling == 0) && (OptInToLocal == 0)) {
txtBPAANumber = '0000000000';
$("#chkOptInToLocal")[0].checked = false;
}
var txtFirstName = $('#txtFirstName').val();
var txtLastName = $('#txtLastName').val();
var txtAddress1 = $('#txtAddress1').val();
var txtAddress2 = $('#txtAddress2').val();
var txtCity = $('#txtCity').val();
var txtState = $("#txtState option:selected").text();
var txtZipCode = $('#txtZipCode').val();
var txtPhone = $('#txtPhone').val();
var txtEmailAddress = $('#txtEmailAddress').val();
var txtPromotionId = $('#txtdPromotionId').val();
var txtPromotionName = $('#txtdPromotionName').val();
var txtbirthdate = $('#txtBirthdate').val();
var storRequiredFirstName = localStorage.getItem("RequiredFirstName");
if (((typeof txtFirstName == 'undefined') || (txtFirstName == null) || (txtFirstName.length == 0)) && (storRequiredFirstName == 1)) {
alert("First Name required.");
return;
}
var storRequiredLastName = localStorage.getItem("RequiredLastName");
if (((typeof txtLastName == 'undefined') || (txtLastName == null) || (txtLastName.length == 0)) && (storRequiredLastName == 1)) {
alert("Last Name required.");
return;
}
var storRequiredAddress = localStorage.getItem("RequiredAddress");
if (((typeof txtAddress1 == 'undefined') || (txtAddress1 == null) || (txtAddress1.length == 0)) && (storRequiredAddress == 1)) {
alert("Address required.");
return;
}
var storRequiredZipCode = localStorage.getItem("RequiredZipCode");
if (((typeof txtZipCode == 'undefined') || (txtZipCode == null) || (txtZipCode.length == 0)) && (storRequiredZipCode == 1)) {
alert("Zip code required.");
return;
}
var storRequiredEmail = localStorage.getItem("RequiredEmail");
if (((typeof txtEmailAddress == 'undefined') || (txtEmailAddress == null) || (txtEmailAddress.length == 0)) && (storRequiredEmail == 1)) {
alert("EmailAddress required.");
return;
}
var storRequiredPhone = localStorage.getItem("RequiredPhone");
if (((typeof txtPhone == 'undefined') || (txtPhone == null) || (txtPhone.length == 0)) && (storRequiredPhone == 1)) {
alert("Phone required.");
return;
}
var storRequiredBirthdate = localStorage.getItem("RequiredBirthdate");
if (((typeof txtbirthdate == 'undefined') || (txtbirthdate == null) || (txtbirthdate.length == 0)) && (storRequiredBirthdate == 1)) {
alert("birth date required.");
return;
}
function validatePhone(txtPhone) {
var phoneReg = /^([\(]{1}[0-9]{3}[\)]{1}[\.| |\-]{0,1}|^[0-9]{3}[\.|\-| ]?)?[0-9]{3}(\.|\-| )?[0-9]{4}$/;
return phoneReg.test(txtPhone);
}
function validateEmail(txtEmailAddress) {
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
return emailReg.test(txtEmailAddress);
}
$.ajax({
url: "/DesktopModules/SuperFormPromotion/API/ModuleTask/AddNewUser?PromotionName=" + txtPromotionName + "&PromotionId=" + txtPromotionId + "&moduleId=" + moduleId + "&FirstName=" + txtFirstName + "&LastName=" + txtLastName + "&Address1=" + txtAddress1 + "&Address2=" + txtAddress2
+ "&City=" + txtCity + "&State=" + txtState + "&ZipCode=" + txtZipCode + "&Phone=" + txtPhone + "&EmailAddress=" + txtEmailAddress + "&Birthdate=" + txtbirthdate + "&BPAANumber=" + txtBPAANumber + "&CenterEmailAddress=" + txtCenterEmailAddress + "&CenterName=" + txtCenterName + "&OptInToGoBowling=" + OptInToGoBowling + "&OptInToLocal=" + OptInToLocal + "&urlreferrer=" + urlreferrer + "&agent=" + agent + "&mycurrentpage=" + txtmycurrentpage,
type: "Post",
cache: false,
contentType: 'application/json; charset=utf-8',
success: function (data) {
//alert("Successfully added");
ClearFields();
$("#DivKeys").css("display", "none");
$("#DivPromoImage").css("display", "none");
$("#DivMainForm").css("display", "none");
$("#Divtopmap").css("display", "none");
$("#Modalimages").addClass("img-responsive");
//$('#myModalThankyou').modal('show');
$("#Modalimages").addClass("img-responsive");
if (txtPromotionId == 901 ) {
$("#SocialMediaThankYou").css("display", "block");
//setTimeout("window.location = 'https://gobowling.com';", 1500);
//$('html, body').animate({ scrollTop: $('#DivThanksYou').offset().top }, 'slow');
//window.location = successURL;
//shakescreen(2);
//setTimeout(5000);
//sleep(5000);
//location.reload(true);
setTimeout("window.location = 'https://linktr.ee/GoBowling';", 4000);
}
},
error: function (data, errorThrown) {
ClearFields();
alert("an error has occurs " + data.responseText);
}
});
});
function disableFields() {
$('#btnAddUser').attr('disabled', 'disabled');
var isDisabled = $('#btnAddUser').is(':disabled');
$('#txtPromotionName').val('You must have a promotion');
$('#txttPromotionName').attr('disabled', 'disabled');
$('#txtPromotionId').attr('disabled', 'disabled');
$('#txtFirstName').attr('disabled', 'disabled');
$('#txtLastName').attr('disabled', 'disabled');
$('#txtAddress1').attr('disabled', 'disabled');
$('#txtAddress2').attr('disabled', 'disabled');
$('#txtCity').attr('disabled', 'disabled');
$("#txtState").attr('disabled', 'disabled');
$('#txtZipCode').attr('disabled', 'disabled');
$('#txtPhone').attr('disabled', 'disabled');
$('#txtEmailAddress').attr('disabled', 'disabled');
$("#chkOptInToLocal").attr("disabled", true);
}
function GetValidCenters(zipcode) {
agent = navigator.userAgent;
urlreferrer = document.referrer;
var txtPromotionId = $('#txtdPromotionId').val();
if ((typeof txtPromotionId == 'undefined') || (txtPromotionId == null) || (txtPromotionId.length <= 0)) {
alert("Must have a promotion, Please contact your system administrator.");
return;
}
//urlreferrer = window.location.origin;
$.getJSON("http://jsonip.com?callback=?", function (data) { ip = data.ip; });
$.ajax({
url: "/DesktopModules/SuperFormPromotion/API/ModuleTask/GetValidCenters?Zipcode=" + zipcode + "&ModuleId=" + moduleId + "&PromotionId=" + txtPromotionId,
type: "GET",
cache: false,
contentType: 'application/json; charset=utf-8',
//beforeSend: sf.setModuleHeaders,
success: function (data) {
if ((typeof data == 'undefined') || (data == null) || (data.length <= 0)) {
$("#lblResultCount").text('no results found'); // txtResultCount" type="text" placeholder="10 results found
//google.maps.event.addDomListener(window, 'load', initialize);
removeMarkers();
$(".LocationListBox > div.gbbox").empty();
return;
}
DisplayListItems(data);
google.maps.event.addDomListener(window, 'load', initialize);
$("#DivKeys").css("display", "none");
$("#Divsearch").css("display", "block");
$("#Divtopmap").css("display", "block");
$("#DivMainForm").css("display", "none");
$("#MapLogo").css("display", "block");
var Lat = 32.756259;
var Lng = -97.084801;
var myLatlng = new google.maps.LatLng(Lat, Lng);
var myOptions = {
zoom: 9,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var iconBowling = '/DesktopModules/SuperFormPromotion/Images/38-61-BowlingMap.png'; //bowling.png
var markerImage = new google.maps.MarkerImage('/DesktopModules/SuperFormPromotion/Images/38-61-BowlingMap.png',
new google.maps.Size(38, 61),
new google.maps.Point(0, 0),
new google.maps.Point(-30, -30));
map = new google.maps.Map(document.getElementById('map'), myOptions);
var location;
if (typeof data != 'undefined') {
for (var i = 0; i < data.length; i++) {
//var args = data[i].split(",");
$("#lblResultCount").text(data.length + " " + 'results found'); // txtResultCount" type="text" placeholder="10 results found
var row = data[i];
location = new google.maps.LatLng(data[i].Latitude, data[i].Longitude)
var marker = new google.maps.Marker({
position: location,
//label: String(i + 1),
label: {
text: String(i + 1),
color: 'white',
fontFamily: 'Arial',
},
labelAnchor: new google.maps.Point(-4, -40),
labelStyle: { opacity: 0.15 },
map: map,
icon: iconBowling,
title: data[i].CompanyName.replace(/(<([^>]+)>)/ig, "") + " \n " + data[i].Address1 + " \n " + data[i].City + ", " + data[i].State + ", " + data[i].ZipCode
});
// Push your newly created marker into the array:
gmarkers.push(marker);
infoBox(map, marker, "<h4>" + data[i].CompanyName.replace(/(<([^>]+)>)/ig, "") + "</h4>" + "<p><span>" + data[i].Address1 + "</span><br>" + "<span>" + data[i].City + ", " + data[i].State + ", " + data[i].ZipCode + "</span></p>");
Lat = data[0].Latitude;
Lng = data[0].Longitude;
var newlocation = new google.maps.LatLng(Lat, Lng);
map.setCenter(newlocation);
}
}
//$("#DivMainForm").css("display", "block");
//$('html, body').animate({ scrollTop: $('#Divmap').offset().top }, 'slow');
},
error: function (data, errorThrown) {
alert("an error has occurs " + data.responseText);
}
});
}
function DisplayListItems(list) {
var centerdistance = 0;
$(".LocationListBox > div.gbbox").empty();
$.each(list, function (index, element) {
centerdistance = centerdistance + 1;
//var UserId = $('#txtUserId').val();
var itemHTML = ["<div class=\"FAC-Result\">",
"<span class=\'locationPin\'> <input id=\'txtlocationPinnumber\' type=\'text\' value=\'" + centerdistance + "\'" + "class=\'txtlocationPinnumber\'> </span><h3>" +
//"<a href=\"javascript:void(0);\" onclick=\"UpdateCenterInfo('" + element.BPAANumber + "', " + UserId + ", '" + element.STEEmail + "');\">" + element.Name + "</a>" +
element.CompanyName +
"</h3>",
//"<a class=\"btn btn-danger pull-right FAC-btnSRSelect\" href=\"javascript:void(0);\" role=\"button\" onclick=\"UpdateCenterInfo('" + element.BPAANumber + "', " + UserId + ", '" + element.STEEmail + "');\">Select This Center</a>",
"<p><span>",
element.Address1 + " <br> " + element.City + ", " + element.State + ", " + element.ZipCode,
"</span><br>",
"<span>",
"<span class=\"fa fa-fw\"></span>" + " " + element.Phone + "<br>",
//"<span class=\"fa fa-fw\"></span>" + " " + element.STEEmail,
"</span></p>",
//"<p><span>",
// "<span class=\"fa fa-fw\"></span> Miles away: " + element.Distance.toFixed(2),
//"</span></p>",
"<br/> <div>",
"</div>",
"</div>"].join('\n');
$(".LocationListBox > div.gbbox").append(itemHTML);
});
}
$("#btnSearchZipCodes").click(function () {
var txtzipcode = $("#txtSearchZipCode").val();
//var txtradiusValue = $('#txtSearchRadius').val();
//txtradiusValue = $.trim(txtradiusValue);
if ((typeof txtzipcode !== 'undefined') && (txtzipcode !== null) && ((txtzipcode.length == 5) || (txtzipcode.length == 6) || (txtzipcode.length == 7))) {
GetValidCenters(txtzipcode);
}
});
$("#DivZipCode input, select").keypress(function (event) {
if (event.which == 13) {
event.preventDefault();
var txtzipcode = $("#txtSearchZipCode").val();
if ((typeof txtzipcode != 'undefined') && (txtzipcode != null) && (txtzipcode.length > 0)) {
$('#btnSearchZipCodes').trigger('click');
}
}
});