function initialize(hotel) {
	var map;
	if (GBrowserIsCompatible()) {
		var mapOptions = {
			googleBarOptions : {
				style : "new"
			}
		}
		
		//alert(hotel);
		
		// Configuration map
		map = new GMap2(document.getElementById("map"), mapOptions);
		var point = new GLatLng(45.744741,4.8258); 
		map.setCenter(point, 13);	
		map.setUIToDefault();
		map.enableGoogleBar();
		
		
		
		//  ======== Add a map overview ==========
		      map.addControl(new GOverviewMapControl(new GSize(200,200)));

		      //  ======== A function to adjust the positioning of the overview ========
		      function positionOverview(x,y) {
		        var omap=document.getElementById("map_overview");
		        omap.style.left = x+"px";
		        omap.style.top = y+"px";

		        // == restyling ==
		        omap.firstChild.style.border = "1px solid gray";

		        omap.firstChild.firstChild.style.left="4px";
		        omap.firstChild.firstChild.style.top="4px";
		        omap.firstChild.firstChild.style.width="190px";
		        omap.firstChild.firstChild.style.height="190px";
		      }
		
		var tolink = "<a target=\"blank\" href=\"http://www.google.com/maps?source=uds&daddr=varzi+%40" + point.lat() + "%2C" + point.lng() + "&iwstate1=dir%3Ato&hl=it\">a qui</a>"
		var fromlink = "<a target=\"blank\" href=\"http://www.google.com/maps?source=uds&daddr=varzi+%40" + point.lat() + "%2C" + point.lng() + "&iwstate1=dir%3Afrom&hl=it\">da qui</a>"
	
		
		/* Creates a marker at the given point with the given number label
		********************************
		SETTAGGI MAPPA CON PIU' HOTELS 
		******************************** */
		function createMarker(point, number) {  
		var marker = new GMarker(point);  GEvent.addListener(marker, "click", 
			function() {
				if (number==1) {
				marker.openInfoWindowHtml("<b>Hôtel Best Western Charlemagne</b><br>23, cours Charlemagne - 69002 LYON<br>Téléphone : + 33 (0)4 72 77 70 00");
				}
				if (number==2) {
				marker.openInfoWindowHtml("<b>Grand Hôtel des Terreaux</b><br>16, rue Lanterne -69001 LYON<br>Téléphone : +33(0)4 78 27 04 10");
				}
				if (number==3) {
				marker.openInfoWindowHtml("<b>Hôtel Axotel Perrache</b><br>12, rue Marc Antoine Petit 69002 LYON<br>Téléphone : +33 (0)4 72 77 70 70");
				}
			});  
		return marker;
		}
		
		if (hotel==4) {
			var point = new GLatLng(45.74598,4.823716);  		
			var marker=createMarker(point,1);
			map.addOverlay(marker);
			marker.openInfoWindowHtml("<b>Hôtel Best Western Charlemagne</b><br>23, cours Charlemagne - 69002 LYON<br>Téléphone : + 33 (0)4 72 77 70 00");

		} else if (hotel==3)  {	
			var point = new GLatLng(45.766209,4.831806);  
			var marker=createMarker(point,2);
			map.addOverlay(marker);
			marker.openInfoWindowHtml("<b>Grand Hôtel des Terreaux</b><br>16, rue Lanterne -69001 LYON<br>Téléphone : +33(0)4 78 27 04 10");

		} else if (hotel==2) {
			var point = new GLatLng(45.744741,4.8258);  
			var marker=createMarker(point,3);
			map.addOverlay(marker);
			marker.openInfoWindowHtml("<b>Hôtel Axotel Perrache</b><br>12, rue Marc Antoine Petit 69002 LYON<br>Téléphone : +33 (0)4 72 77 70 70");

		} else {
			
			// ALL HOTELS
			var point = new GLatLng(45.74598,4.823716);  
			map.addOverlay(createMarker(point, 1));
			
			var point = new GLatLng(45.766209,4.831806);  
			map.addOverlay(createMarker(point, 2));
			
			var point = new GLatLng(45.744741,4.8258);  
			map.addOverlay(createMarker(point, 3));
		}
	}
}



$(function() {
	initialize(maui_runtime.domain_id);
});

$(window).unload( function () { 
	GUnload();
} );
