    function initMap(map,x,y,z,detail) {
        var mPosition = new GLatLng(y,x);
        if (detail) map.setCenter(mPosition,z,G_NORMAL_MAP)
        else map.setCenter(mPosition,z,G_PHYSICAL_MAP);
    }
    
    // A function to create the marker and set up the event window
    // Dont try to unroll this function. It has to be here for the function closure
    // Each instance of the function preserves the contends of a different instance
    // of the "marker" and "html" variables which will be needed later when the event triggers.
    function createMarker(point,icon,text) {
        var marker = new GMarker(point,icon);
        if (text)
            if (text != "") {
                GEvent.addListener(marker, "click", function() {
                marker.openInfoWindowHtml('<div style="width:240px;">'+text+'</div>');
            });
          }
        return marker;
    }
    
    function neuerPin(x,y) {
        var point = new GLatLng(x,y);
        var icon = new GIcon();
        icon.image = "/icons/marker_rot.png"
        icon.shadow = "http://www.gmaplive.com/pin_shadow.png";
        icon.iconSize = new GSize(16, 28);
        icon.shadowSize = new GSize(40, 28);
        icon.iconAnchor = new GPoint(7, 22);
        icon.infoWindowAnchor = new GPoint(5, 1)
        map.addOverlay(createMarker(point,icon));
    }
    
    function displayMap(locx,locy,icon,detail) {
	    if (GBrowserIsCompatible()) {
	      if (detail) {
		      // Display the map, with some controls and set the initial location 
		      var map = new GMap2(document.getElementById("map"));
		      map.addControl(new GSmallMapControl());
		      map.enableDoubleClickZoom(true);
		      map.enableContinuousZoom(true);
		      controls = new GMapTypeControl();
		      
		      locx /= 60;
		      locy /= 60;
		      
		      // true für Detailkarte mit Kennzeichnung Autobahnen, Straßnnamen etc;
		      // false in der großen Karte für die "schöne" Karte...
		      initMap(map,locx,locy,14,true);
		    
		      var point = new GLatLng(locy,locx);
		      map.addOverlay(createMarker(point,icon));
	      }
	      else {
                var map = new GMap2(document.getElementById("map"));
                map.addControl(new GLargeMapControl());
				map.enableDoubleClickZoom(true);
				map.enableContinuousZoom(true);
				map.addControl(new GScaleControl());
				// map.removeMapType(G_HYBRID_MAP);
				map.addControl(new GMapTypeControl());
				map.addMapType(G_PHYSICAL_MAP);
				controls = new GMapTypeControl();
				
				// default-Position (?)
				var bla = new GLatLng(locy,locx);
                map.setCenter(bla,14); // HIER <- Mittelpunkt der Karte (Hotelposition aus DB holen...)
            }
	    }
	    // display a warning if the browser was not compatible
	    else {
	      alert("Sorry, the Google Maps API is not compatible with this browser");
	    }
	    return map;
    }

    var radius = 6371.000785;

    if (GBrowserIsCompatible()) { 
        // Marker setzen
	    var icon = new GIcon();
	    icon.image = "/icons/marker_rot.png"
	    icon.shadow = "http://www.gmaplive.com/pin_shadow.png";
	    icon.iconSize = new GSize(16, 28);
	    icon.shadowSize = new GSize(40, 28);
	    icon.iconAnchor = new GPoint(7, 22);
	    icon.infoWindowAnchor = new GPoint(5, 1)
    }
    // display a warning if the browser was not compatible
    else {
        alert("Sorry, the Google Maps API is not compatible with this browser");
    }