
var map = null; 
var geocoder = null; 
function setupMap() { 
  if (GBrowserIsCompatible()) { 
    map = new GMap2(document.getElementById("map")); 
    map.setCenter(new GLatLng(-12.062547, -77.150216), 13); 
    map.addControl(new GSmallMapControl()); 
    map.enableDoubleClickZoom(); 
    map.enableScrollWheelZoom(); 
    map.addControl(new PanoMapTypeControl()); 
    geocoder = new GClientGeocoder(); 
  } 
} 
 
    function showAddress(address) { 
      if (geocoder) { 
        geocoder.getLatLng( 
          address, 
          function(point) { 
            if (!point) { 
              alert(address + " not found"); 
            } else { 
              map.setCenter(point, 13); 
              var marker = new GMarker(point); 
              map.addOverlay(marker); 
              marker.openInfoWindowHtml(address); 
            } 
          } 
        ); 
      } 
    } 
 
