
    var map = null;
    var geocoder = null;

    function initialize(lat,lon) {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(lat,lon), 9);
        geocoder = new GClientGeocoder();
      }
    }

    function showAddress(address,townstate) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              // alert(address + " not found");
              var inaddress = document.getElementById("mapaddress").innerHTML;
              var outaddress = inaddress + "<br><p style='font-size: 10px;'>Address not geocoded</p>";
              document.getElementById("mapaddress").innerHTML=outaddress;
              // if the address wasn't found, try coding just the town.
              // if THAT isn't found, then just code Concord...
              showAddress(townstate,'Concord NH')
            } else {
              map.setCenter(point, 11);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              // marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }

    

    function showmap(lat,lon, address, townstate) {
    	document.getElementById("mapholder").style.display="block";
    	initialize(lat,lon);
    	showAddress(address,townstate);
    }


	function closemap() {
    	document.getElementById("mapholder").style.display="none";
	}

