$(document).ready(function()
{
	$('#map').jmap('init',
		{
			// Initial type of map to display
			language: "en",

			// Options: "map", "sat", "hybrid"
			mapType: "map",

			// Initial map center
			//mapCenter: [55.9526118608056,-3.1915712356567383],
			mapCenter: [55.950966,-3.192666],

			// Initial map size
			mapDimensions: [560, 400],

			// Initial zoom level
			mapZoom: 15,

			// Initial map control size
			// Options: "large", "small", "none"
			mapControlSize: "large",

			// Initialise type of map control
			mapShowType: true,

			// Initialise small map overview
			mapShowOverview: true,

			// Enable map dragging when left button held down
			mapEnableDragging: true,

			// Enable map info windows
			mapEnableInfoWindows: true,

			// Enable double click zooming
			mapEnableDoubleClickZoom: false,

			// Enable zooming with scroll wheel
			mapEnableScrollZoom: false,

			// Enable smooth zoom
			mapEnableSmoothZoom: true,

			// Enable Google Bar
			mapEnableGoogleBar: false,

			// Debug Mode
			debugMode: false
		}
	);

	$('#map').jmap("addMarker",
		{
			/* pointLatLng: [55.951464536701295, -3.1869471073150635], */
			pointLatLng: [55.95103,-3.186582],
			pointHTML: "<h4>The Space @ Venue 45</h4><p>39 Jeffrey Street, Edinburgh EH1 1DH</p>",
			openHTMLEvent: "mouseover"
		}
	);

	$('#map').jmap("addMarker",
		{
			/* pointLatLng: [55.95148255776157, -3.1861424446105957], */
			pointLatLng: [55.95103,-3.1861424446105957],
			pointHTML: "<h4>The Space @ Jury's Inn (V260)</h4><p>43 Jeffrey Street, Edinburgh EH1 1DH</p>",
			openHTMLEvent: "mouseover"
		}
	);

	$('#map').jmap("addMarker",
		{
			pointLatLng: [55.95008289710743, -3.1883955001831055],
			pointHTML: "<h4>Fringe Office</h4>",
			openHTMLEvent: "mouseover"
		}
	);

	$('#map').jmap("addMarker",
		{
			pointLatLng: [55.95022106328547, -3.186753988265991],
			pointHTML: "<h4>The Space on the Mile @ The Radisson (V39)</h4><p>80 High Street, Edinburgh, EH1 1TH </p>",
			openHTMLEvent: "mouseover"
		}
	);

	/* $('#map').jmap("addMarker",
		{
			pointLatLng: [55.954029449912774, -3.1886959075927734],
			pointHTML: "<h4>The Space @ The Thistle (V36)</h4><p>112 Leith St, Edinburgh EH1 3SW</p>",
			openHTMLEvent: "mouseover"
		}
	); */
	
	$('#map').jmap("addMarker",
		{
			pointLatLng: [55.94771, -3.185756],
			pointHTML: "<h4>The Surgeons Hall, Venue 53</h4><p>Nicolson Street, Edinburgh, EH8 9DW</p>",
			openHTMLEvent: "mouseover"
		}
	);
	
	$('#map').jmap("addMarker",
		{
			pointLatLng: [55.94745, -3.185756],
			pointHTML: "<h4>The Space @ Venue 43</h4><p>Nicolson Street, Edinburgh, EH8 9DW</p>",
			openHTMLEvent: "mouseover"
		}
	);

	// Here we re-centre the map after 200 milliseconds. This is because the PNG transparency fix we
	// use in the CSS causes the map tiles to not be displayed in IE / Safari. By triggering a re-draw
	// of the map after the tranparency fix has been applied we can force them to be visible.
	setTimeout ('$("#map").jmap("moveTo", {mapCenter: [55.950966,-3.192666]});', 200);
});
