' +
'
' +
'
' +
'' +
'' +
' Geo Location Help' +
' |
' +
'
' +
'

' +
'
If this isn\'t your current location click this marker and move it to the desired location!
';
if (showgeolocationhint === false) {
infoWindow.setContent(friendlyinfo);
$('.iw-bottom-gradient').css({ display: 'none' });
infoWindow.open(gmap, marker);
gInfoOpen = true;
showgeolocationhint = true;
setTimeout(function () {
$('button.gm-ui-hover-effect').prepend('
');
}, 100);
}
$.gmarkers.push(marker);
google.maps.event.addListener(marker, 'dragend', function (e) {
marker.position = e.latLng;
overridelookup = true;
latlkp = e.latLng.lat();
lnglkp = e.latLng.lng();
//alert('redo directions?');
calculateAndDisplayRoute();
setTimeout(function () { fitToMarkers($.gmarkers) }, 220);
});
if (LocateCircle != null) {
LocateCircle.setMap(null);
}
// Add circle overlay and bind to marker (radius in metres)
LocateCircle = new google.maps.Circle({
map: gmap,
radius: .05 * 1609.344,
strokeWeight: .5,
fillOpacity: .25,
strokeColor: '#0040ff',
fillColor: '#0040ff'
});
LocateCircle.bindTo('center', marker, 'position');
calculateAndDisplayRoute();
setTimeout(function () { fitToMarkers($.gmarkers) }, 220);
};
var geoError = function (error) {
if (error.code == error.TIMEOUT) {
// Attempt to get GPS loc timed out after 5 seconds,
// try low accuracy location
navigator.geolocation.getCurrentPosition(
geoSuccess,
errorCallback_lowAccuracy,
{ maximumAge: 600000, timeout: 10000, enableHighAccuracy: true });
return;
}
var msg = "
Can't get your location (high accuracy attempt). Error = ";
if (error.code == 1)
msg += "PERMISSION_DENIED";
else if (error.code == 2)
msg += "POSITION_UNAVAILABLE";
msg += ", msg = " + error.message;
$('.a3-spin-wrap').fadeOut();
showMessagePrompt("danger", "Geo Location Status", "We were unable to get your geolocation: " + msg)
};
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
geoSuccess,
geoError,
geoOptions);
}
}
// Pan & Zoom map to show all markers
// this helps fit markers in the viewport
// added config to allow users to choose centering option.
function fitToMarkers(markers) {
var bounds = new google.maps.LatLngBounds();
var latlng;
// Create bounds from all markers
if (gmapcentering == 'all') {
for (var index = 0; index < markers.length; index++) {
latlng = markers[index].getPosition();
bounds.extend(latlng);
}
// Don't zoom in too far on only one marker
if (bounds.getNorthEast().equals(bounds.getSouthWest())) {
var extendPoint1 = new google.maps.LatLng(bounds.getNorthEast().lat() + 0.01, bounds.getNorthEast().lng() + 0.01);
var extendPoint2 = new google.maps.LatLng(bounds.getNorthEast().lat() - 0.01, bounds.getNorthEast().lng() - 0.01);
bounds.extend(extendPoint1);
bounds.extend(extendPoint2);
}
}
//try {
gmap.setZoom(gzoom * 1);
//}
//catch (err) { }
gmap.setCenter(bounds.getCenter());
gmap.fitBounds(bounds);
}
var trafficLayer;
var trafficIsOn = false;
var trafficControl
function calculateAndDisplayRoute() {
directionsService.route({
origin: $.gmarkers[1].position, // document.getElementById('start').value,
destination: $.gmarkers[0].position, // document.getElementById('end').value,
travelMode: 'DRIVING'
}, function (response, status) {
if (status === 'OK') {
directionsDisplay.setDirections(response);
} else {
window.alert('Directions request failed due to ' + status);
}
});
}
function updateCompanyTimePageDropdownHours() {
$.ajax({
type: 'POST',
url: '/CompanyWebService.aspx/GetCompanyHoursHTML',
data: '{"token":"' + getToken() + '","company_id":"' + getCompanyID() + '","location_id":"' + getLocationID() + '","theme":"' + getPageTheme() + '"}',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
async: true,
cache: false,
success: function (response) {
if (response.d == '') {
$('.hours-display-table').html('');
}
else {
$('.hours-display-table').append(response.d);
}
},
failure: function (response) {
showMessagePrompt("danger", "System Status GetCompanyHoursHTML", "Unexpected Failure");
},
error: function (response) {
showMessagePrompt("danger", "System Status GetCompanyHoursHTML", "Unexpected Error");
}
});
}
function initControls() {
$(document.body).tooltip({ selector: "[title]", trigger: 'hover', container: 'body', html: true, delay: { "show": 800, "hide": 100 } });
var rateval = $('.rateit-main-display').attr('data-rateit-value');
if (rateval.indexOf('0') == 0) {
$('.ratings-prompt').text("Be the First to Leave a Rating!");
}
else {
$('.ratings-prompt').text("");
}
$('.ratings-details').text(getRatingsAvergeDisplay());
$('.rateit').rateit(); //init
$('.rateit-main-display').rateit('value', getRatingsAverge()); //set vals
setRatingsCount(getRatingsCount());
setCommentsCount(getCommentsCount());
setVotesCount(getVotesCount());
$('.note-statusbar').hide();
$("time.timeago").timeago()
}
function setLightMapTheme() {
gmap.setOptions({
styles: []
});
gmaptheme = "-light";
//$('#iw-container').find('div.iw-title').addClass('light');
//$('#iw-container').find('div.iw-content').addClass('light');
//$('#iw-container').find('div.iw-subTitle').addClass('light');
//alert(getPageTheme());
//var iwOuter = $('.gm-style-iw');
//alert(getPageTheme());
//if (getPageTheme() === "-light") {
// var iwOuter = $('.gm-style-iw');
// var iwBackground = iwOuter.prev();
// $('.gm-style-iw').css('border','1px solid');
// $('.gm-style-iw').css('padding','10px');
// alert($('.gm-style-iw').length);
// $('.gm-style-iw').css('box-shadow','5px 10px red');
// alert('?');
// //iwBackground.children(':nth-child(3)').find('div').addClass('animated fadeIn').children().css({ 'box-shadow': '0 .01rem .5rem rgba(61,153,112,0.65)', 'z-index': '1', 'background-color': 'rgba(255, 255, 255, .8)' });
//}
}
function setDarkMapTheme() {
gmaptheme = "-dark";
//$('#iw-container').find('div.iw-title').removeClass('light');
//$('#iw-container').find('div.iw-content').removeClass('light');
//$('#iw-container').find('div.iw-subTitle').removeClass('light');
//var iwOuter = $('.gm-style-iw');
if (getPageTheme() === "-light") {
var iwOuter = $('.gm-style-iw');
var iwBackground = iwOuter.prev();
//iwBackground.children(':nth-child(3)').find('div').addClass('animated fadeIn').children().css({ 'box-shadow': '0 .01rem .5rem rgba(61,153,112,0.65)', 'z-index': '1', 'background-color': 'rgba(0, 0, 0, .8)' });
}
//var iwBackground = iwOuter.prev();
//iwBackground.children(':nth-child(3)').find('div').addClass('animated fadeIn').children().css({ 'box-shadow': '0 .01rem .5rem rgba(61,153,112,0.65)', 'z-index': '1', 'background-color': 'rgba(0, 0, 0, .8)' });
gmap.setOptions({
styles: [
{ elementType: 'geometry', stylers: [{ color: '#242f3e' }] },
{ elementType: 'labels.text.stroke', stylers: [{ color: '#242f3e' }] },
{ elementType: 'labels.text.fill', stylers: [{ color: '#746855' }] },
{
featureType: 'administrative.locality',
elementType: 'labels.text.fill',
stylers: [{ color: '#d59563' }]
},
{
featureType: 'poi',
elementType: 'labels.text.fill',
stylers: [{ color: '#d59563' }]
},
{
featureType: 'poi.park',
elementType: 'geometry',
stylers: [{ color: '#263c3f' }]
},
{
featureType: 'poi.park',
elementType: 'labels.text.fill',
stylers: [{ color: '#6b9a76' }]
},
{
featureType: 'road',
elementType: 'geometry',
stylers: [{ color: '#38414e' }]
},
{
featureType: 'road',
elementType: 'geometry.stroke',
stylers: [{ color: '#212a37' }]
},
{
featureType: 'road',
elementType: 'labels.text.fill',
stylers: [{ color: '#9ca5b3' }]
},
{
featureType: 'road.highway',
elementType: 'geometry',
stylers: [{ color: '#746855' }]
},
{
featureType: 'road.highway',
elementType: 'geometry.stroke',
stylers: [{ color: '#1f2835' }]
},
{
featureType: 'road.highway',
elementType: 'labels.text.fill',
stylers: [{ color: '#f3d19c' }]
},
{
featureType: 'transit',
elementType: 'geometry',
stylers: [{ color: '#2f3948' }]
},
{
featureType: 'transit.station',
elementType: 'labels.text.fill',
stylers: [{ color: '#d59563' }]
},
{
featureType: 'water',
elementType: 'geometry',
stylers: [{ color: '#17263c' }]
},
{
featureType: 'water',
elementType: 'labels.text.fill',
stylers: [{ color: '#515c6d' }]
},
{
featureType: 'water',
elementType: 'labels.text.stroke',
stylers: [{ color: '#17263c' }]
}
]
});
}
function getMapMarkerAjax(inmarker, intoken, data) {
$('body').tooltip('hide');
$('body').find('div.tooltip').hide();
$.ajax({
type: 'POST',
url: '/MapWebService.aspx/GetMapMarkerInfo2',
data: '{"token":"' + getToken() + '","company_id":"' + data.company_id + '","isfeatured":"' + data.fead + '","location_id":"' + data.location_id + '"}',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
async: true,
cache: false,
success: function (response) {
//alert(response.d.indexOf("$$whichone$$"));
var icontent = response.d;
infoWindow.setContent(icontent.replace(/whichone/gi, 'ratings'));
infoWindow.open(gmap, inmarker);
setTimeout(function () {
$('button.gm-ui-hover-effect').prepend('');
}, 100);
$('.iw-bottom-gradient').fadeIn();
$('body').find('.ctd-date-wrapper').each(function () {
var ctl = $(this);
if (ctl.length == 1) {
var todayval = $(ctl).attr('data-today-val');
if (todayval.length > 0) {
//initCountDownDisplay(todayval);
return false;
}
}
else {
showMessagePrompt("danger", "System Status", "Unexpected Failure ctl.length == 0 ctd-date-wrapper");
}
});
gInfoOpen = true;
},
failure: function (response) {
showMessagePrompt('danger', 'Error', "An Unexpected Service Failure Occurred 1.
Please check your request and try again.");
},
error: function (response) {
showMessagePrompt('danger', 'Error', "An Unexpected Error Occurred.
Please check your request and try again.");
}
});
}
var trafficLayer
var trafficIsOn = false;
var trafficText
var nightText
// START TRAFFIC CONTROL
function TrafficControl(controlDiv, map) {
// Set CSS for the control border.
var controlUI = document.createElement('button');
$(controlUI).attr("class", "btn -light a3-theme -xs -info map-traffic");
$(controlDiv).attr("data-placement", "right");
controlUI.style.marginLeft = '10px';
controlUI.style.marginTop = '10px';
controlUI.style.marginBottom = '0px';
controlUI.style.width = '40px';
controlUI.style.height = '40px';
// controlUI.style.maxWidth = '120px';
// controlUI.style.minWidth = '50px';
controlUI.style.paddingLeft = '.5rem';
controlUI.style.paddingRight = '.5rem';
controlDiv.title = 'Toggle Traffic View';
controlDiv.appendChild(controlUI);
// Set CSS for the control interior.
trafficText = document.createElement('div');
$(trafficText).attr("class", "toggle-text");
trafficText.innerHTML = '';
controlUI.appendChild(trafficText);
// Setup the click event listeners: simply set the map to Chicago.
controlUI.addEventListener('click', function (e) {
e.preventDefault();
trafficSetup();
});
$(document.body).tooltip({ selector: "[title]", trigger: 'hover', container: 'body', html: true });
}
function trafficSetup() {
// Traffic Btn Click Event
if (trafficIsOn == false) {
trafficLayer.setMap(gmap);
$('.map-traffic').removeClass('-light').addClass('-info');
//trafficText.innerHTML = '';
trafficIsOn = true;
} else {
trafficIsOn = false;
trafficLayer.setMap(null);
$('.map-traffic').removeClass('-info').addClass('-light');
//trafficText.innerHTML = '';
}
}
// -END TRAFFIC CONTROL
// START LOCATE CONTROL
function LocateControl(controlDiv, map) {
// Set CSS for the control border.
var controlUI = document.createElement('button');
$(controlUI).attr("class", "btn -light a3-theme -xs -info locate-btn map-locate");
$(controlDiv).attr("data-placement", "right");
controlUI.style.marginLeft = '10px';
controlUI.style.marginTop = '1px';
controlUI.style.width = '40px';
controlUI.style.height = '40px';
controlUI.style.paddingLeft = '.5rem';
controlUI.style.paddingRight = '.5rem';
//controlUI.style.maxWidth = '120px';
//controlUI.style.minWidth = '50px';
controlDiv.title = 'Locate Me!';
controlDiv.appendChild(controlUI);
// Set CSS for the control interior.
locateText = document.createElement('div');
$(locateText).attr("class", "locate-toggle-text");
locateText.innerHTML = '';
controlUI.appendChild(locateText);
// Setup the click event listeners: simply set the map to Chicago.
controlUI.addEventListener('click', function (e) {
e.preventDefault();
locateSetup();
});
$(document.body).tooltip({ selector: "[title]", trigger: 'hover', container: 'body', html: true });
}
var isLocated = false;
function locateSetup() {
// throttle this or we get limited.
if (isLocated == false) {
isLocated = true;
$('.map-locate').removeClass('-light').addClass('-info');
getClientIP();
locateText.innerHTML = '';
}
}
// -END LOCATE CONTROL
// START NIGHTVISION CONTROL
function NightVisionControl(controlDiv, map) {
// Set CSS for the control border.
var controlUI = document.createElement('button');
$(controlUI).attr("class", "btn -light a3-theme -xs -info map-nightvision");
if (getPageTheme() == "-dark") {
$(controlUI).attr("class", "btn -info -xs -info map-nightvision");
}
$(controlDiv).attr("data-placement", "right");
controlUI.style.marginLeft = '10px';
controlUI.style.marginTop = '1px';
controlUI.style.width = '40px';
controlUI.style.height = '40px';
//controlUI.style.maxWidth = '120px';
//controlUI.style.minWidth = '50px';
controlUI.style.paddingLeft = '.5rem';
controlUI.style.paddingRight = '.5rem';
controlDiv.title = 'Toggle Night Vision!';
controlDiv.appendChild(controlUI);
// Set CSS for the control interior.
nightText = document.createElement('div');
$(nightText).attr("class", "night-vision-toggle-text");
nightText.innerHTML = '';
controlUI.appendChild(nightText);
// Setup the click event listeners: simply set the map to Chicago.
controlUI.addEventListener('click', function (e) {
e.preventDefault();
nightVisionSetup();
});
$(document.body).tooltip({ selector: "[title]", trigger: 'hover', container: 'body', html: true });
}
function nightVisionSetup() {
if ($('.map-nightvision').hasClass('-light') == true) {
curmaptheme = "DARK";
$(this).data('value', "DARK");
$('.map-nightvision').removeClass('-light').addClass('-info');
nightText.innerHTML = '';
setDarkMapTheme();
}
else {
$(this).data('value', "LIGHT");
curmaptheme = "LIGHT";
$('.map-nightvision').removeClass('-info').addClass('-light');
nightText.innerHTML = '';
setLightMapTheme();
}
} // trafficSetup Ends
// -END NIGHTVISION CONTROL
function initInteractiveMapView(lat, lng) {
glat = lat;
glng = lng;
var markers = [];
$.gmarkers = [];
$.gwindows = [];
var tmpi = 0;
var cpy = getCompanyName();
var fead = getIsFeatured();
var company_id = getCompanyID();
var stemp = '{\"title\":' + JSON.stringify(cpy) + ',\"latitude\":' + (lat * 1) + ',\"longitude\":' + (lng * 1) + ',\"fead\":' + fead + ',\"company_id\":' + JSON.stringify(company_id) + ',\"location_id\":' + getLocationID() + '}';
if ($.inArray(cpy, markers) == -1) {
markers.push(stemp);
tmpi++;
}
// build markers from visible rows..
var modata = $.parseJSON(markers[0]);
var mtypid = google.maps.MapTypeId.ROADMAP;
var showpano = false;
if (getCompanyMapType() == "roadmap") {
mtypid = google.maps.MapTypeId.ROADMAP;
$('body').find('.btn-map-setting').each(function () {
if ($(this).data('value') == 'ROADMAP') {
$(this).removeClass('-light');
$(this).addClass('-info');
}
});
}
if (getCompanyMapType() == "street") {
mtypid = google.maps.MapTypeId.ROADMAP;
$('.btn-map-setting[data-value="STREET"]').removeClass('-light');
$('.btn-map-setting[data-value="STREET"]').addClass('-info active');
showpano = true;
$('body').find('.btn-map-setting').each(function () {
if ($(this).data('value') == 'STREET') {
$(this).removeClass('-light');
$(this).addClass('-info');
}
});
}
if (getCompanyMapType() == "satellite") {
mtypid = google.maps.MapTypeId.SATELLITE;
$('body').find('.btn-map-setting').each(function () {
if ($(this).data('value') == 'SATELLITE') {
$(this).removeClass('-light');
$(this).addClass('-info');
}
});
}
if (getCompanyMapType() == "terrain") {
mtypid = google.maps.MapTypeId.TERRAIN;
$('body').find('.btn-map-setting').each(function () {
if ($(this).data('value') == 'TERRAIN') {
$(this).removeClass('-light');
$(this).addClass('-info');
}
});
}
if (getCompanyMapType() == "hybrid") {
mtypid = google.maps.MapTypeId.HYBRID;
$('body').find('.btn-map-setting').each(function () {
if ($(this).data('value') == 'HYBRID') {
$(this).removeClass('-light');
$(this).addClass('-info');
}
});
}
var mapOptions = {
scrollwheel: false,
zoomControl: true,
zoomControlOptions: {
position: google.maps.ControlPosition.RIGHT_TOP
},
center: new google.maps.LatLng((modata.latitude * 1), (modata.longitude * 1)),
zoom: gzoom * 1,
mapTypeId: mtypid,
mapTypeControl: false,
scaleControl: true,
streetViewControl: true,
streetViewControlOptions: {
position: google.maps.ControlPosition.RIGHT_TOP
},
fullscreenControl: false
};
infoWindow = new google.maps.InfoWindow({
// Assign a maximum value for the width of the infowindow allows
// greater control over the various content elements
maxWidth: 350,
content: ""
});
directionsService = new google.maps.DirectionsService;
directionsDisplay = new google.maps.DirectionsRenderer;
var map = new google.maps.Map(document.getElementById("map_pano"), mapOptions);
google.maps.event.addListener(map, 'click', function () {
$('.gm-style-iw').fadeOut(800, function () {
infoWindow.close();
gInfoOpen = false;
});
$('body').tooltip('hide');
$('body').find('div.tooltip').hide();
});
directionsDisplay.setMap(map);
// supressing the markers allows to draw my own.
directionsDisplay.setOptions({ suppressMarkers: true });
var pano = new google.maps.StreetViewPanorama(document.getElementById('map_pano'), {
position: new google.maps.LatLng((modata.latitude * 1), (modata.longitude * 1)),
scrollwheel: false,
pov: {
heading: getCompanyPOVHeading() * 1,
pitch: getCompanyPOVPitch() * 1,
zoom: gpanozoom * 1
},
visible: showpano
});
pano.addListener('zoom_changed', function () {
gpanozoom = pano.getZoom();
});
google.maps.event.addListener(pano, 'visible_changed', function () {
gtheme = $('.company-container').hasClass('-light') == true ? '-light' : '-dark';
if (gmaptheme === '') {
gmaptheme = gtheme;
}
if (pano.getVisible()) {
// Display your street view visible UI
$('.btn-map-setting').removeClass('active');
$('.btn-map-setting').removeClass('-info');
$('body').find('.btn-map-setting').each(function () {
if ($(this).hasClass(gtheme) == false) {
$(this).addClass(gtheme)
}
});
$('.btn-map-setting[data-value="STREET"]').removeClass(gtheme);
$('.btn-map-setting[data-value="STREET"]').addClass('-info active');
}
});
gpano = pano;
// MAP EVENTS
pano.addListener('pano_changed', function () {
});
pano.addListener('position_changed', function () {
});
pano.addListener('pov_changed', function () {
});
gmap = map;
gmap.setStreetView(gpano);
google.maps.event.addListener(gmap, "maptypeid_changed", function () {
});
for (i = 0; i < markers.length; i++) {
var data = $.parseJSON(markers[i]);
var myLatlng = new google.maps.LatLng((data.latitude * 1), (data.longitude * 1));
var mapIcon = getMapMarkerImage();
//alert(mapIcon);
if (data.fead == 1) {
mapIcon = '/assets/img/maps/feat-1.png';
}
var marker;
var anim = data.fead == 1 ? true : false;
if (anim == true) {
marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: data.title,
animation: google.maps.Animation.DROP,
icon: mapIcon
});
}
else {
marker = new google.maps.Marker({
position: myLatlng,
map: map,
//title: data.title,
icon: mapIcon
});
}
$.gmarkers.push(marker);
TargetCircle = new google.maps.Circle({
map: gmap,
radius: .05 * 1609.34,
strokeWeight: .5,
fillOpacity: 0.25,
strokeColor: '#00AA00',
fillColor: '#00AA00'
});
TargetCircle.bindTo('center', $.gmarkers[0], 'position');
(function (marker, data) {
google.maps.event.addListener(marker, "click", function (e) {
getMapMarkerAjax(marker, getToken(), data);
});
if (i == 0) {
google.maps.event.addListenerOnce(gmap, 'tilesloaded', function () {
getMapMarkerAjax(marker, getToken(), data);
});
}
})(marker, data);
}// end for
/*
* The google.maps.event.addListener() event waits for
* the creation of the infowindow HTML structure 'domready'
* and before the opening of the infowindow defined styles
* are applied.
*/
google.maps.event.addListener(infoWindow, 'domready', function () {
// Reference to the DIV that wraps the bottom of infowindow
//$('.gm-style-iw').hide();
var iwOuter = $('.gm-style-iw');
/* Since this div is in a position prior to .gm-div style-iw.
* We use jQuery and create a iwBackground variable,
* and took advantage of the existing reference .gm-style-iw for the previous div with .prev().
*/
var iwBackground = iwOuter.prev();
// Removes white background DIV
//iwBackground.children(':nth-child(4)').css({ 'display': 'none' });
// Removes background shadow DIV
//iwBackground.children(':nth-child(2)').css({ 'display': 'none' });
//iwBackground.children(':nth-child(2)').css({ 'top': '100px;' });
//iwBackground.children(':nth-child(3)').css({ 'display': 'none' });
// Changes the desired tail shadow color.
gtheme = $('.company-container').hasClass('-light') == true ? '-light' : '-dark';
if (gmaptheme == '') {
gmaptheme = gtheme;
}
if (gmaptheme === '-dark') {
// $('#iw-container').find('div.iw-title').addClass('dark');
// $('#iw-container').find('div.iw-content').addClass('dark');
// $('#iw-container').find('div.iw-subTitle').addClass('dark');
//iwBackground.children(':nth-child(3)').find('div').addClass('animated fadeIn').children().css({ 'box-shadow': '0 .01rem .5rem rgba(61,153,112,0.65)', 'z-index': '1', 'background-color': 'rgba(0, 0, 0, .8)' });
}
else {
// $('#iw-container').find('div.iw-title').addClass('light');
// $('#iw-container').find('div.iw-content').addClass('light');
// $('#iw-container').find('div.iw-subTitle').addClass('light');
//iwBackground.children(':nth-child(3)').find('div').addClass('animated fadeIn').children().css({ 'box-shadow': '0 .01rem .5rem rgba(61,153,112,0.65)', 'z-index': '1', 'background-color': 'rgba(255, 255, 255, .8)' });
}
//::-webkit-scrollbar-track {
// background: -webkit-linear-gradient(top, rgba(33,33,33,0), #000);
// background: -moz-linear-gradient(top, rgba(33,33,33,0), #000);
// background: -o-linear-gradient(top, rgba(33,33,33,0), #000);
// background: -ms-linear-gradient(top, rgba(33,33,33,0), #000);
// background: linear-gradient(to bottom, rgba(33,33,33,0), #000);
//}
//::-webkit-scrollbar-thumb {
// -webkit-background-clip: content;
// -moz-background-clip: content;
// background-clip: content-box;
// background-color: rgba(0,0,0,0.75);
// border-radius: 3px;
//}
// Reference to the div that groups the close button elements.
var iwCloseBtn = iwOuter.next();
// The API automatically applies 0.7 opacity to the button after the mouseout event. This function reverses this event to the desired value.
iwCloseBtn.mouseout(function () {
$(this).css({ opacity: '1' });
});
if ($('.iw-content').height() < 140) {
$('.iw-bottom-gradient').css({ display: 'none' });
}
else {
$('.iw-bottom-gradient').fadeIn();
}
//if (gmaptheme === '-dark') {
// $(iwCloseBtn).attr('class', 'iw-close btn -sm')
// .css('height', '30px')
// .css('width', '30px')
// .css('padding', '.1rem .2rem')
// .css('right', '57px')
// .css('top', '22px')
// .css('z-index', '10000')
// .css('display', 'none')
// .html('×');
//}
//else {
// $(iwCloseBtn).attr('class', 'iw-close btn -sm')
// .css('height', '30px')
// .css('width', '30px')
// .css('padding', '.1rem .2rem')
// .css('right', '57px')
// .css('top', '22px')
// .css('z-index', '10000')
// .css('display', 'none')
// .html('×');
//}
$(iwCloseBtn).find('img').remove();
//$('.gm-style-iw').fadeIn(function () {
//iwBackground.children(':nth-child(3)').fadeIn();
// });
setTimeout(function () {
$(iwCloseBtn).fadeIn('slow');
}, 1000);
});
google.maps.event.addDomListener(window, "resize", function () {
var center = map.getCenter();
google.maps.event.trigger(map, "resize");
map.setCenter(center);
});
// Traffic Control
if ($('body').find('.traffic-control-wrapper').length == 0) {
trafficLayer = new google.maps.TrafficLayer();
var trafficControlDiv = document.createElement('div');
$(trafficControlDiv).attr('class', 'traffic-control-wrapper')
//traffic
trafficControl = new TrafficControl(trafficControlDiv, gmap);
trafficControlDiv.index = 1;
gmap.controls[google.maps.ControlPosition.TOP_LEFT].push(trafficControlDiv);
}
// Night Vision Control
if ($('body').find('.nightvision-control-wrapper').length == 0) {
var nightControlDiv = document.createElement('div');
$(nightControlDiv).attr('class', 'nightvision-control-wrapper')
//traffic
var nightControl = new NightVisionControl(nightControlDiv, gmap);
nightControlDiv.index = 1;
gmap.controls[google.maps.ControlPosition.LEFT_TOP].push(nightControlDiv);
}
// Locate Me Control
if ($('body').find('.locate-control-wrapper').length == 0) {
var locateControlDiv = document.createElement('div');
$(locateControlDiv).attr('class', 'nightvision-control-wrapper')
//traffic
var locateControl = new LocateControl(locateControlDiv, gmap);
locateControlDiv.index = 1;
gmap.controls[google.maps.ControlPosition.LEFT_TOP].push(locateControlDiv);
}
}
function youNeedToJoin(classname, icon, icon_message, body, btncaption) {
var output = '';
var template_path = "/assets/templates/volta/a3/modal/template_prompt_only.html?v=1.1";
$.ajax({
url: template_path,
dataType: "text",
success: function (data) {
display = data;
// do replacements...
display = display.replace('$$modal_icon$$', icon);
display = display.replace('$$modal_icon_message$$', icon_message);
display = display.replace('$$modal_body$$', body);
var box = bootbox.dialog({
closeButton: false,
className: "-" + classname,
message: display,
buttons: {
exit: {
label: 'No Thanks',
className: '-danger',
callback: function () {
bootbox.hideAll();
}
},
cancel: {
label: 'Sign In',
className: '-primary',
callback: function () {
bootbox.hideAll();
top.window.location.assign('/user/login?ReturnUrl=' + '/ratings/amber-brick-1');
}
},
alternate: {
label: 'Register Now',
className: '-secondary',
callback: function () {
bootbox.hideAll();
top.window.location.assign('/account/user/register?ReturnUrl=' + '/ratings/amber-brick-1');
}
},
ok: {
label: btncaption,
className: '-light ' + classname,
callback: function () {
bootbox.hideAll();
top.window.location.assign('/join-now');
}
}
}
})
.on('shown.bs.modal', function (e) {
$('button[data-bb-handler="ok"]').focus();
})
.on('hide.bs.modal', function (e) {
setTimeout(function () {
}, 300);
})
.find("div.modal-dialog");
}
});
return output;
}
$.fn.extend({
placeCursorAtEnd: function () {
// Places the cursor at the end of a contenteditable container (should also work for textarea / input)
try {
if (this.length === 0) {
return;
}
var el = this[0];
var range = document.createRange();
var sel = window.getSelection();
var childLength = el.childNodes.length;
if (childLength > 0) {
var lastNode = el.childNodes[childLength - 1];
var lastNodeChildren = lastNode.childNodes.length;
range.setStart(lastNode, lastNodeChildren);
range.collapse(true);
sel.removeAllRanges();
sel.addRange(range);
}
}
catch (err) { }
return this;
}
});
// CLICK HANDLERS
$('body').on('click', '.join-now', function (e) {
// showBackground();
e.preventDefault();
window.location.assign("/join-now");
});
$('body').on('click', '.iw-close', function (e) {
e.preventDefault();
$('.gm-style-iw').fadeOut('slow', function () {
infoWindow.close();
$('body').find('div.tooltip').hide();
});
$('body').tooltip('hide');
$('body').find('div.tooltip').hide();
});
$('body').on('click', '.btn-show-rating', function (e) {
e.preventDefault();
try {
$('html, body').animate({ scrollTop: $("#a3_comments").offset().top }, 1000);
} catch (err) { }
});
$('body').on('click', '.map-directions', function (e) {
$('body').tooltip('hide');
$('body').find('div.tooltip').hide();
e.preventDefault();
window.location.assign('/get-directions/' + getCompanySEO() + '/' + getRootPath());
//window.location.assign('/united-states/' + getState() + '/maps/directions/' + getCompanySEO() + '/' + getLocationID());
});
$('body').on('click', '.btn-map-setting', function (e) {
$('body').tooltip('hide');
$('body').find('div.tooltip').hide();
e.preventDefault();
var target = $(this).data('target');
var value = $(this).data('value');
$('.btn-map-setting').removeClass('-info');
$('.btn-map-setting').removeClass('active');
$('body').find('.btn-map-setting').each(function () {
if ($(this).hasClass(gtheme) == false) {
$(this).addClass(gtheme)
}
});
//alert(target);
switch (target) {
case "map_type": {
switch (value) {
case "STREET": {
gpano.setVisible(true); //set visible
break;
}
default: {
//gpano need to set invisible..
gpano.setVisible(false);
if (value == "ROADMAP") {
gmap.setMapTypeId(google.maps.MapTypeId.ROADMAP);
}
if (value == "SATELLITE") {
if (trafficIsOn == false) {
gmap.setMapTypeId(google.maps.MapTypeId.SATELLITE);
}
else {
gmap.setMapTypeId(google.maps.MapTypeId.HYBRID);
}
}
if (value == "TERRAIN") {
gmap.setMapTypeId(google.maps.MapTypeId.TERRAIN);
}
break;
}
}
break;
}
}
$(this).removeClass(gtheme);
$(this).addClass('-info active');
});
// some temp admin stuff to make debugging page faster..
$('body').on('click', 'a.company-display', function (e) {
e.preventDefault();
var target = $(this).data('target');
childDisplay(target);
});
$('body').on('click', '.a3-signout', function (e) {
e.preventDefault();
$('body').find('a').addClass('disabled');
$('body').find('a').prop('disabled', 'disabled');
$('body').find('button').addClass('disabled');
$('body').find('input[type="button"]').addClass('disabled');
var $spinner = $(this).find('.a3-spin-text');
$spinner.html('');
$spinner.addClass('fa fa-spin fa-repeat');
setTimeout(function () {
SignMeOut(getToken());
}, 100);
});
// doc.ready
jQuery(document).ready(function () {
$("#shareIconsCountInside").jsSocials({
url: "https://www.420a3.com/ratings/amber-brick-1",
text: "Amber Brick A3N© Ratings and Comments Page presented by 420A3.Com> ",
showLabel: false,
showCount: "inside",
shares: ["twitter", "facebook", "pinterest"]
});
$(".shareIcons").jsSocials({
url: "https://www.420a3.com/ratings/amber-brick-1",
text: "Amber Brick A3N© Ratings and Comments Page presented by 420A3.Com> ",
showLabel: false,
showCount: false,
shares: ["twitter", "facebook", "pinterest"]
});
updateCompanyTimePageDropdown();
$('.date').datetimepicker({
format: 'LT'
});
setCompanyLayoutHeight();
$(function () {
// Declare a proxy to reference the hub.
var notifications = $.connection.a3notify;
// Create a function that the hub can call to broadcast messages.
notifications.client.growl = function (classname, name, message, time) {
showQuickNotificationX(classname, $('
').text(name).html(), $('
').text(message).html(), time, "");
}
notifications.client.online = function (usercount) {
// Add the message to the page.
setOnlineTotal(usercount);
setTimeout(function () {
$('.total_online_super').text(usercount);
}, 1200);
};
// Start the connection.
$.connection.hub.start({ xdomain: true }).done(function () {
notifications.invoke('logUrl', getToken(), window.location.href, pubip);
});
});
// add in some helpful tooltips to rate it.
$('.editor-block-toggle').find('div.rateit-range').each(function () {
$(this).attr('title', 'Click to Select');
});
$('.editor-block-toggle').find('.realtime-rating-display').attr('title', 'Selected Value');
setCompanyID(getCompanyID());
setPageTheme(getPageTheme());
setPageLayout(getPageLayout());
refreshUploads();
setCompanyName(getCompanyDBA());
setCompanyLogo(getCompanyLogo());
setCompanyDescription(getCompanyDescription());
setCompanyAddressVisible();
setCompanyHoursVisible();
setPageDisplayContentByIndex(getPhotosOption());
gtheme = $('.navbar.a3-theme').hasClass('-light') == true ? '-light' : '-dark';
// ------------------------------------------------------------------//
// A3N© Setup Configuation
// ------------------------------------------------------------------//
// REQUIRED: url: your web page's unique url
// REQUIRED: theme: options (light or dark)
// REQUIRED: id: unique A3N© connector id
// ------------------------------------------------------------------//
//alert(getPageThemeForComments());
gtheme = getPageTheme();
a3setup = { "url": $('#hf_CompanyUrl').val(), "theme": gtheme.replace('-', ''), "id": $('#hf_CompanySEO').val() };
//#form1 > div.mycontent.-dark.animated.animated-delay.fadeIn > div.container.company-container.-dark > div:nth-child(1) > div > div
initControls();
$('.counter').counterUp({
delay: 10,
time: 1000
});
$("time.timeago").timeago()
setTimeout(function () {
initInteractiveMapView(getLat(), getLng());
childDisplay(getPageTheme());
childDisplay(getPageLayout());
}, 600);
// alert('a3setup.theme' + a3setup.theme);
// used for bootstrap example wrapper, plugin uses setup values
var $b = $('body');
$b.find('.a3-theme').removeClass('-light').removeClass('-dark');
$b.find('.a3-theme').addClass('-' + a3setup.theme);
// ------------------------------------------------------------------//
// DON'T EDIT BELOW THIS LINE //
// ------------------------------------------------------------------//
$('#fancy-news-rss').fancyNews({
width: 1140,
height: 300,
infiniteLoop: false,
slideTime: 5000,
useLinks: true,
arrows: true,
backgroundColor: '#212121',
backgroundOverColor: '#434343',
textColor: '#fff',
primaryColor: '#ECF0F1',
center: true,
feed: 'https://rssmix.com/u/8307070/rss.xml',
rssApiKey: 'yyllc6cc85fv94rlcyb9jimfydfupxzktqh4acuh'
});
setTimeout(function () {
$('#fancy-news-rss').find('ul').each(function () {
$(this).find('li').each(function () {
if ($(this).find('img').length == 0) {
$(this).prepend('

');
}
$(this).find('div').each(function () {
$(this).find('h4').each(function () {
var htxt = $(this).text();
$(this).replaceWith("
");
});
});
});
});
$("time.timeago").timeago();
$("time.timeago").fadeIn();
}, 1000);
});
function getCompanyDBA() {
//alert($('#hf_CompanyDBA').val());
return $('#hf_CompanyDBA').val();
}
function htmlEncode(value) {
//create a in-memory div, set it's inner text(which jQuery automatically encodes)
//then grab the encoded contents back out. The div never exists on the page.
return $('
').text(value).html();
}
function htmlDecode(value) {
return $('
').html(value).text();
}
$(document).ready(function () {
$(".a3-wait-display").show(function () { (function () { var n = document; s = n.createElement("script"); s.type = "text/javascript"; s.async = !0; s.src = "https://www.420a3.com/a3comments/embed.v1.min.js"; s.setAttribute("data-timestamp", +new Date); (n.getElementsByTagName("head")[0] || n.getElementsByTagName("body")[0]).appendChild(s) })() });
});
// -END jQuery(document).ready