
//<![CDATA[

var map;
var geocoder = null;
var addressMarker;

function loadGoogleMap(Address) {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(54, -4.1), 5);
    map.setMapType(G_NORMAL_MAP);
    geocoder = new GClientGeocoder();
    showAddress(Address);
  }
}

function showAddress(address) {
  if (geocoder) {
    geocoder.getLatLng(address,
      function(point) {
        if (!point) {
          alert(address + " not found");
        } else {
          if (addressMarker) {
            map.removeOverlay(addressMarker);
          }
          addressMarker = new GMarker(point);
          map.setCenter(point, 15);
          map.addOverlay(addressMarker);
        }
      }
    );
  }
}
//]]>