$(document).ready(function() {

	$('#boxWhereMap').html("Loading...");
	
	$("#enlargeMap").click(function () {
		shadowboxMap();
	});

	if (GBrowserIsCompatible()) {
      // A function to create the marker and set up the event window
      function createMarker(point,html) {
        // Create our "tiny" marker icon
        var icon = new GIcon();
        icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
        icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
        icon.iconSize = new GSize(12, 20);
        icon.shadowSize = new GSize(22, 20);
        icon.iconAnchor = new GPoint(6, 20);
        icon.infoWindowAnchor = new GPoint(5, 1);

        var marker = new GMarker(point, icon);
        GEvent.addListener(marker, "click", function() {
          //marker.openInfoWindowHtml(html);
		  shadowboxMap();

        });
        return marker;
      }

		var map = new GMap2(document.getElementById("boxWhereMap"));
        //map.addControl(new GLargeMapControl());
        //map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(37.9099,-84.3593),16,G_SATELLITE_MAP);
		
      var point = new GLatLng(37.9099,-84.3593);
      var marker = createMarker(point,'We are here.')
      map.addOverlay(marker);

	} else {
		$('#boxWhereMap').html("Your browser doesn't support Google Maps.");
	}


});


function shadowboxMap() {
    Shadowbox.open({
		player:     'iframe',
		title:      'Where Are We Now?',
		content:    '_googlemaps.php',
		width:      700,
		height:     450
	});

	return true;
}
