if (GBrowserIsCompatible()) { 

     
      
      // ====== Create a Client Geocoder ======
      var geo = new GClientGeocoder(); 

      // ====== Array for decoding the failure codes ======
      var reasons=[];
      reasons[G_GEO_SUCCESS]            = "Success";
      reasons[G_GEO_MISSING_ADDRESS]    = "Missing Address: The address was either missing or had no value.";
      reasons[G_GEO_UNKNOWN_ADDRESS]    = "Unknown Address:  No corresponding geographic location could be found for the specified address.";
      reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";
      reasons[G_GEO_BAD_KEY]            = "Bad Key: The API key is either invalid or does not match the domain for which it was given";
      reasons[G_GEO_TOO_MANY_QUERIES]   = "Too Many Queries: The daily geocoding quota for this site has been exceeded.";
      reasons[G_GEO_SERVER_ERROR]       = "Server error: The geocoding request could not be successfully processed.";
      
      // ====== Geocoding ======
      function showAddress(search) 
      {
        //var search = document.getElementById("search").value;
        
        //var search = 'viale san sisto 43 perugia';
        // ====== Perform the Geocoding ======        
        geo.getLocations(search, function (result)
        { 
	            // If that was successful
	            if (result.Status.code == G_GEO_SUCCESS) 
	            {
	              // How many resuts were found
	              
	              // Loop through the results, placing markers
	             
	             
	              // centre the map on the first result
	              var p = result.Placemark[0].Point.coordinates;
	              map.setCenter(new GLatLng(p[1],p[0]),14);
	              var point = new GLatLng(p[1],p[0]);
	              
	              var html = '<h3>Ospedale/USL</h3>' + '<br />' + search;
      			  var marker = createMarker(point,html);
      			  marker.openInfoWindowHtml(html);
      			  map.addOverlay(marker);
	              
	            }
	            // ====== Decode the error status ======
	            else 
	            {
	              var reason="Code "+result.Status.code;
	              if (reasons[result.Status.code]) 
	              {
	                reason = reasons[result.Status.code]
	              } 
	              alert('Could not find "'+search+ '" ' + reason);
	            }
	    });
      }
     
      function showAddress2(search) 
      {
        //var search = document.getElementById("search").value;
        
        //var search = 'viale san sisto 43 perugia';
        // ====== Perform the Geocoding ======        
        geo.getLocations(search, function (result)
        { 
	            // If that was successful
	            if (result.Status.code == G_GEO_SUCCESS) 
	            {
	              // How many resuts were found
	              
	              // Loop through the results, placing markers
	             
	             
	              // centre the map on the first result
	              var p = result.Placemark[0].Point.coordinates;
	              map2.setCenter(new GLatLng(p[1],p[0]),14);
	              var point = new GLatLng(p[1],p[0]);
	              var html = '<h3>Ambulatorio privato</h3>' + '<br />' + search;
      			  var marker = createMarker(point,html);
      			  marker.openInfoWindowHtml(html);
      			  map2.addOverlay(marker);
	              
	            }
	            // ====== Decode the error status ======
	            else 
	            {
	              var reason="Code "+result.Status.code;
	              if (reasons[result.Status.code]) 
	              {
	                reason = reasons[result.Status.code]
	              } 
	              alert('Could not find "'+search+ '" ' + reason);
	            }
	    });
      }
      
      
      function createMarker(point,html) {
        var icon = new GIcon(G_DEFAULT_ICON, "/files/adoi-marker.png");
        var marker = new GMarker(point,icon);
        
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }
      
      
    }
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
    

//showAddress2('viale san sisto 43 perugia');
    

