// google api configuration scripts
    var map;
    var geocoder;
	var marker;

// Create our "tiny" marker icon
var tinyIcon = new GIcon();
tinyIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
tinyIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
tinyIcon.iconSize = new GSize(12, 20);
tinyIcon.shadowSize = new GSize(22, 20);
tinyIcon.iconAnchor = new GPoint(6, 20);
tinyIcon.infoWindowAnchor = new GPoint(5, 1);

// Set up our GMarkerOptions object literal
markerOptions = { icon:tinyIcon };
    
    function load() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
      
		geocoder = new GClientGeocoder();
		var address = '50 Madison Street, New York, NY 10038'

		geocoder.getLatLng(
			address,
			function(point) {
			  if (!point) {
				alert(address + " not found");
			  } else {
				map.setCenter(point, 13);
				marker = new GMarker(point, markerOptions);
				map.addOverlay(marker);
			  }
			}
	  );
	  
	  }
	}
	
    // addAddressToMap() is called when the geocoder returns an
    // answer.  It adds a marker to the map with an open info window
    // showing the nicely formatted version of the address and the country code.
    function addAddressToMap(response) {
      map.clearOverlays();
      if (!response || response.Status.code != 200) {
        alert("Sorry, we were unable to geocode that address");
      } else {
        place = response.Placemark[0];
		point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
        marker = new GMarker(point, markerOptions);
        map.addOverlay(marker);
		marker.openInfoWindowHtml(
        '<b>Address:</b><br />' + place.address);
      }
    }

   // findLocation() is used to enter the sample addresses into the form.
    function findLocation(addressToFind) {
	 geocoder.getLocations(addressToFind, addAddressToMap);
    }

