var geocoder = null;
var map = null;
var places = null;

function initialize() {
	geocoder = new GClientGeocoder();
    map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(37.4419, -122.1419), 13);
    map.setUIToDefault();
	showAddress('404 Wyman St, Waltham MA');
}

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

function geocodePlace(address, fn) {
	if(!geocoder)
		geocoder = new GClientGeocoder()
	geocoder.getLocations(address, fn);
}

