// JavaScript

// Google Map
function load_map(coord_x, coord_y, description) {
	
	if (GBrowserIsCompatible()) {
		
		var map = new GMap2(document.getElementById("detail_map"));	
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GOverviewMapControl());
        map.setCenter(new GLatLng(coord_x, coord_y), 14);
		
		// Creates a marker at the given point with the given number label
		function createMarker(point, number) {
		var marker = new GMarker(point);
		GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(description);
		});
		return marker;
		}
	
		// Add marker
		var point = new GLatLng(coord_x, coord_y);
		map.addOverlay(createMarker(point, 1));
		
	}
	
}

// Adresse Google Map
function showAddress(address) {
	if (geocoder) {
		geocoder.getLatLng(address,
		function(point) {
			if (!point) {
			} else {
			map.setCenter(point, 13);
			}
		}
		);
	}
}

