var map ;
var map = null;
var geocoder = null;

function load() 
{
	if (GBrowserIsCompatible()) 
	{
		map = new GMap2(document.getElementById("map"));
		var mapControl = new GMapTypeControl();
		map.addControl(mapControl);
		map.addControl(new GLargeMapControl());
		//map.setCenter(new GLatLng(37.4419, -122.1419), 13);
		geocoder = new GClientGeocoder();
		showAddress( concession['addresse'] );
	}
}

function showAddress(address) 
{ 
	if (geocoder) 
	{
		geocoder.getLatLng(
			address
			, function(point) 
			{ 
				if (!point) 
				{ 
					alert(address + " not found");
				} 
				else 
				{ 
					map.setCenter(point, 13);
					var marker = new GMarker(point);
					map.addOverlay(marker);
					marker.openInfoWindowHtml(concession['marque']
					+"<br>"+concession['addressecomplete']+"<br>"
					+concession['cp']+" "+concession['ville']+"<br>"
					+"<br>Tél: "+concession['tel']
					+"<br>"
					);

					GEvent.addListener(
						marker
						, "mouseover"
						, function() {  
							marker.openInfoWindowHtml(concession['marque']
							+"<br>"+concession['addressecomplete']+"<br>"
							+concession['cp']+" "+concession['ville']+"<br>"
							+"<br>Tél: "+concession['tel']+"<br>"
							);
						}
					);
				}
			}
		);
	}
}  




