function LocalSearchAddressCountry( country, address, update ) {
  if ( address && ( address.length > 0 ) ) {
    if ( document.localSearch == null) document.localSearch = new google.search.LocalSearch();
    document.localSearch.setSearchCompleteCallback(null,update);
    document.localSearch.setCenterPoint( country );
    document.localSearch.execute( address );
  }
  else {
    alert("Please enter an address");
  }
  
  return false;
}

function GeocodeAddressCountry( country, address, update ) {
  if ( address && ( address.length > 0 ) ) {
    if ( document.geoCoder == null) document.geoCoder = new google.maps.ClientGeocoder();
    document.geoCoder.setBaseCountryCode(country);
    document.geoCoder.getLocations( address, update );
  }
  else {
    alert("Please enter an address");
  }
  
  return false;
}

function GeocodeAddress( address, update ) {
  if ( address && ( address.length > 0 ) ) {
    if ( document.geoCoder == null) document.geoCoder = new google.maps.ClientGeocoder();
    document.geoCoder.getLocations( address, update );
  }
  else {
    alert("Please enter an address");
  }
  
  return false;
}

function GeocodeLatLng( latLng, update ) {
  if ( latLng ) {
    if ( document.geoCoder == null) document.geoCoder = new google.maps.ClientGeocoder();
    document.geoCoder.getLocations( latLng, update );
  }
  else {
    alert( "Please supply a latitude/longitude" );
  }
}


/*
    update:
    
    function( addresses ) {
          if(addresses.Status.code != 200) {
            alert("reverse geocoder failed to find an address for " + latlng.toUrlValue());
          }
          else {
            address = addresses.Placemark[0];
            var myHtml = address.address;
            map.openInfoWindow(latlng, myHtml);
          }
*/
