function loadMap(buf, map) {
  if (GBrowserIsCompatible()) {
    buf = new GMap2(document.getElementById(map));
    buf.addMapType(G_PHYSICAL_MAP)
    buf.addControl(new GSmallMapControl());
	
	var h = false;
	try {
	    h = hlb;
	}catch(e){}
	
	try {
	    // this is the hotel lightbox
	    buf.addControl(new GMenuMapTypeControl());
	    var hotelll = new GLatLng(lat, lon);
	    buf.setCenter(hotelll, 9); // zoom = 11
	    buf.addOverlay(new GMarker(hotelll)); // add a marker for the hotel.
	    //  G_NORMAL_MAP - die Standardansicht
        //  G_SATELLITE_MAP - Google Earth-Satellitenbilder
        //  G_HYBRID_MAP - eine Mischung aus der normalen und der Satellitenansicht
        //  G_PHYSICAL_MAP
        buf.setMapType(G_NORMAL_MAP);
        
	}catch(e){
	    if(h==true) {
	        //hotel lightbox without coordinates
	        buf.addControl(new GMenuMapTypeControl());
	        buf.setCenter(new GLatLng(-26,22), 4);
	    }else{
	        // this is the reiseverlauf main page
	        buf.addControl(new GMapTypeControl());
	        // for now the coordinates are hardcoded
	        buf.setCenter(new GLatLng(-22.9583, 27.9320), 4); // zoom = 4
	        //  G_NORMAL_MAP - die Standardansicht
            //  G_SATELLITE_MAP - Google Earth-Satellitenbilder
            //  G_HYBRID_MAP - eine Mischung aus der normalen und der Satellitenansicht
            //  G_PHYSICAL_MAP
            buf.setMapType(G_NORMAL_MAP);
        }
	}
	return buf
	
  }
}

$(function(){
    try {
        var map = loadMap(new Object(), 'map');
        map.checkResize();
        if(map_zoom){
            map.setZoom(map_zoom);
        }
    }catch(e){}
    
})

