    //<![CDATA[
    var map;
    var geocoder;

	function createMarker(point,html) {
	  var icon = new GIcon(G_DEFAULT_ICON);
      icon.image = "images/blue-dot.png";
      var marker = new GMarker(point);
      GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(html);
      });
      return marker;
    }

/*
    function createMarker(point,html) {
      var icon = new GIcon(G_DEFAULT_ICON);
      icon.image = "../images/blue-dot.png";

      var options = {
        icon: icon,
        draggable: true
      };
      var marker = new GMarker(point, options);
      GEvent.addListener(marker, "dragstart", function() {
        map.closeInfoWindow();
      });
      
      GEvent.addListener(marker, "dragend", function() {
         htm = html + '<br />Lat_1 = ' + point.lat() + ' Lat_2 = ' + marker.getPoint().lat();
         htm = htm + '<br />Lng_1 = ' + point.lng() + ' Lng_2 = ' + marker.getPoint().lng();
		document.formcontact.lat.value=marker.getPoint().lat();
		document.formcontact.lng.value=marker.getPoint().lng();
        marker.openInfoWindowHtml(htm);
      });
      
      GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(html);
      });
      
      return marker;
    }
*/

    function geocode(address, adh, affichadress, latlng) {
      geocoder.getLatLng(
        address,
        function(point) {
          if (!point) {
			geocoder.getLatLng(
        	latlng,
        		function(point) {
          			if (!point) {
            		alert(latlng + " not found");
          			} else {
            		map.setCenter(point, 15);
            		var marker = createMarker(point, adh+"<br>"+affichadress);
            		map.addOverlay(marker);
            		marker.openInfoWindowHtml(adh+"<br>"+affichadress);
          			}
        		}
      		);		  	
          } else {
            map.setCenter(point, 15);
            var marker = createMarker(point, adh+"<br>"+affichadress);
            map.addOverlay(marker);
            marker.openInfoWindowHtml(adh+"<br>"+affichadress);
          }
        }
      );
      return false;
    }

/*
    function geocode(address, adh, affichadress, latlng) {
      geocoder.getLatLng(
        address,
        function(point) {
          if (!point) {
		  	
            alert(address + " not found");
          } else {
            map.setCenter(point, 13);
            var marker = createMarker(point, adh);
            map.addOverlay(marker);
            marker.openInfoWindowHtml(adh+"<br>"+affichadress);
          }
        }
      );
      
      return false;
    }
*/

    function load() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(45.74, -0.63), 8);
        geocoder = new GClientGeocoder();
      } else {
        alert("Desole, l'API Google Maps n'est pas compatible avec votre navigateur.");
      }
    }

    //]]>
