
//<![CDATA[
// Google Map Maker script v.1.1
// (c) 2006 Richard Stephenson http://www.donkeymagic.co.uk
// Email: donkeymagic@gmail.com
// http://mapmaker.donkeymagic.co.uk
var map;
var icon0;
var newpoints = new Array();
 
function addLoadEvent(func) { 
	var oldonload = window.onload; 
	if (typeof window.onload != 'function'){ 
		window.onload = func
	} else { 
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
 
addLoadEvent(loadMap);
addLoadEvent(addPoints);
 
function loadMap() {
	map = new GMap2(document.getElementById("map"));
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng( 54.6829037709518, -1.544698974609375), 14);
	 map.setMapType(G_HYBRID_MAP);
 
	icon0 = new GIcon();
	icon0.image = "images/MapIcons/T.png";
	icon0.iconSize = new GSize(20, 45);
	icon0.iconAnchor = new GPoint(9, 54);
	icon0.infoWindowAnchor = new GPoint(9, 2);

	icon1 = new GIcon();
	icon1.image = "images/MapIcons/KingGeorgeV.png";
	icon1.iconSize = new GSize(25, 25);
	icon1.iconAnchor = new GPoint(9, 34);
	icon1.infoWindowAnchor = new GPoint(9, 2);

	icon2 = new GIcon();
	icon2.image = "images/MapIcons/DeanBank.png";
	icon2.iconSize = new GSize(25, 25);
	icon2.iconAnchor = new GPoint(9, 34);
	icon2.infoWindowAnchor = new GPoint(9, 2);

	icon3 = new GIcon();
	icon3.image = "images/MapIcons/Mainsforth.png";
	icon3.iconSize = new GSize(25, 25);
	icon3.iconAnchor = new GPoint(9, 34);
	icon3.infoWindowAnchor = new GPoint(9, 2);

	icon4 = new GIcon();
	icon4.image = "images/MapIcons/Surtees.png";
	icon4.iconSize = new GSize(25, 25);
	icon4.iconAnchor = new GPoint(9, 34);
	icon4.infoWindowAnchor = new GPoint(9, 2);

	icon5 = new GIcon();
	icon5.image = "images/MapIcons/CarltonStreet.png";
	icon5.iconSize = new GSize(25, 25);
	icon5.iconAnchor = new GPoint(9, 34);
	icon5.infoWindowAnchor = new GPoint(9, 2);

	icon6 = new GIcon();
	icon6.image = "images/MapIcons/PaxtonStreet.png";
	icon6.iconSize = new GSize(25, 25);
	icon6.iconAnchor = new GPoint(9, 34);
	icon6.infoWindowAnchor = new GPoint(9, 2);
	
	icon7 = new GIcon();
	icon7.image = "images/MapIcons/Storehouse.png";
	icon7.iconSize = new GSize(25, 25);
	icon7.iconAnchor = new GPoint(9, 34);
	icon7.infoWindowAnchor = new GPoint(9, 2);
	
	icon8 = new GIcon();
	icon8.image = "images/MapIcons/EastEnd.png";
	icon8.iconSize = new GSize(25, 25);
	icon8.iconAnchor = new GPoint(9, 34);
	icon8.infoWindowAnchor = new GPoint(9, 2);

	icon9 = new GIcon();
	icon9.image = "images/MapIcons/Broom.png";
	icon9.iconSize = new GSize(25, 25);
	icon9.iconAnchor = new GPoint(9, 34);
	icon9.infoWindowAnchor = new GPoint(9, 2);

	icon10 = new GIcon();
	icon10.image = "images/MapIcons/MainsforthRow.png";
	icon10.iconSize = new GSize(25, 25);
	icon10.iconAnchor = new GPoint(9, 34);
	icon10.infoWindowAnchor = new GPoint(9, 2);

	icon11 = new GIcon();
	icon11.image = "images/MapIcons/P.png";
	icon11.iconSize = new GSize(20, 35);
	icon11.iconAnchor = new GPoint(9, 34);
	icon11.infoWindowAnchor = new GPoint(9, 2);

	icon12 = new GIcon();
	icon12.image = "images/MapIcons/B.png";
	icon12.iconSize = new GSize(20, 35);
	icon12.iconAnchor = new GPoint(9, 34);
	icon12.infoWindowAnchor = new GPoint(9, 2);

	icon13 = new GIcon();
	icon13.image = "images/MapIcons/E.png";
	icon13.iconSize = new GSize(20, 35);
	icon13.iconAnchor = new GPoint(9, 34);
	icon13.infoWindowAnchor = new GPoint(9, 2);
	
	icon14 = new GIcon();
	icon14.image = "images/MapIcons/C.png";
	icon14.iconSize = new GSize(20, 35);
	icon14.iconAnchor = new GPoint(9, 34);
	icon14.infoWindowAnchor = new GPoint(9, 2);

	icon15 = new GIcon();
	icon15.image = "images/MapIcons/M.png";
	icon15.iconSize = new GSize(20, 35);
	icon15.iconAnchor = new GPoint(9, 34);
	icon15.infoWindowAnchor = new GPoint(9, 2);

}
 
function addPoints() {
 
	
	newpoints[0] = new Array(54.689656, -1.554458, icon0, 'Ferryhill Town Hall', '<center>Town Hall<br /><img src="images/ferryhill.jpg"</center>');
	newpoints[1] = new Array(54.688369, -1.546917, icon1, 'King George V Playing Fields', '<center><a href="services/king_georgev_playing_fields.htm">King George V Playing Fields.<img src="up-hoist-kgv-new-equip.jpg"></a></center>');  
 	newpoints[2] = new Array(54.684442, -1.563311, icon2, 'Dean Bank Park', '<center><a href="services/dean_bank_park.htm">Dean Bank Park</a> <br /><br /><img src="services/images/dean-bank-bowls-pavilion.jpg"></center>');  
 	newpoints[3] = new Array(54.679756, -1.522294, icon3, 'Mainsforth Sports Complex', '<center><a href="services/mainsforth_sports_complex.htm">Mainsforth Sports Complex</a> <br /><br /><img src="services/images/mainsforth1.jpg"></center>');  
 	newpoints[4] = new Array(54.672317, -1.530267, icon4, 'Sutees Doorstep Green', '<center><a href="services/surtees_doorstep_green.htm">Surtees Doorstep Green</a> <br /><br /><img src="services/images/Surtees_Doorstep_Green.JPG"></center>');  
	newpoints[5] = new Array(54.675392, -1.529658, icon5, 'Carlton Street Play Area', '<center>Carlton Street Play Area</a> <br /><br /><img src="services/images/Carlton_Street.jpg"></center>'); 
	newpoints[6] = new Array(54.686544, -1.569389, icon6, 'Paxton Street Allotment Site', '<center><a href="services/allotments/allotments.htm">Paxton Street Allotment Site.</a> <br /><br /><img src="services/images/Paxton_Street_Allotments.JPG"></center>') 
	newpoints[7] = new Array(54.685808, -1.559639, icon7, 'Storehouse Allotment Site', '<center><a href="services/allotments/allotments.htm">Storehouse Allotment Site.</a><br /><br /><img src="services/images/Storehouse_Allotments.JPG"></center>');  
	newpoints[8] = new Array(54.691964, -1.551725, icon8, 'East End Allotment Site', '<center><a href="services/allotments/allotments.htm">East End Allotment Site.</a> <br /><br /><img src="services/images/East_End_Allotments.jpg"></center>');  
	newpoints[9] = new Array(54.683397, -1.544125, icon9, 'Broom Allotment Site', '<center><a href="services/allotments/allotments.htm">Broom Allotment Site.</a> <br /><br /><img src="services/images/Broom_Allotment_Site.JPG"></center>');  
	newpoints[10] = new Array(54.673686, -1.531339, icon10, 'Mainsforth Row Allotment Site', '<center><a href="services/allotments/allotments.htm">Mainsforth Row Allotment Site.</a> <br /><br /><img src="services/images/Mainsforth_Row_Allotment_Site.JPG"></center>');  
	newpoints[11] = new Array(54.681406, -1.532461, icon11, 'Ferryhill Station Public Conveniences', '<center><a href="services/public_conveniences.htm">Ferryhill Station Public Conveniences.</a><br /><img src="services/images/Building.jpg"></center>');  
	newpoints[12] = new Array(54.689906, -1.553456, icon12, 'Beacon of Europe', '<center>Beacon of Europe</a> <br /><br /><img src="services/images/Beacon_of_Europe.JPG"></center>');  
	newpoints[13] = new Array(54.689392, -1.554306, icon13, 'E Cafe', '<center><a href="services/e_cafe.htm">E Cafe</a> <br /><br /><img src="services/images/E_Cafe.jpg"></center>');   	newpoints[14] = new Array(54.684664, -1.533925, icon14, 'Duncombe Cemetery', '<center><a href="services/duncombe_cemetery.htm">Duncombe Cemetery</a></ br><img src="services/duncombe_cemetery_clip_image002_0002.jpg"></center>');  
	newpoints[15] = new Array(54.689386, -1.555906, icon15, 'Ferryhill Market', '<center><a href="events/market.htm">Weekly Market</a><br /><img src="events/images/market%20day.JPG"></center>');  
	
for(var i = 0; i < newpoints.length; i++) {
		var point = new GPoint(newpoints[i][1],newpoints[i][0]);
		var popuphtml = newpoints[i][4] ;
		var alt = newpoints[i][4] ;
		var marker = createMarker(point,newpoints[i][2],popuphtml);
		map.addOverlay(marker);
	}
}
 
function createMarker(point, icon, popuphtml) {
	var popuphtml = "<div id=\"popup\">" + popuphtml + "<\/div>";
	
	var marker = new GMarker(point, icon);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(popuphtml);
	});
	
	return marker;
}
//]]>