$(document).ready(function(){

	var map = null;
	var geocoder = null;
	
	function initialize(address) {
		setTimeout( function() {
			if (GBrowserIsCompatible()) {
				map = new GMap2(document.getElementById("map"));
				map.addControl(new GLargeMapControl());
				geocoder = new GClientGeocoder();
				showAddress(address);
			}
		}, 0.1);
	}	
	
	function showAddress(address) {
		if (geocoder) {
			geocoder.getLatLng(
				address,
				function(point) {
					if (!point) {
					alert(address + " introuvable.");
					} else {
					map.setCenter(point, 13);
					var marker = new GMarker(point);
					map.addOverlay(marker);
					//marker.openInfoWindowHtml(address);
					marker.openInfoWindowHtml('<strong>Hôtel Atlas ***</strong><br/>5, place de la Gare<br/> 06400 Cannes<br/>France');
					//marker.openInfoWindowHtml('<strong>Hôtel Atlas ***</strong><br/>8, rue Jean Jorès<br/> 06400 Cannes<br/>France');
					}
				}
			);
		}
	}

	//initialize('5, rue d\'Antibes, 06400 Cannes');
	//initialize('5, Rue Jean Jaurès, 06400 Cannes');
	//initialize('43.553532424792984, 7.019491195678711');
	initialize('43.55360434830223, 7.018662393093109');
});
