function load() {
if (GBrowserIsCompatible()) { 
      // A function to create the marker and set up the event window
      // Dont try to unroll this function. It has to be here for the function closure
      // Each instance of the function preserves the contends of a different instance
      // of the "marker" and "html" variables which will be needed later when the event triggers.    


       var baseIcon = new GIcon();
          baseIcon.iconSize=new GSize(32,32);
          baseIcon.shadowSize=new GSize(56,32);
          baseIcon.iconAnchor=new GPoint(16,32);
          baseIcon.infoWindowAnchor=new GPoint(16,0);

       var patrimoine = new GIcon(baseIcon, "http://www.tourisme-coeurdelomagne.fr/images/picto-patrimoine.png", null, "http://maps.google.com/mapfiles/kml/pal3/icon21s.png");    
       var astro = new GIcon(baseIcon, "http://www.tourisme-coeurdelomagne.fr/images/picto-ferme-des-etoiles.png", null, "http://maps.google.com/mapfiles/kml/pal3/icon21s.png");
       var musee = new GIcon(baseIcon, "http://www.tourisme-coeurdelomagne.fr/images/picto-musee.png", null, "http://maps.google.com/mapfiles/kml/pal3/icon21s.png");    


      function createMarker(point,html,icon) {
        var marker = new GMarker(point,icon);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }



      // Display the map, with some controls and set the initial location 
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(43.90778718292443,0.7879257202148437),13);

       // Set up three markers with info windows 
    
      var point = new GLatLng(43.89202431229839,0.7706952095031738);
      var marker = createMarker(point,'<div style="width:240px">La galerie de toutes les couleurs</div>', patrimoine)
      map.addOverlay(marker);
      
      var point = new GLatLng(43.91917961658905,0.8194953203201294);
      var marker = createMarker(point,'<div style="width:240px">La Ferme des Etoiles</div>', astro)
      map.addOverlay(marker);

      var point = new GLatLng(43.89100371780019,0.7683080434799194);
      var marker = createMarker(point,'<div style="width:240px">Le Musée de l\'école publique</div>', musee)
      map.addOverlay(marker);
    }
    
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
}

window.onload=load;
window.onunload=GUnload; 
