function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function makeMap() {

if(!document.getElementById) return false;

// create the map
var map = new GMap(document.getElementById("map"));

// add map large controllers
map.addControl(new GLargeMapControl());


// Centre of Island (-1.292266, 50.674705)
// set the center map location
var location = new GPoint(-1.292266, 50.674705);


// center and zoom into the location
map.centerAndZoom(location, 7);

// Marker for Westfield Lodges & Apartments (-1.189677, 50.597921)
// add a marker for the location
var marker = new GMarker(new GPoint(-1.189677, 50.597921));
map.addOverlay(marker);


// create the text for the info window
var myText = document.createTextNode("Westfield Lodges & Apartments, Shore Rd, Ventnor, PO38 1RH")

// create the div element for the info window
var myDiv = document.createElement("div");

myDiv.setAttribute("class","infoWindow")

myDiv.appendChild(myText);

// add an info window for the location
marker.openInfoWindow(myDiv);

GEvent.addListener(marker, 'click', function() {marker.openInfoWindow(myDiv);});

}


addLoadEvent(makeMap);


