
function validateAddress(address, callback)
{
   var geocoder   = null;
   var addrPoint  = null;

   // Create a google map geocoder.
   geocoder = new GClientGeocoder();

   // Be sure the object exist.
   if (geocoder)
   {
      // Go get the Lat and Lng of the address.
      // IMPORTANT: This function is asynchronous and will call the callback
      // when response come back from the server.
      //geocoder.getLatLng(address,addressFound_CB);
      geocoder.getLocations(address,callback);
      return true;
   }
   else
   {
      // Throw an error.
      alert("Unable to create Geocoder.");
      return false;
   }
   return false;
}

function addressFound_CB(addrPoint)
{
   if (!addrPoint)
   {
      // The address is not found, alert the user.
      alert(address + " not found, please try to retype it.");
      return false;
   }
   else
   {
      map.setCenter(addrPoint, 13);
      var marker = new GMarker(addrPoint);
      map.addOverlay(marker);
      marker.openInfoWindowHtml(address);
      return true;
   }
}


