/**
 * @author Le studio vert (http://www.lestudiovert.fr) : Benoît Nadaud
 * Google Maps pour Transcorrezien
 */
var map = null;
var geocoder = null;
var infoBulle = '<strong>SIVU du Transcorr&eacute;zien</strong><br />8 rue du 8 mai<br />19150 ESPAGNAC<br />FRANCE'

function load() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"));
		map.addControl(new GMapTypeControl());
		map.addControl(new GLargeMapControl());
		map.setCenter(new GLatLng(45.307493,2.16053), 8, G_NORMAL_MAP);
		geocoder = new GClientGeocoder();
		showAddress('Espagnac, France', infoBulle);
	}
}

function showAddress(address, infoBulle) {
	if (geocoder) {
    	geocoder.getLatLng(
			address,
			function(point) {
				if (!point) {
					alert(address + " not found");
				}
				else {
					var marker = new GMarker(point);
					map.addOverlay(marker);
					marker.openInfoWindowHtml(infoBulle);
				}
			}
    	);
	}
}
/*
function centreCarte(centre) {
	//map.setCenter(centre, 15,G_HYBRID_MAP);
	map.setCenter(centre, 8, G_HYBRID_MAP);

}

function ajoutBulleInfo(centre) {
	map.openInfoWindow(map.getCenter(),
	document.createTextNode("Hello, world"));
}

function ajoutpointerLSV(centre) {
	var pointeurLSV = new GIcon();
	pointeurLSV.image = "http://www.google.com/mapfiles/markerA.png";
	//pointeurLSV.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";

	//pointeurLSV.shadowSize = new GSize(22, 20);
	pointeurLSV.iconAnchor = new GPoint(0, 20);
	//pointeurLSV.infoWindowAnchor = new GPoint(5, 1);

	map.addOverlay(new GMarker(centre, pointeurLSV));
}*/
