var google_map = null;
var geocoder = null;
var marker = null;

function showAddress(address, address1, info) {
  //alert(address);
  if (GBrowserIsCompatible()) {
  	geocoder = new GClientGeocoder();
    
    if (geocoder) {
      geocoder.getLatLng(
        address,
        function(point) {
          if (!point) {
          	//alert(info + " is not found.");
          	if (address1 != "") {
            	showAddress(address1, "", info);
            }
          }
          else {
          	google_map = new GMap2(
              document.getElementById("google_map"),
              {mapTypes: [G_HYBRID_MAP, G_NORMAL_MAP, G_SATELLITE_MAP]});
          	google_map.addControl(new GSmallMapControl());
            google_map.addControl(new GMapTypeControl());
          	google_map.setCenter(point, 14);
  
          	marker = new GMarker(point);
            GEvent.addListener( marker, "click",
              function() {
                marker.openInfoWindowHtml(info);
              }
          	);
          	google_map.addOverlay(marker);
  
          	marker.openInfoWindowHtml(info);
          }
        }
    	);
    }
  }
}

