$(document).ready(function() {

      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		var point = new GLatLng(53.159947, -1.538086);
        map.setCenter(point, 6);
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		
		point1 = new GLatLng(51.300955,0.488162)
		marker1 = new GMarker(point1,makeIcon("/gfx/mapicon.png"));
		map.addOverlay(marker1);
		GEvent.addListener(marker1, "click", function() {
		  map.openInfoWindow(point1,$("#aylesford").html());
		});		
		
		point2 = new GLatLng(54.967656,-1.682453)
		marker2 = new GMarker(point2,makeIcon("/gfx/mapicon.png"));
		map.addOverlay(marker2);
		GEvent.addListener(marker2, "click", function() {
		  map.openInfoWindow(point2,$("#newcastle").html());
		});		

		
		point3 = new GLatLng(52.939583,-1.167276)
		marker3 = new GMarker(point3,makeIcon("/gfx/mapicon.png"));
		map.addOverlay(marker3);
		GEvent.addListener(marker3, "click", function() {
		  map.openInfoWindow(point3,$("#nottingham").html());
		});		
      }
});





function makeIcon (image) {
	var icon = new GIcon();
	icon.image = image;
	icon.iconSize = new GSize(51, 51);
	icon.iconAnchor = new GPoint(24, 23);
	icon.infoWindowAnchor = new GPoint(0, 0);
	return icon;
}


