

var map;
var indiceZoom;
var marker;
function load() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GOverviewMapControl());
		map.addControl(new GMapTypeControl());
		//vueVannes();
		marker = new GMarker(new GLatLng(47.71752891858699, 2.2105586528778076));
		
		vueParis();
		GEvent.addListener(marker, "click", function() { vueDown(); });
		map.addOverlay(marker);
		marker.openInfoWindowHtml(
		"<h3>Pépinière de Bagatelle</h3>" +
		"Vannes sur Cosson, Loiret");	
		
    }
}

function vueVannes(){
	if (GBrowserIsCompatible()) {	
		map.setCenter(new GLatLng(47.7120139121179, 2.214174270629883), 13);
		indiceZoom = 1;
		marker.openInfoWindowHtml(
		"<h3>Pépinière de Bagatelle</h3>" +
		"Rue de Bagatelle<br />" +
		"Chemin du Grand Etang<br />" +
		"Vannes sur Cosson"
		);	
	}
}

function vueGenerale1(){
	if (GBrowserIsCompatible()) {	
		map.setCenter(new GLatLng(47.868459093342956, 2.26593017578125), 9);
		indiceZoom = 2;
		marker.openInfoWindowHtml(
		"<h3>Pépinière de Bagatelle</h3>" +
		"Vannes sur Cosson");	
	}
}

function vueParis(){
	if (GBrowserIsCompatible()) {	
		map.setCenter(new GLatLng(48.06706753,2.2247314453), 8);
		indiceZoom = 3;
		
	}
}

function zoomUp(){
	if(indiceZoom < 2) indiceZoom++;
}
function zoomDown(){
	if(indiceZoom > 1) indiceZoom--;
}
function vueDown(){
	zoomDown();
	switch(indiceZoom){	
		case 2:
		vueGenerale1();
		break;
		
		case 1:
		vueVannes();
		break;
	}
}

