var map, theMarker;
var points = new Array();

mapZoom       = 5;
mapCenterLat  = 53.69335222384588;
mapCenterLong = -1.8017578125;
	
function createMarker(latitude,longitude,infoWindowText) {
	var thePoint  = new GLatLng(latitude,longitude);
	var theMarker = new GMarker(thePoint);

	if (infoWindowText > "") {
		GEvent.addListener(theMarker,"click",function() {
			theMarker.openInfoWindowHtml(infoWindowText);
		});	
	}
	
	points.push(theMarker);
	
	map.addOverlay(theMarker);
	return theMarker;
}

function createMap(theDiv,latitude,longitude,zoomlevel) {
	var containerDiv = document.getElementById(theDiv);
	
	// CREATE THE MAP OBJECT
	map = new GMap2(containerDiv);
	
	// ADD CONTROLS (DEPENDING ON HOW BIG THE MAP IS)
	if (containerDiv.offsetHeight > 350) {
		map.addControl(new GLargeMapControl());
	} else {
		map.addControl(new GSmallMapControl());
	}
	
	map.setCenter(new GLatLng(latitude,longitude), zoomlevel);
		
	return true;
}

createMap("gmap",mapCenterLat,mapCenterLong,mapZoom);