//<![CDATA[

		
		function creerMarker(latlng, onglet1,icon,evenement) { 
      var marker = new GMarker(latlng,icon); 
      var infoTabs = [ new GInfoWindowTab("Infos", onglet1)]; 
      GEvent.addListener(marker,evenement, function() { 
        marker.openInfoWindowTabsHtml(infoTabs); 
		
        }); 
      return marker; 
      }
	//fonction bouton zoom perso

// A TextualZoomControl is a GControl that displays textual "Zoom In"
// and "Zoom Out" buttons (as opposed to the iconic buttons used in
// Google Maps).
function TextualZoomControl() {
}
TextualZoomControl.prototype = new GControl();

// Creates a one DIV for each of the buttons and places them in a container
// DIV which is returned as our control element. We add the control to
// to the map container and return the element for the map class to
// position properly.
	TextualZoomControl.prototype.initialize = function(map) {
			  var container = document.createElement("div");
			
			  var zoomInDiv = document.createElement("div");
			  this.setButtonStyle_(zoomInDiv);
			  container.appendChild(zoomInDiv);
			  zoomInDiv.appendChild(document.createTextNode("+"));
			  GEvent.addDomListener(zoomInDiv, "click", function() {
				map.zoomIn();
			  });
			
			  var zoomOutDiv = document.createElement("div");
			  this.setButtonStyle_(zoomOutDiv);
			  container.appendChild(zoomOutDiv);
			  zoomOutDiv.appendChild(document.createTextNode("-"));
			  GEvent.addDomListener(zoomOutDiv, "click", function() {
				map.zoomOut();
			  });
			
			  map.getContainer().appendChild(container);
			  return container;
	}

// By default, the control will appear in the top left corner of the
// map with 7 pixels of padding.
TextualZoomControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
}

// Sets the proper CSS for the given button element.
TextualZoomControl.prototype.setButtonStyle_ = function(button) {
  button.style.textDecoration = "none";
  button.style.color = "black";
  button.style.background = "#EDEDED";
  button.style.fontSize = "15pt";
  button.style.fontWeight = "bold";
  button.style.border = "1px solid black";
  button.style.padding = "2px";
  button.style.marginBottom = "3px";
  button.style.textAlign = "center";
  button.style.width = "1em";
  button.style.cursor = "pointer";
}
//fin fonction bouton zoom perso
 
	function create_map(url,centrelat,centrelng,zoom,maptype) {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		
       
		map.addControl(new GMapTypeControl());//bouton du mode d'affichage satelite mixte carte
		//ajout controles
   // en replace le zoom par defaut " map.addControl(new GSmallMapControl());" par notre propre fonction 
   //TextualZoomControl
		map.addControl(new TextualZoomControl());//bouton controle zoom
		 map.setCenter(new GLatLng(centrelat, centrelng),zoom);
		if(maptype=='map') {map.setMapType(G_NORMAL_MAP);}
else if(maptype=='sat') {map.setMapType(G_SATELLITE_MAP);}
else if (maptype=='hybrid') {map.setMapType(G_HYBRID_MAP);}

		//fin ajout controles
		// Create our "tiny" marker icon
		var icon = new GIcon();
			icon.shadow = "shadow.png";
			 icon.shadowSize = new GSize(22, 20);
 
        GDownloadUrl(url, function(data,responseCode) { 
          var xml = GXml.parse(data);
          var markers = xml.documentElement.getElementsByTagName("marker");
		 
          for (var i = 0; i < markers.length; i++) {
            var latlng = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                    parseFloat(markers[i].getAttribute("lng")));
			 var categorie = markers[i].getAttribute("categorie");
			
  if(categorie=="gratuit")
  	{
	icon.image="googlemaps/icon/gratuit.png";
	icon.iconSize = new GSize(12, 20);
	icon.iconAnchor = new GPoint(6, 20);
	icon.infoWindowAnchor = new GPoint(6,0);
	evenement="mouseover";
	}
  else
  	{
	icon.image="googlemaps/icon/payant.png";
	icon.iconSize = new GSize(15, 26);
	icon.iconAnchor = new GPoint(7, 26);
	icon.infoWindowAnchor = new GPoint(7, 0);
	evenement="mouseover";
	}
	
             var marker = creerMarker(latlng, markers[i].getElementsByTagName("info")[0].firstChild.nodeValue,icon,evenement);  
            map.addOverlay(marker); 
          }
        });
      }
    }
    //]]>

   
