    if (GBrowserIsCompatible()) {
      var side_bar_html = "";
      var gmarkers = [];
      var htmls = [];
      var i = 0;
      
      // Create some custom icons
      
      // This icon uses the same shape as the default Google marker
      // So we can use its details for everything except the image 
      var blueIcon = new GIcon();
      blueIcon.image = "images/map/blue.png";
      blueIcon.shadow = "images/map/shadow.png";
      blueIcon.iconSize = new GSize(40, 30);
      blueIcon.shadowSize = new GSize(56, 20);
      blueIcon.iconAnchor = new GPoint(0, 34);
      blueIcon.infoWindowAnchor = new GPoint(9, 2);
      blueIcon.infoShadowAnchor = new GPoint(18, 25);
       
      var greenIcon = new GIcon();
      greenIcon.image = "images/map/green.png";
      greenIcon.shadow = "images/map/shadow.png";
      greenIcon.iconSize = new GSize(40, 30);
      greenIcon.shadowSize = new GSize(56, 20);
      greenIcon.iconAnchor = new GPoint(0, 34);
      greenIcon.infoWindowAnchor = new GPoint(9, 2);
      greenIcon.infoShadowAnchor = new GPoint(18, 25);
	  
	  var blackIcon = new GIcon();
      blackIcon.image = "images/map/black.png";
      blackIcon.shadow = "images/map/shadow.png";
      blackIcon.iconSize = new GSize(40, 30);
      blackIcon.shadowSize = new GSize(56, 20);
      blackIcon.iconAnchor = new GPoint(0, 34);
      blackIcon.infoWindowAnchor = new GPoint(9, 2);
      blackIcon.infoShadowAnchor = new GPoint(18, 25);
      
      // An array of GIcons, to make the selection easier
      var icons = [];
      icons[0] = blueIcon;
      icons[1] = greenIcon;
	  icons[2] = blackIcon;
	 

      // the icon information is passed to this function
      function createMarker(point,name,html,icontype) {
        var marker = new GMarker(point,icons[icontype]);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml("<div style='width:400px;font-size:10px;'>"+html+"</div>");
        });
        // save the info we need to use later for the side_bar
        gmarkers[i] = marker;
        htmls[i] = html;
		
		var iconimg = [];
		iconimg[0]='blue';
		iconimg[1]='green';
		iconimg[2]='black';
		
        // add a line to the side_bar html
        side_bar_html += '<img src="images/map/' + iconimg[icontype] + '.png" style="vertical-align:middle;"/>&nbsp;&nbsp;&nbsp;<a href="javascript:myclick(' + i + ')">' + name + '</a><br><br>';
        i++;
        return marker;
      }

      function myclick(i) {
        gmarkers[i].openInfoWindowHtml("<div style='width:400px;font-size:10px;'>"+htmls[i]+"</div>");
      }

		var map = new GMap2(document.getElementById("map"));
      	map.addControl(new GLargeMapControl());
      	map.addControl(new GMapTypeControl());
      	map.setCenter(new GLatLng(53.69,-1.7574262619018554), 10);

      // Read the data from custom.xml
      var request = GXmlHttp.create();
      request.open("GET", "inc/maps/home_map.xml", true);
      request.onreadystatechange = function() {
        if (request.readyState == 4) {
          var xmlDoc = GXml.parse(request.responseText);
          // obtain the array of markers and loop through it
          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");
            var icontype = parseInt(markers[i].getAttribute("icontype"));
            // create the marker
            var marker = createMarker(point,label,html,icontype);
            map.addOverlay(marker);
          }
          // put the assembled side_bar_html contents into the side_bar div
          document.getElementById("side_bar").innerHTML = side_bar_html;
        }
      }
      request.send(null);
    }

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

