// Check to see if this browser can run the Google API
if (GBrowserIsCompatible()) {

var map;
var geocoder = null;
  
function initGMap() {
	// Display the map, with some controls and set the initial location 
	map = new GMap2(document.getElementById("gmaps"));
	map.addControl(new GSmallMapControl());
	//map.addControl(new GMapTypeControl(1));

	var MyPoint = new GLatLng( 48.1449556, 11.6019076);

	geocoder = new GClientGeocoder();
	//calendarAddress,calendarZoom is written by tx_eventcalendar_pi1 LOCATION VIEW in header
	showAddress(calendarAddress,calendarZoom);

}

}
else {
  alert("Sorry, the Google Maps API is not compatible with this browser");
}

function showAddress(address,zoom) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              showAddress('Niedersachsen',5);
            
            } else {
              map.setCenter(point, zoom);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              //marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }


window.onload = initGMap;
window.onunload = GUnload;
