{/if} {*detail_show_map*}
-// Direction code is below, but since we're sending them offsite to google maps this is no longer necessary.
-//
-// {if $settings.detail_show_directions}
-//
-// var directionsDisplay;
-// var directionsService = new google.maps.DirectionsService();
-//
-// // Display map with route from specified location to member location
-// function calcRoute() {
-//
-// // If an address was input, use that, otherwise use detected location if available
-// var start = $('#glm-startLocation').val();
-// if (start == '' ) {
-// if (myLocation != false) {
-// start = myLocation;
-// }
-// }
-//
-// // If no start location available, tell user
-// if (start == '') {
-// alert('No starting location. Please enter address.');
-// return;
-// }
-//
-// // Switch to directions map being visible
-// $('#glm-directionsMap-container').removeClass('glm-hidden');
-// $('#glm-locationMap-container').addClass('glm-hidden');
-// $('#glm-showLocationButton').removeClass('glm-hidden');
-//
-// // Initialize the directions map with a default center location
-// directionsDisplay = new google.maps.DirectionsRenderer();
-// var mapOptions = {
-// zoom:7,
-// center: memberlocation
-// }
-// directionsMap = new google.maps.Map(document.getElementById("glm-directionsMap"), mapOptions);
-// directionsDisplay.setMap(directionsMap);
-//
-// // Get directions type selected
-// var directionsType = $('#directionsType').find(':selected').val();
-//
-// // Specify origin and destination then get route
-// var request = {
-// origin: start,
-// destination: memberlocation,
-// travelMode: google.maps.TravelMode[directionsType]
-// };
-// directionsService.route(request, function(result, status) {
-// if (status == google.maps.DirectionsStatus.OK) {
-// directionsDisplay.setDirections(result);
-// $('#directions-panel').html('');
-// directionsDisplay.setPanel(document.getElementById('directions-panel'));
-// }
-// });
-//
-// // Check for first map idle (completely loaded) - Check max initial zoom
-// var mapLoadedListener = google.maps.event.addListener(directionsMap, 'idle', function() {
-// if (directionsMap.getZoom() > 16) {
-// this.setZoom(16);
-// }
-// google.maps.event.removeListener(mapLoadedListener);
-// });
-//
-// }
-//
-// // Trigger route map either by button or input of address
-// $('#glm-showDirectionsButton' ).click( function() {
-// calcRoute();
-// });
-// $('#glm-startLocation' ).change( function() {
-// calcRoute();
-// });
-//
-// // Switch back to member location map
-// $('#glm-showLocationButton').click( function() {
-// $('#glm-directionsMap-container').addClass('glm-hidden');
-// $('#glm-locationMap-container').removeClass('glm-hidden');
-// $('#glm-showLocationButton').addClass('glm-hidden');
-// });
-//
-// {/if} {*detail_show_directions*}
+ $(window).load(function(){
+ initMap();
+ });
}); // jquery