//<![CDATA[

 var map = null;
 var geocoder = null;

 function load() {
   if (GBrowserIsCompatible()) {
     map = new GMap2(document.getElementById("map_div"));
     map.setCenter(new GLatLng(37.4419, -122.1419), 13);
	  map.addControl(new GSmallZoomControl(), new GControlPosition( G_ANCHOR_BOTTOM_LEFT, new GSize(25,25) ));	
     geocoder = new GClientGeocoder();
		GEvent.addListener(map, "moveend", function() {
		      var center = map.getCenter();
				// document.getElementById("story_lat").innerHTML = center.lat();
				// document.getElementById("story_lng").innerHTML = center.lng();
				document.forms['map-form'].elements['story_lat'].value = center.lat();
				document.forms['map-form'].elements['story_lng'].value = center.lng();
		  });
   }
 }

 function showAddress(address) {
   if (geocoder) {
     geocoder.getLatLng(
       address,
       function(point) {
         if (!point) {
           alert(address + " not found");
         } else {
			document.forms['map-form'].elements['story_location'].value = address;	
			map.clearOverlays();
           map.setCenter(point, 13);
           var marker = new GMarker(point);
           map.addOverlay(marker);
           //marker.openInfoWindowHtml(address);
         }
       }
     );
   }
 }
 //]]>