
//<![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 map2;
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("map2"));
	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 = "http://www.ferryhill.gov.uk/images/MapIcons/marker1.png";
	icon0.iconSize = new GSize(20, 25);
	icon0.iconAnchor = new GPoint(9, 25);
	icon0.infoWindowAnchor = new GPoint(9, 2);

	icon1 = new GIcon();
	icon1.image = "http://www.ferryhill.gov.uk/images/MapIcons/marker2.png";
	icon1.iconSize = new GSize(20, 35);
	icon1.iconAnchor = new GPoint(9, 35);
	icon1.infoWindowAnchor = new GPoint(9, 2);

	icon2 = new GIcon();
	icon2.image = "http://www.ferryhill.gov.uk/images/MapIcons/marker3.png";
	icon2.iconSize = new GSize(20, 25);
	icon2.iconAnchor = new GPoint(9, 25);
	icon2.infoWindowAnchor = new GPoint(9, 2);

	icon3 = new GIcon();
	icon3.image = "http://www.ferryhill.gov.uk/images/MapIcons/marker4.png";
	icon3.iconSize = new GSize(20, 25);
	icon3.iconAnchor = new GPoint(9, 25);
	icon3.infoWindowAnchor = new GPoint(9, 2);

	icon4 = new GIcon();
	icon4.image = "http://www.ferryhill.gov.uk/images/MapIcons/marker5.png";
	icon4.iconSize = new GSize(20, 25);
	icon4.iconAnchor = new GPoint(9, 25);
	icon4.infoWindowAnchor = new GPoint(9, 2);

	icon5 = new GIcon();
	icon5.image = "http://www.ferryhill.gov.uk/images/MapIcons/marker6.png";
	icon5.iconSize = new GSize(20, 25);
	icon5.iconAnchor = new GPoint(9, 25);
	icon5.infoWindowAnchor = new GPoint(9, 2);

	icon6 = new GIcon();
	icon6.image = "http://www.ferryhill.gov.uk/images/MapIcons/marker7.png";
	icon6.iconSize = new GSize(20, 25);
	icon6.iconAnchor = new GPoint(9, 25);
	icon6.infoWindowAnchor = new GPoint(9, 2);
	
	icon7 = new GIcon();
	icon7.image = "http://www.ferryhill.gov.uk/images/MapIcons/CrossIcon.png";
	icon7.iconSize = new GSize(15, 25);
	icon7.iconAnchor = new GPoint(1, 25);
	icon7.infoWindowAnchor = new GPoint(9, 2);
	
	icon8 = new GIcon();
	icon8.image = "http://www.ferryhill.gov.uk/images/MapIcons/CrossIcon.png";
	icon8.iconSize = new GSize(15, 25);
	icon8.iconAnchor = new GPoint(9, 25);
	icon8.infoWindowAnchor = new GPoint(9, 2);

	icon9 = new GIcon();
	icon9.image = "http://www.ferryhill.gov.uk/images/MapIcons/CrossIcon.png";
	icon9.iconSize = new GSize(15, 25);
	icon9.iconAnchor = new GPoint(9, 25);
	icon9.infoWindowAnchor = new GPoint(9, 2);

	icon10 = new GIcon();
	icon10.image = "http://www.ferryhill.gov.uk/images/MapIcons/CrossIcon.png";
	icon10.iconSize = new GSize(15, 25);
	icon10.iconAnchor = new GPoint(9, 25);
	icon10.infoWindowAnchor = new GPoint(9, 2);
	
	icon11 = new GIcon();
	icon11.image = "";
	icon11.iconSize = new GSize(20, 35);
	icon11.iconAnchor = new GPoint(9, 34);
	icon11.infoWindowAnchor = new GPoint(9, 2);

	icon12 = new GIcon();
	icon12.image = "";
	icon12.iconSize = new GSize(20, 35);
	icon12.iconAnchor = new GPoint(9, 34);
	icon12.infoWindowAnchor = new GPoint(9, 2);

	icon13 = new GIcon();
	icon13.image = "";
	icon13.iconSize = new GSize(20, 35);
	icon13.iconAnchor = new GPoint(9, 34);
	icon13.infoWindowAnchor = new GPoint(9, 2);
	
	icon14 = new GIcon();
	icon14.image = "";
	icon14.iconSize = new GSize(20, 35);
	icon14.iconAnchor = new GPoint(9, 34);
	icon14.infoWindowAnchor = new GPoint(9, 2);

	icon15 = new GIcon();
	icon15.image = "";
	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.689847, -1.554989, icon0, 'Ferryhill Library', '<center><a href="http://ferryhill.gov.uk/organizations/library.htm">Library</a><br /><img src="http://ferryhill.gov.uk/organizations/images/library.jpg" height="150" width="250"></center>');
	newpoints[1] = new Array(54.685283, -1.542958, icon5, 'Feryhill Leisure Centre', '<center><a href="http://ferryhill.gov.uk/organizations/leisure_center.htm">Ferryhill Leisure Centre.</a><img src="http://www.ferryhill.gov.uk/organizations/images/leisure_centre.jpg"></center>');  
 	newpoints[2] = new Array(54.681947, -1.533936, icon6, 'Mainsforth Community Centre', '<center><a href="http://www.ferryhill.gov.uk/organizations/residents_associations.htm">Mainsforth Community Centre.</a><br /><img src="services/images/Mainsforth_Community_Centre.JPG"></center>');  	
 	newpoints[3] = new Array(54.688033, -1.560399, icon3, 'Dean Bank and Ferryhill Literary Institute', '<center><a href="http://www.ferryhill.gov.uk/organizations/residents_associations.htm">Dean Bank and Ferryhill Literary Institute</a></center>');  
 	newpoints[4] = new Array(54.684197, -1.555855, icon4, 'Ladder Centre', '<center><a href="http://www.ferryhill.gov.uk/organizations/community_centres.htm">Ladder Centre.</a></center>');  	newpoints[5] = new Array(54.689836, -1.556822, icon1, 'Doctors Surgery', '<center><a href="http://www.ferryhill.gov.uk/organizations/medical.htm">Doctors Surgery</a></center>');  
	newpoints[6] = new Array(54.689819, -1.557358, icon2, 'Dentist', '<center><a href="http://www.ferryhill.gov.uk/organizations/medical.htm">Dental Surgery.</a></center>');  
	newpoints[7] = new Array(54.689861, -1.553714, icon7, 'Methodist Church', '<center><a href="http://www.ferryhill.gov.uk/organizations/religious_groups.htm">Methodist Church.</a></center>');  
	newpoints[8] = new Array(54.688594, -1.553919, icon8, 'St Lukes Church', '<center><a href="http://www.ferryhill.gov.uk/organizations/religious_groups.htm">St Lukes Church.</a></center>');  
	newpoints[9] = new Array(54.684097, -1.554504, icon9, 'All Saints Catholic Church', '<center><a href="http://www.ferryhill.gov.uk/organizations/religious_groups.htm">All Saints Catholic Church</a></center>');  
	newpoints[10] = new Array(54.688194, -1.559258, icon10, 'Baptist Church', '<center><a href="http://www.ferryhill.gov.uk/organizations/religious_groups.htm">Baptist Church</a></center>');  
	newpoints[11] = new Array(icon11);
	newpoints[12] = new Array(icon12);
	newpoints[13] = new Array(icon13);
	newpoints[14] = new Array(icon14);
	newpoints[15] = new Array(icon15);
	
	

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;
}
//]]>
