// JavaScript Functions for Google Maps API
//<![CDATA[

var map = null;
var geocoder = null;

// Load & Init Map
function load(address, info) {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"));
	    geocoder = new GClientGeocoder();

		// Add controls
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());

		// Get map for address
		showAddress(address, info);		
	}
}

// Display Address
function showAddress(address, info) {
  geocoder.getLatLng(
    address,
    function(point) {
      if (!point) {
        alert(address + " not found");
      } else {
        map.setCenter(point, 15);
        var marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(info);
      }
    }
  );
}

//]]>
