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 camping = new GIcon(baseIcon, "http://www.tourisme-coeurdelomagne.fr/images/picto-caming-naturiste.png", null, "http://maps.google.com/mapfiles/kml/pal3/icon21s.png");    
       var campingcar = new GIcon(baseIcon, "http://www.tourisme-coeurdelomagne.fr/images/picto-campingcar.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.8902227965629,0.784149169921875),13);

       // Set up three markers with info windows 
    
      var point = new GLatLng(43.891070211421955,0.8286523818969727);
      var marker = createMarker(point,'<div style="width:240px">Camping Devèze</div>', camping)
      map.addOverlay(marker);
      
      var point = new GLatLng(43.89799134722089,0.8111214637756348);
      var marker = createMarker(point,'<div style="width:240px">Camping Les Roches</div>', camping)
      map.addOverlay(marker);
      
      var point = new GLatLng(43.87688524626683,0.796884298324585);
      var marker = createMarker(point,'<div style="width:240px">Embarthe</div>', camping)
      map.addOverlay(marker);

      var point = new GLatLng(43.8902104254038,0.7478213310241699);
      var marker = createMarker(point,'<div style="width:240px">Maison de l\'ail</div>', campingcar)
      map.addOverlay(marker);

      var point = new GLatLng(43.8916825696303,0.7731199264526367);
      var marker = createMarker(point,'<div style="width:240px">Halte camping-car</div>', campingcar)
      map.addOverlay(marker);

      var point = new GLatLng(43.779990261592005,0.7340776920318604);
      var marker = createMarker(point,'<div style="width:240px">Au gré du vent, Taybosc</div>', campingcar)
      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; 
