$(document).ready(function(){addClickToGMap();});function initializeGoogleMap(){var geocoder=new google.maps.Geocoder();var myOptions={zoom:9,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}};var map=new google.maps.Map(document.getElementById("gmap_hotel_canvas"),myOptions);if(geocoder){geocoder.geocode({'address':GmapGeoCodeAddress},function(results,status){if(status==google.maps.GeocoderStatus.OK){map.setCenter(results[0].geometry.location);var marker=new google.maps.Marker({map:map,position:results[0].geometry.location});}else{alert("Geocode was not successful for the following reason: "+status);}});}
var image=null;for(id in gmapHotelsArray.getGmapHotels()){var gHotel=gmapHotelsArray.getHotelAt(id);if(gHotel.getLatitude()!=0&&gHotel.getLongitude()!=0){image='/images/googlemaps/hotel_icon-other.png';var myLatlng=new google.maps.LatLng(gHotel.getLatitude(),gHotel.getLongitude());marker=new google.maps.Marker({position:myLatlng,map:map,icon:image,title:gHotel.getHotelName()});google.maps.event.addListener(marker,'click',function(m,p,g){return addGMapInfoWindow(m,p,g)}(map,marker,gHotel));$('#gmap_hotel_'+gHotel.getId()).click(function(m,p,g){return addGMapInfoWindow(m,p,g)}(map,marker,gHotel));}
$('#gmap_hotel_link_'+gHotel.getId()).click(function(h){return function(){window.location=h.getUrl()};}(gHotel));}
for(id in gmapAirportsArray.getGmapAirports()){var ap=gmapAirportsArray.getAirportAt(id);if(ap.getLatitude()!=0&&ap.getLongitude()!=0){image='/images/googlemaps/airport_icon.png';myLatlng=new google.maps.LatLng(ap.getLatitude(),ap.getLongitude());marker=new google.maps.Marker({position:myLatlng,map:map,icon:image,title:ap.getAirportName()});google.maps.event.addListener(marker,'click',function(m,p,g){return addGMapAirportInfoWindow(m,p,g)}(map,marker,ap));$('#gmap_airport_'+ap.getId()).click(function(m,p,g){return addGMapAirportInfoWindow(m,p,g)}(map,marker,ap));}}}
function addClickToGMap(){$('#gmap_container').click(function(){$("#gmap_gbox_container").jqm({toTop:true,overlay:50,ajaxText:'Loading...'});$("#gmap_gbox_container").jqmShow();initializeGoogleMap();_gaq.push(['_trackEvent','GoogleMapHomePage','Click','Google Map Home Page Opened']);});}