 var map = null;
 var geocoder = null;
 
 /* 
 	Chargement de la carte 
 */
 function load() {
   if (GBrowserIsCompatible()) {
     map = new GMap2(document.getElementById("Gmap"));
     map.setCenter(new GLatLng(48.9, 2.3), 7);
     map.addControl(new GSmallMapControl());
     map.addControl(new GMapTypeControl());
     geocoder = new GClientGeocoder();
   }
 }

 /* 
 	recherche d'une adresse et affichage d'une infoBulle 
 	@Param	address --> Adresse postal à rechercher
 	@Param	infoBulle --> Contenu WYSIWYG
 	@Author	MPAVILLON, JDN
 */
 function afficherAdresse(address,infoBulle) {
   if (geocoder) {
     geocoder.getLatLng(
       address,
       function(point) {
         if (!point) {
           alert(address + " introuvable");
        } else {
           map.setCenter(point, 15);
           var marker = new GMarker(point);
           map.addOverlay(marker);
           marker.openInfoWindowHtml(infoBulle);
         }
       }
     );
   }
 }
 
 /* 
 	Affichage ou désaffichage d'une span contenant la Map 
 	@Param	spanId --> id du span contenant la map
 	@Param	detailsAddid --> id du div caché contenant le contenu de l'infobulle
 	@Param	reqGeo	--> Reqête géographique (adresse postale)
 	@Author	MPAVILLON
 */
function showHideMap(spanMapId, detailsAddid, reqGeo)
{
	var obj = document.getElementById(spanMapId);
    if(obj != null) {
	    if(obj.style.display == "block") {
	       obj.style.display= 'none';
	       unload();
	    }
	    else {
	       obj.style.display='block';
	       load();
	       htmlContent = document.getElementById(detailsAddid).innerHTML;
	       afficherAdresse(reqGeo,htmlContent)
	    }
    }

}