
// Initialisation function
function load() {

  if ( !GBrowserIsCompatible() )
    return;
    
  // Create the map
  var map = new GMap2(document.getElementById("map"));
  map.addControl(new GSmallMapControl());
  map.addControl(new GMapTypeControl());
  map.setCenter( new GLatLng( 51.508369, -0.106924 ), 14 );

  var point = new GLatLng( 51.508369, -0.106924 );
  var markerInfo = '<p style="margin: 0;"><strong>Community Health Partnerships</strong><br />New Kings Beam House<br />11th Floor<br />22 Upper Ground<br />London<br />SE1 9BW<br /><br /><a href="http://maps.google.co.uk/maps?f=q&hl=en&geocode=&time=&date=&ttype=&q=New+Kings+Beam+House&sll=51.508369,-0.106924&sspn=0.006811,0.014248&ie=UTF8&ll=51.508636,-0.106924&spn=0.006811,0.014248&z=16&iwloc=addr&om=1">Click here for further information and directions</a></p>';
  var marker = createMarker( point, markerInfo );
  map.addOverlay( marker );
  //marker.openInfoWindowHtml( markerInfo );
}

// Creates a marker at the given point with the given info label
function createMarker( point, info, id ) {

  var marker = new GMarker( point );
  
  GEvent.addListener( marker, "click", function() {
    marker.openInfoWindowHtml( info );
  } );
  
  return marker;
}

