    var map;
    var geocoder;
    
    function addAddressToMap(response) {
     if (!response || response.Status.code != 200) {
       alert("Sorry, we were unable to geocode that address");
     } else {
       place = response.Placemark[0];
       point = new GLatLng(place.Point.coordinates[1],
                           place.Point.coordinates[0]);
       marker = new GMarker(point);
       map = new GMap2(document.getElementById("map_canvas"));
       map.setCenter(point, 15);
       map.addOverlay(marker);
       map.addControl(new GSmallMapControl());
       marker.openInfoWindowHtml(place.address + '<br>' +
         '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode);
     }
    }
    
    function showLocation(address) {
     geocoder = new GClientGeocoder();
     geocoder.getLocations(address, addAddressToMap);
    }

