// Google Map
var map = null;
var geocoder = null;
	
    function load(address) {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
        geocoder = new GClientGeocoder();
		showAddress(address, address);
      }
    }

    function showAddress(address, msg) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
				document.getElementById("map").style.display = 'none';
            } else {
              map.setCenter(point, 8);
			  map.addOverlay(createMarker(point, msg));
            }
          }
        );
      }
    }
	
	function createMarker(point, msg) {
  		var marker = new GMarker(point);
  		GEvent.addListener(marker, "click", function() {
    		marker.openInfoWindowHtml(msg);
  		});
  	return marker;
	}