if (GBrowserIsCompatible()) { 
	var side_bar_html = "";
	var gmarkers = [];
	var htmls = [];
	var i = 0;
	//arrays to hold variants of the info window html with get direction forms open
	var to_htmls = [];
	var from_htmls = [];

	/*function createMarker(point,name,html) {
		var marker = new GMarker(point);
		// The info window version with the "to here" form open
		to_htmls[i] = html + '<br />Directions: <b>To here</b> - <a href="javascript:fromhere(' + i + ')">From here</a>' +
		'<form action="javascript:getDirections()"><fieldset style="width:150px;border:0px;">' +
		'<label for="saddr">Start Location:</label><input type="text" maxlength="40" name="saddr" id="saddr" value="" />' +
		'<input value="Get Directions" type="submit" />' +
		'<input type="hidden" id="daddr" value="'+name+"@"+ point.lat() + ',' + point.lng() + 
		'"/></fieldset></form>';
		// The info window version with the "to here" form open
		from_htmls[i] = html + '<br />Directions: <a href="javascript:tohere(' + i + ')">To here</a> - <b>From here</b>' +
		'<form action="javascript:getDirections()"><fieldset style="width:150px;border:0px;">' +
		'<label for="daddr">End Location:</label><input type="text" maxlength="40" name="daddr" id="daddr" value="" />' +
		'<input value="Get Directions" type="submit" />' +
		'<input type="hidden" id="saddr" value="'+name+"@"+ point.lat() + ',' + point.lng() +
		'"/></fieldset></form>';
		// The inactive version of the direction info
		html = html + '<br />Directions: <a href="javascript:tohere('+i+')">To here</a> - <a href="javascript:fromhere('+i+')">From here</a>';
	
		GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowHtml(html);
		});

		// save the info we need to use later for the side_bar
		gmarkers[i] = marker;
		htmls[i] = html;
		// add a line to the side_bar html
		side_bar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br />';
		i++;
		return marker;
	}*/

   // ===== request the directions =====
/*   function getDirections() {
     var saddr = document.getElementById("saddr").value
     var daddr = document.getElementById("daddr").value
     document.getElementById("directions").style.display = "block";
     gdir.load("from: "+saddr+" to: "+daddr);
   }*/


   // This function picks up the click and opens the corresponding info window
  /* function myclick(i) {
     gmarkers[i].openInfoWindowHtml(htmls[i]);
   }

   // functions that open the directions forms
   function tohere(i) {
     gmarkers[i].openInfoWindowHtml(to_htmls[i]);
   }
   function fromhere(i) {
     gmarkers[i].openInfoWindowHtml(from_htmls[i]);
   }*/

   // Display the map, with some controls and set the initial location 
   //var map = new GMap2(document.getElementById("map")); 
   map.addControl(new GLargeMapControl());
   //map.addControl(new GSmallMapControl());
   map.addControl(new GMapTypeControl());
   map.setCenter(new GLatLng(51.828631,-0.122592),9);
  
	var point = new GLatLng(51.85727,0.072495);
	
	var encodedPolyline = new GPolyline.fromEncoded({
  color: "#000000",
  weight: 3,
  opacity: 0.7,
  points: "k|q|Hp}i@mq@sc@}iBe_CiHggCyy@gYox@euAxt@ab@bcAbVxw@e@jk@_hBxt@cj@`aBgYstAeiCgc@_|Box@meB}\\sxDqx@ckBfw@iw@sDufGrmGygDve@cy@|w@iRbrAvBxO}vC|c@uo@ty@S|h@gkAtgD~C~xF_oAvGi_BoU{{C?qeAbsCzzArkCcGraCjf@j\\mWvQklB~MmAnF~_A?~_AnjB|iA{@`v@~_AxyD~\\rXfTrtAsIptBrNhdA{@pjBf^~}AgYoAnn@`wAlLj^x\\N`e@d`Az|@voApPt`@zk@~Cjf@_UzJrBvnCwV~Wv`@b~@vV~Wk\\~p@sNsg@nfDkCf_L_q@rtAfT~eCoKvnCpSd^tg@aj@n}@|h@vt@vfBt[~fDhc@~\\waBvfBgOliAbt@ld@f_B`Shp@j\\aBh`CzY~u@nA~pErfCdlIlZbuBeh@~qGg@f|@nZdYwGr`A}r@fuAq]rwB`[g@`b@gYzw@|Erq@`Q?z^ka@oZ_fCbjE_dDs{@{sBsmB{TdaBs~A`nC_fClgBsg@lF{c@scBoeBb`@}k@`xIdEln@awKtoPaoAr{Ew|A`j@yfAcyEli@_yAdt@_b@xlC{}Vcj@e^gEkiAf_BqzD{eDcaBox@g~DoFeyIjdAwjErb@{_Bce@qKe|@qaCuXwQkcDnbAsdIfbH_jFggCjsAcrAwiCqgAsv@iHwpBcbI`eAoeG_Noi@sbBkgAmUecBjOgoBkeDbvA",
  levels: "P?IHJHHHIHJHHKHIJHLJGHKHIHJILHIMIJIKHFGHIGJGHIKLHFIFGHJFHGIKGHIGHJHMHGHIJHIIJKHIHJILHJGHGIKGHIGHGIIJHILGHIMGKIJIHIKGHIJILIHGJGIKJHILMIGJHIP",
  zoomFactor: 2,
  numLevels: 18
	});

// === create a GDirections Object ===
 /*  var gdir=new GDirections(map, document.getElementById("directions"));

   // === Array for decoding the failure codes ===
   var reasons=[];
   reasons[G_GEO_SUCCESS]            = "Success";
   reasons[G_GEO_MISSING_ADDRESS]    = "Missing Address: The address was either missing or had no value.";
   reasons[G_GEO_UNKNOWN_ADDRESS]    = "Unknown Address:  No corresponding geographic location could be found for the specified address.";
   reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";
   reasons[G_GEO_BAD_KEY]            = "Bad Key: The API key is either invalid or does not match the domain for which it was given";
   reasons[G_GEO_TOO_MANY_QUERIES]   = "Too Many Queries: The daily geocoding quota for this site has been exceeded.";
   reasons[G_GEO_SERVER_ERROR]       = "Server error: The geocoding request could not be successfully processed.";
   reasons[G_GEO_BAD_REQUEST]        = "A directions request could not be successfully parsed.";
   reasons[G_GEO_MISSING_QUERY]      = "No query was specified in the input.";
   reasons[G_GEO_UNKNOWN_DIRECTIONS] = "The GDirections object could not compute directions between the points.";

   // === catch Directions errors ===
   GEvent.addListener(gdir, "error", function() {
     var code = gdir.getStatus().code;
     var reason="Code "+code;
     if (reasons[code]) {
       reason = reasons[code]
     } 

     alert("Failed to obtain directions, "+reason);
   });*/
// Read the data from example.xml
   var request = GXmlHttp.create();
   request.open("GET", "mhrl.xml", true);
   request.onreadystatechange = function() {
     if (request.readyState == 4) {
       var xmlDoc = request.responseXML;
       // 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 displaylabel = new ELabel(new GLatLng(lat,lng), markers[i].getAttribute("label"), "gmaplabel", new GSize(0,-35), 80, true);
         // create the marker
         var marker = createMarker(point,label,html);
         map.addOverlay(marker);
         map.addOverlay(displaylabel);
       }
       // put the assembled side_bar_html contents into the side_bar div
       //document.getElementById("side_bar").innerHTML = side_bar_html;
     }
   }
   request.send(null);

	map.addOverlay(encodedPolyline);
 
 } else {// display a warning if the browser was not compatible
	alert("Sorry, the Google Maps API is not compatible with this browser");
 }




