
	var map = null;
	var geocoder = null;	
    var debug = false;
		
  function createMap () {
//	  alert("Create Map");
		if (GBrowserIsCompatible()) {
			map = new GMap2(document.getElementById("map"));			
			map.addControl (new GSmallMapControl());
//			map.addControl (new GMapTypeControl());
			map.setCenter(new GLatLng(43, -85.5), 7);  //North of Lansing MI
			// Create the geocoder
			geocoder = new GClientGeocoder();
		}
	}
	
	  function centerMap (addr) {
//		  alert("Center Map");
		if (GBrowserIsCompatible()) {
			if (addr != undefined) {
//			  alert("Look up address");
				if (geocoder) {
					geocoder.getLatLng(addr, 
									function(cpoint) {  //point is a GLatLng point
										if (!cpoint) {
											if (debug) alert ("centerMap  Address Not Found");
										} else {
											map.setCenter(cpoint, 10);
										} // point returned
									} //function
					)  //getLatLng - callbck will center map
				} else {
					alert ("CenterMap Address undefined= "+addr);
				} // geocoder
			
			}  // addr != undefined
		} //Browser Compatible
	}
	
		function setMarkerAndText (mapPoint, text) {
	var marker = new GMarker (mapPoint);

	map.addOverlay(marker);
	GEvent.addListener (marker, 
		"click", 
			function () {
			marker.openInfoWindowHtml (text);
			} //function
		); // addListener
	}


	
	function generateMarker (lat, lon, addressText) {	
//		alert (addressText);
		if (addressText != undefined) {
			if (geocoder) {
				point = new GLatLng(lat, lon);
				if (!point) {
					alert ("showAddress Address not found in call to getLatLng, "+address);
				} else {
					setMarkerAndText (point, addressText);
				} // point returned

			};// if geocoder
		}
	}	//generateMarker
	
