function load()
{
	
	var map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	
	var header = "function createMarker(point, information)\n{\n\tvar marker = new GMarker(point);\n\tGEvent.addListener(marker, \"click\", function() {marker.openInfoWindowHtml(information);});\n\treturn marker;\n}\n\nfunction load()\n{\nvar map = new GMap2(document.getElementById(\"map\"));\nmap.addControl(new GSmallMapControl());\nmap.addControl(new GMapTypeControl());\nmap.setCenter(new GLatLng(";
	
	map.setCenter(new GLatLng(54.000,0), 5);
	
	var header = header +"54.000,0), 5);\nvar points = new Array\n(";
	
	var footer = "\n); \n\nfor (var i = 0; i < points.length; i++)\n{\n\tmap.addOverlay(new createMarker(points[i], information[i]));\n}\n\nmap.addOverlay(new GPolyline(points));\n}";
	var points = [];
	var output_buttons = '';
	var output_information = '';
	
	GEvent.addListener(map, "click", function(marker, point)
	{
		if(marker)
		{
			marker.openInfoWindowHtml("Add information in here!");
		}
		else
		{
			// Add the new point to our collection
			points.push(point);
			// Clear all previous overlays; we want a tabula rosa
			map.clearOverlays();
			// Add buttons
			for (var i = 0; i < points.length; i++)
			{
				// Create a new button
				var location = new GMarker(points[i]);
				// Extract its location
				location_latlng = location.getPoint();
				// Add it to: the output, and the map
				output_buttons = output_buttons+"\n\tnew GLatLng("+location_latlng.lat()+", "+location_latlng.lng()+"),";
				map.addOverlay(location);
			}
			
			for (var x = 0; x < points.length; x++)
			{
				output_information = output_information + "\n\t\"Add information in here\",";
			}
			
			var information_header = "\n);\nvar information = new Array\n(";
			
			// Add polylines
			map.addOverlay(new GPolyline(points));
			// Stripping that annoying comma off the end of the array!
			output_buttons = output_buttons.substring(0,output_buttons.length-1);
			output_information = output_information.substring(0,output_information.length-1);
			// Outputs constructed javascript code to the wee box below
			document.getElementById("output_box").innerHTML = header+output_buttons+information_header+output_information+footer;
			// Reset the buttons, otherwise the accumulate
			output_buttons = '';
			output_information = '';
		}
	});
}
