var map = null;
var geocoder = null;

function initializeGoogleMap(divId) 
{
  if (GBrowserIsCompatible()) 
  {
    map = new GMap2(document.getElementById(divId));
    map.setCenter(new GLatLng(0, 3));

    var mapControl = new GMapTypeControl();
    map.addControl(mapControl);
    map.addControl(new GLargeMapControl());

    geocoder = new GClientGeocoder();
  }
}

function showAddress(divId, address, htmlToBeDisplayed)
{
  initializeGoogleMap(divId);

  if (geocoder) 
  {
    geocoder.getLatLng(
        address,
        function(point) 
        {
        if (point) 
        {
        map.setCenter(point, 13);
        var marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(htmlToBeDisplayed);
        }
        }
        );
  }
}

