var map;
var blnIcons = true;
var gmarkers = [];
var i=0;
var mapZoom = 14;  

var txtInfoText = new Array();
var txtLabel = new Array();
var Lat = new Array();
var Lng = new Array();
var LatOffset = new Array();
var LngOffset = new Array();






function SetPointData(fID, fLat, fLng, fLatOffset, fLngOffset, fLabel, fInfoText)
	{
	Lat[fID] = fLat;
	Lng[fID] = fLng;
	LatOffset[fID] = fLatOffset;
	LngOffset[fID] = fLngOffset;
	txtLabel[fID] = fLabel;
	var tmpText = "<div style='width:250px;height:70px;padding-top:10px;'>" + fInfoText;
	tmpText = tmpText + "</div>";
	txtInfoText[fID] = tmpText;
	}

function SetData()
{
SetPointData(0, 51.9463, 1.0596, 0 , 0 , "Manningtree", "");
}









function loadmap() {


	if (GBrowserIsCompatible()) {
	

		SetData();

		// ICON DEFAULT
		var baseIcon = new GIcon();
		baseIcon.iconSize = new GSize(20,34);
		baseIcon.shadowSize = new GSize(37,34);
		baseIcon.iconAnchor = new GPoint(9,34);
		baseIcon.infoWindowAnchor = new GPoint(9,2);
		baseIcon.infoShadowAnchor = new GPoint(18,25);



		// A function to create the marker and set up the event window
		function createMarker(fID, fChar) {
		
			var iconLetter = new GIcon(baseIcon)
			iconLetter.image = "http://www.google.com/mapfiles/marker" + fChar + ".png";
			var point = new GLatLng(Lat[fID], Lng[fID]);
			var labelname = txtLabel[fID];
			var html = txtInfoText[fID];
			if (fChar == "") {
				var marker = new GMarker(point, { clickable: true, title: labelname} );
				}
				else
				{
				var marker = new GMarker(point, {icon: iconLetter, clickable: true, title: labelname} );
				}
			gmarkers[i] = marker;
			i++;
			GEvent.addListener(marker, "click", function() { 
				marker.openInfoWindowHtml(html); 
				map.setCenter(point);
				});
			return marker;
	      }






		// SET MAP & CENTER
		map = new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());



		map.setCenter(new GLatLng( Lat[0] ,Lng[0]), mapZoom);
		map.addControl(new GMapTypeControl());





//		map.addOverlay(createMarker(0,""));
//		gmarkers[0].openInfoWindowHtml(txtInfoText[0]);

		map.enableContinuousZoom();


		}
		else {
		alert("Sorry, your browser is unable to display the Location Map");
		}	
}


