    if (GBrowserIsCompatible()) {

// resize the map
//      var m = document.getElementById("map");
//      m.style.height = "400px";
//      m.style.width = "100%";
//      var map = new GMap(m);


// ==== first part of the select box ===
	var select_html = '<select onChange="handleSelected(this)">' +
				'<option> - Select a member - <\/option>';
	// =====================================


	// arrays to hold copies of the markers and html used by the side_bar
	// because the function closure trick doesnt work there
	var gmarkers = [];
	var htmls = [];
	var i = 0;


	// A function to create the marker and set up the event window
	function createMarker(point,name,html) {
	  var marker = new GMarker(point, {title:name});
	  GEvent.addListener(marker, "click", function() {
	    map.setZoom(14);
	    marker.openInfoWindowHtml(html);
	  });
	  // save the info we need to use later for the side_bar
	  gmarkers[i] = marker;
	  htmls[i] = html;

	  // ======= Add the entry to the select box =====
	  select_html += '<option> ' + name + '<\/option>';
	  // ==========================================================

	  i++;
	  return marker;
	}


     // ======= This function handles selections from the select box ====
	// === If the dummy entry is selected, the info window is closed ==
	function handleSelected(opt) {
	  var i = opt.selectedIndex - 1; 
	  if (i > -1) {
	  map.setZoom(7);
	    GEvent.trigger(gmarkers[i],"click");
	  }
	  else {
	    map.closeInfoWindow();
	  }
	}

			// create the map
			var map = new GMap2(document.getElementById("map"));
			map.addControl(new GSmallZoomControl());
//			map.addControl(new GMapTypeControl());

			// ====== Restricting the range of Zoom Levels =====
			// Get the list of map types			
//			var mt = map.getMapTypes();
			// Overwrite the getMinimumResolution() and getMaximumResolution() methods
//			for (var j=0; j<mt.length; j++) {
//				mt[j].getMinimumResolution = function() {return 6;}
//				mt[j].getMaximumResolution = function() {return 7;}
//			}

			map.setCenter(new GLatLng(53.35449614165876,-6.247701644897461), 14);

			//enable smooth zooming
			map.enableContinuousZoom();
			map.enableDoubleClickZoom();

			// Insert the constituency overlay
			var insert1 = new EInsert(new GLatLng(53.35449614165876,-6.247701644897461), "/common/images/maps/icon_overlay.png", new GSize(2132,1403), 16);
			map.addOverlay(insert1);



	// Read the data from 100.xml
	
	GDownloadUrl("/xml/gmap_iconmembers.xml", function (doc) {
	  var xmlDoc = GXml.parse(doc);
	  var markers = xmlDoc.documentElement.getElementsByTagName("marker");

	  for (var i = 0; i < markers.length; i++) {
	    // obtain the attribues of each marker
	    var lat = parseFloat(markers[i].getAttribute("lat"));
	    var lng = parseFloat(markers[i].getAttribute("lng"));
	    var point = new GLatLng(lat,lng);
	    var html = markers[i].getAttribute("html");
	    var label = markers[i].getAttribute("label");
	    // create the marker
	    var marker = createMarker(point,label,html);
	    map.addOverlay(marker);
	  }

	 // ===== final part of the select box =====
	  select_html += '</select>';
	  document.getElementById("selection").innerHTML = select_html;

	});



			// Add a move listener to restrict the bounds range
			GEvent.addListener(map, "move", function() {
				checkBounds();
			});

			// The allowed region which the whole map must be within
			var allowedBounds = new GLatLngBounds(new GLatLng(50.5,-10), new GLatLng(56,-6.06));
			
			// If the map position is out of range, move it back
			function checkBounds() {
				// Perform the check and return if OK
				if (allowedBounds.contains(map.getCenter())) {
					return;
				}
				// It`s not OK, so find the nearest allowed point and move there
				var C = map.getCenter();
				var X = C.lng();
				var Y = C.lat();

				var AmaxX = allowedBounds.getNorthEast().lng();
				var AmaxY = allowedBounds.getNorthEast().lat();
				var AminX = allowedBounds.getSouthWest().lng();
				var AminY = allowedBounds.getSouthWest().lat();

				if (X < AminX) {X = AminX;}
				if (X > AmaxX) {X = AmaxX;}
				if (Y < AminY) {Y = AminY;}
				if (Y > AmaxY) {Y = AmaxY;}
				//alert ("Restricting "+Y+" "+X);
				map.setCenter(new GLatLng(Y,X));
			}


		}

		else {
			alert("Sorry, the Google Maps API is not compatible with this browser");
	}

// This Javascript is based on code provided by the
// Blackpool Community Church Javascript Team
// http://www.commchurch.freeserve.co.uk/   
// http://www.econym.demon.co.uk/googlemaps/
