function initialize() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("mapCanvas"));
		
 		if($('body').attr('id')=='walks'){
			map.setCenter(new GLatLng(53.800651,-4.064941), 5); 
		};
		if($('body').attr('id')=='belfast'){
			map.setCenter(new GLatLng(54.587831,-5.916309), 14);
		};
		if($('body').attr('id')=='brighton'){
			map.setCenter(new GLatLng(50.868378,-0.10201), 14);
		};
		if($('body').attr('id')=='coventry'){
			map.setCenter(new GLatLng(52.392599,-1.520963), 14);
		};
		if($('body').attr('id')=='glasgow'){
			map.setCenter(new GLatLng(55.84747,-4.18077), 14);
		};
		if($('body').attr('id')=='leeds'){
			map.setCenter(new GLatLng(53.794371,-1.470923), 14);
		};
		if($('body').attr('id')=='london'){
			map.setCenter(new GLatLng(51.570535,-0.101688), 14);
		};
		if($('body').attr('id')=='merseyside'){
			map.setCenter(new GLatLng(53.433316,-2.731819), 14);
		};
		if($('body').attr('id')=='salisbury'){
			map.setCenter(new GLatLng(51.093091,-1.799993), 14);
		};
		if($('body').attr('id')=='stockton-on-tees'){
			map.setCenter(new GLatLng(54.612355,-1.377293), 14);
		};
		if($('body').attr('id')=='south-wales'){
			map.setCenter(new GLatLng(51.563769,-3.72821), 14);
		};

		//Define Markers
		BelfastMarker = new GMarker(new GLatLng(54.587831,-5.916309));
		BrightonMarker = new GMarker(new GLatLng(50.868378,-0.10201));		
		CoventryMarker = new GMarker(new GLatLng(52.392599,-1.520963));
		GlasgowMarker = new GMarker(new GLatLng(55.84747,-4.18077));
		LeedsMarker = new GMarker(new GLatLng(53.794371,-1.470923));
		LondonMarker = new GMarker(new GLatLng(51.570535,-0.101688));
		MerseysideMarker = new GMarker(new GLatLng(53.433316,-2.731819));
		SalisburyMarker = new GMarker(new GLatLng(51.093091,-1.799993));
		StocktonOnTeesMarker = new GMarker(new GLatLng(54.612355,-1.377293));
		SwanseaMarker = new GMarker(new GLatLng(51.563769,-3.72821));
		
		
		//Display Markers
		map.addOverlay( BelfastMarker );
		map.addOverlay( BrightonMarker );
		map.addOverlay( CoventryMarker );
		map.addOverlay( GlasgowMarker );
		map.addOverlay( LeedsMarker );
		map.addOverlay( LondonMarker );
		map.addOverlay( MerseysideMarker );
		map.addOverlay( SalisburyMarker );
		map.addOverlay( StocktonOnTeesMarker );
		map.addOverlay( SwanseaMarker );
		
		// load default gmail controls
		map.setUIToDefault();
		
		// Redirect controls
		GEvent.addListener(BelfastMarker, "click", function() { window.location.replace("/walks/belfast/");});
		GEvent.addListener(BrightonMarker, "click", function() { window.location.replace("/walks/brighton/");});
		GEvent.addListener(CoventryMarker, "click", function() { window.location.replace("/walks/coventry/");});
		GEvent.addListener(GlasgowMarker, "click", function() { window.location.replace("/walks/glasgow/");});
		GEvent.addListener(LeedsMarker, "click", function() { window.location.replace("/walks/leeds/");});
		GEvent.addListener(LondonMarker, "click", function() { window.location.replace("/walks/london/");});
		GEvent.addListener(LondonMarker, "click", function() { window.location.replace("/walks/merseyside/");});
		GEvent.addListener(LondonMarker, "click", function() { window.location.replace("/walks/salisbury/");});
		GEvent.addListener(LondonMarker, "click", function() { window.location.replace("/walks/stockton-on-tees/");});
		GEvent.addListener(LondonMarker, "click", function() { window.location.replace("/walks/swansea/");});
		
	}
}

$(document).ready( initialize );