//<![CDATA[
    function load() {
      if (GBrowserIsCompatible()) {
	  
	  var gmarkers = [];
      var gicons = [];
	  
	gicons["Location_bureaux_1"] = new GIcon(G_DEFAULT_ICON,"markerr1.gif");
	gicons["Location_bureaux_2"] = new GIcon(G_DEFAULT_ICON,"markerr2.gif");
	gicons["Location_bureaux_3"] = new GIcon(G_DEFAULT_ICON,"markerr3.gif");
	gicons["Location_bureaux_4"] = new GIcon(G_DEFAULT_ICON,"markerr4.gif");
	gicons["Location_bureaux_5"] = new GIcon(G_DEFAULT_ICON,"markerr5.gif");
	gicons["Location_bureaux_6"] = new GIcon(G_DEFAULT_ICON,"markerr6.gif");
	gicons["Location_bureaux_7"] = new GIcon(G_DEFAULT_ICON,"markerr7.gif");
	gicons["Location_bureaux_8"] = new GIcon(G_DEFAULT_ICON,"markerr8.gif");
	gicons["Location_bureaux_9"] = new GIcon(G_DEFAULT_ICON,"markerr9.gif");
	gicons["Location_bureaux_10"] = new GIcon(G_DEFAULT_ICON,"markerr10.gif");
	gicons["Location_bureaux_11"] = new GIcon(G_DEFAULT_ICON,"markerr11.gif");
	gicons["Location_bureaux_12"] = new GIcon(G_DEFAULT_ICON,"markerr12.gif");
	gicons["Location_bureaux_13"] = new GIcon(G_DEFAULT_ICON,"markerr13.gif");
	gicons["Location_bureaux_14"] = new GIcon(G_DEFAULT_ICON,"markerr14.gif");
	gicons["Location_bureaux_15"] = new GIcon(G_DEFAULT_ICON,"markerr15.gif");
	gicons["Location_bureaux_16"] = new GIcon(G_DEFAULT_ICON,"markerr16.gif");
	gicons["Location_bureaux_17"] = new GIcon(G_DEFAULT_ICON,"markerr17.gif");
	
		  
	  // A function to create the marker and set up the event window
      function createMarker(point,name,html,category) {
        var marker = new GMarker(point,gicons[category]);
        // === Store the category and name info as a marker properties ===
        marker.mycategory = category;                                 
        marker.myname = name;
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        gmarkers.push(marker);
        return marker;
      }
	  	  	  

    function myclick(i) {
        GEvent.trigger(gmarkers[i],"click");
      } 
	  
        var map = new GMap2(document.getElementById("map_canvas"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GOverviewMapControl());
		map.setCenter(new GLatLng(48.682995 , 2.202186 ), 14);
		
		// Read the data
      GDownloadUrl("markers_courtaboeuf.xml", function(doc) {
        var xmlDoc = GXml.parse(doc);
        var markers = xmlDoc.documentElement.getElementsByTagName("marker");
          
        for (var i = 0; i < markers.length; i++) {
          // obtain the attribues of each marker
          var lat = parseFloat(markers[i].getAttribute("lat"));
          var lng = parseFloat(markers[i].getAttribute("lng"));
          var point = new GLatLng(lat,lng);
          var address = markers[i].getAttribute("address");
          var name = markers[i].getAttribute("name");
		  var lien = markers[i].getAttribute("lien"); 
          var html = "<b>"+name+"<br>"+address+"<br><a href='"+lien+"'>Plus d'informations : ICI !</a>";
          var category = markers[i].getAttribute("category");
          // create the marker
          var marker = createMarker(point,name,html,category);
          map.addOverlay(marker);
        }
        
      });
		
    }
     else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
    }
    //]]>
