//     Copyright © 2006 Patricia Jacquat. Tous droits réservés.

function load() {
    if (GBrowserIsCompatible()) {
        var aumontzey = new GLatLng(48.1676, 6.7812);
        var map1 = new GMap2(document.getElementById("map1"));
        map1.setCenter(aumontzey, 8);
        var map2 = new GMap2(document.getElementById("map2"));
        map2.setCenter(aumontzey, 12);
        var map3 = new GMap2(document.getElementById("map3"));
        map3.setCenter(aumontzey, 15);

        var icon = new GIcon();
        icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
        icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
        icon.iconSize = new GSize(12, 20);
        icon.shadowSize = new GSize(22, 20);
        icon.iconAnchor = new GPoint(6, 20);
        icon.infoWindowAnchor = new GPoint(5, 1);

        map1.addOverlay(new GMarker(aumontzey, icon));
        map2.addOverlay(new GMarker(aumontzey, icon));
        map3.addOverlay(new GMarker(aumontzey, icon));
    
        GEvent.addListener(map1, "click", function(marker, point) {
        if (marker) {
            window.location = "localization.php#canton";
        }
        });
                    
        GEvent.addListener(map2, "click", function(marker, point) {
        if (marker) {
            window.location = "localization.php#city";
        }
        });
                    
        GEvent.addListener(map3, "click", function(marker, point) {
        if (marker) {
            window.location= "contact.php";
        }
        });
    }
}

function addDivMap(container, id) {
    try {
        document.write("<div id=\"" + id + "\" class=\"googlemap\"></div>");
    } catch(e) {
        var divmap = document.createElement("div");
        divmap.setAttribute("id", id);
        divmap.setAttribute("class", "googlemap");
        container.appendChild(divmap);
    }
}
