var map = null;
var geocoder = null;

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

function showMap(divtag, full_addr) {
   if (GBrowserIsCompatible()) {
      map = new GMap2(document.getElementById(divtag));
      map.addControl(new GSmallMapControl());
      map.addControl(new GMapTypeControl());
      geocoder = new GClientGeocoder();
   }
   showAddress(full_addr);
   value = document.getElementById(divtag).style.visibility;
   if (value == "" || value == "hidden") {
      document.getElementById(divtag).style.visibility = "visible";
      document.getElementById(divtag).style.height = "275px";
      document.getElementById(divtag).style.width = "365px";
   } else {
      document.getElementById(divtag).style.visibility = "hidden";
      document.getElementById(divtag).style.height = "0px";
      document.getElementById(divtag).style.width = "0px";
   }
}
