function load() {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(mapCenter[0], mapCenter[1]), mapCenter[2]);
    
		for (i=0; i<placesOfInterest.length; i++)
		{
	    PlaceMarker(map, placesOfInterest[i][0], placesOfInterest[i][1], placesOfInterest[i][2], placesOfInterest[i][3]); 
		}
  }
}

/**
 * Place a marker on the map with the given properties.
 */
function PlaceMarker(theMap, lat, lon, txt, icon)
{
	var logo = new GIcon();
	logo.image = icon;
	logo.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
	logo.iconSize = new GSize(12, 20);
	logo.shadowSize = new GSize(22, 20);
	logo.iconAnchor = new GPoint(6, 20);
	logo.infoWindowAnchor = new GPoint(5, 1);
	var marker = new GMarker(new GLatLng(lat, lon), logo);
	var html = txt;
	GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        
	theMap.addOverlay(marker);	
}

// The center of the map, allowing us to show all points of interest:
// [latitude, longitude, zoom level].
var mapCenter = [50.831963,-0.124798, 13];
// For summer: var mapCenter = [50.83985,-0.143852, 15];

// Our main playing area.
var placesOfInterest = 
[
	[
		50.839606,-0.148273,
		"This is where we play on <b>Wednesdays at 6pm</b><br>"+
			"from April till September.",
		"http://labs.google.com/ridefinder/images/mm_20_green.png"
	],
	[
		50.837153,-0.136063, 
		"The Open House, 146 Springfield Rd, BN1 6DE,<br>"+
			"where we go for food and drinks<br>"+
			"between April and September.",
		"http://labs.google.com/ridefinder/images/mm_20_red.png"
	],
	[
		50.823587,-0.098877,
		"Stanley Deason Leisure Centre<br/>"+
		"This is where we play indoor in the winter.",
		"http://labs.google.com/ridefinder/images/mm_20_blue.png"
	]
];
