var map = null;
var geocoder = null;
function initialize(){
    if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById('map'));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        geocoder = new GClientGeocoder();
    }
}

function showAddress(address, pays){
    if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById('map'));
        map.addControl(new GSmallMapControl());
        map.setCenter(new GLatLng(0, 0), 0);
        geocoder = new GClientGeocoder();
    }
    if (geocoder) {
        geocoder.getLatLng(address + pays, function(point){
            if (!point) {
                alert(address + " not found");
            }
            else {
                map.setCenter(point, 15);
                var marker = new GMarker(point);
                map.addOverlay(marker);
                marker.openInfoWindowHtml("<center>Studio Evidanse</center></b><br><center>16 rue du crucifix 87000 Limoges</center>");
            }
        });
    }
}

