//log.js // Logs user actions //setup logging try{ document.observe('dom:loaded', function() { jQuery('.beOther').each(function(index,link){ jQuery(link).click( function( event ) { attachLogOther( link ); }); }); }); }catch(err){ //console.log } //Logs the action function logAction( categoryID, extra ){ try{ var request = jQuery.ajax({ type: "GET", url: '/index.php', data: { method:'jslog', categoryID: categoryID, extra:extra, ts: new Date().getTime() } }); request.success(function( msg ) {}); request.fail(function( jqXHR, textStatus ) { }); }catch(err){ //console.log } } function attachLogOther( link ){ //window.location.replace(link.href); //event.stop(); var extra = link.href ; if( link.getAttribute("obextra") != null ){ extra =link.getAttribute("obextra"); } var cat = ""; if( link.getAttribute("obcat") != null ){ cat =link.getAttribute("obcat"); } /*else if( link.getAttribute("data-obcat") != null ){{ cat =link.getAttribute("data-obcat"); }*/ logOther( cat ,extra ); //event.stop(); } function logOther( category , extra ){ try{ category =encodeURIComponent(category); extra =encodeURIComponent(extra); var request = jQuery.ajax({ type: "GET", url: '/index.php', data: { method:'jslogOther', category: category, extra:extra, ts: new Date().getTime() } }); request.success(function( msg ) {}); request.fail(function( jqXHR, textStatus ) { }); }catch(err){ //console.log } } //googleMap.js // JavaScript Document var mapO var markerO var gdir var gDivName function showGoogleMap( divName ){ gDivName = divName; renderMap(); } function renderMap(){ //if (GBrowserIsCompatible()) { var latlng = new google.maps.LatLng(loclat, loclon); var gOptions = { zoom: loczoom , center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false, streetViewControl: false, panControl: true, zoomControl: true }; var text; text = companyName + "
\n"; text += ppaPhone + "
"; var map = new google.maps.Map(document.getElementById(gDivName) , gOptions ); //map.addControl(new GSmallMapControl()); //map.setCenter(new GLatLng(loclat,loclon), loczoom); var marker = new google.maps.Marker({ position: latlng, map: map, title: "" }); var node; node = document.createElement('div'); node.setAttribute('class','gmapBubble'); node.appendChild(document.createTextNode(companyName)); node.appendChild(document.createElement('br')); node.appendChild(document.createTextNode(formatPhone(ppaPhone))); node.appendChild(document.createElement('br')); var link = document.createElement('a'); link.setAttribute('href','javascript:showEmailForm()'); link.appendChild(document.createTextNode("Send us an email.")); node.appendChild(link); var ua = navigator.userAgent.toLowerCase(); var isAndroid = ua.indexOf("android") > -1; if(isAndroid) { var link = document.createElement('a'); link.setAttribute('href','geo:' + loclat + ',' + loclon); link.appendChild(document.createTextNode("Navigate here")); node.appendChild(document.createElement('br')); node.appendChild(link); } //map.openInfoWindow(map.getCenter(), node ); var infowindow = new google.maps.InfoWindow({ content: node }); google.maps.event.addListener( marker, 'click', function (){infowindow.open( map, marker );} ); infowindow.open( map, marker ); mapO = map; //} //var point = new google.maps.LatLng(loclat, loclon); //mapO.addOverlay(new google.maps.Marker(point)); } function showDirectionsFrom(divName, address){ showDirections(divName, address ); } function showDirections(divName, full){ var directionsDisplay; var directionsService = new google.maps.DirectionsService(); //clear any old directions var dirDiv = document.getElementById(divName) if (dirDiv .hasChildNodes()) while (dirDiv .childNodes.length >= 1) dirDiv .removeChild(dirDiv .firstChild); renderMap(); directionsDisplay = new google.maps.DirectionsRenderer(); directionsDisplay.setPanel( null ); directionsDisplay.setMap(mapO); directionsDisplay.setPanel(document.getElementById(divName) ); var dest = loclat + " , " + loclon ; if( directionsUseAddr != false ){ dest = directionsUseAddr ; } var request = { origin:full, destination:dest, travelMode: google.maps.TravelMode.DRIVING }; directionsService.route(request, function(result, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(result); } }); } function formatPhone(num){ var _return=false; if(num.length == 10){ _return="("; var ini = num.substring(0,3); _return+=ini+") "; var st = num.substring(3,6); _return+=st+"-"; var end = num.substring(6,10); _return+=end; }else if(num.length == 7){ _return=""; var st = num.substring(3,6); _return+=st+"-"; var end = num.substring(6,10); _return+=end; }else{ _return=num; } return _return; } function handleErrors(){ if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS) alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_SERVER_ERROR) alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_MISSING_QUERY) alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code); // else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS) <--- Doc bug... this is either not defined, or Doc is wrong // alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_KEY) alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_REQUEST) alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code); else alert("An unknown error occurred."); } function onGDirectionsLoad(){ // Use this function to access information about the latest load() // results. // e.g. // document.getElementById("getStatus").innerHTML = gdir.getStatus().code; // and yada yada yada... } //ResponsiveSlidesHelper.js function setupServiceCarousel( ) { var c = null; var maxSlides = 4 ; var addOverflow = true; var width = jQuery(window).width(); if (width <= 480) { c = 1; } else if (width <= 768) { c = 2; } else { c = maxSlides; } var ul = jQuery("