    //<![CDATA[

	function levels() {
	}
	levels.prototype = new GControl();

	// Creates a one DIV for each of the buttons and places them in a container
	// DIV which is returned as our control element. We add the control to
	// to the map container and return the element for the map class to
	// position properly.
	levels.prototype.initialize = function(map) {
	  var container = document.createElement("div");

//51.58571,-2.44802
//51.642391,-2.455477

	  var streetDiv = document.createElement("div");
	  this.setButtonStyle_(streetDiv);
	  container.appendChild(streetDiv);
	  streetDiv.appendChild(document.createTextNode("Street"));
	  GEvent.addDomListener(streetDiv, "click", function() {
		  map.setMapType(G_HYBRID_MAP);
        map.setCenter(new GLatLng(52.682789,-1.830034), 17);
	     map.closeInfoWindow();
	  });

	  var localDiv = document.createElement("div");
	  this.setButtonStyle_(localDiv);
	  container.appendChild(localDiv);
	  localDiv.appendChild(document.createTextNode("Local"));
	  GEvent.addDomListener(localDiv, "click", function() {
		  map.setMapType(G_HYBRID_MAP);
        map.setCenter(new GLatLng(52.682789,-1.830034), 14);
		  map.closeInfoWindow();
	  });

	  var cityDiv = document.createElement("div");
	  this.setButtonStyle_(cityDiv);
	  container.appendChild(cityDiv);
	  cityDiv.appendChild(document.createTextNode("City"));
	  GEvent.addDomListener(cityDiv, "click", function() {
		  map.setMapType(G_HYBRID_MAP);
        map.setCenter(new GLatLng(52.682789,-1.830034), 11);
		  map.closeInfoWindow();
	  });

	  var regionDiv = document.createElement("div");
	  this.setButtonStyle_(regionDiv);
	  container.appendChild(regionDiv);
	  regionDiv.appendChild(document.createTextNode("Region"));
	  GEvent.addDomListener(regionDiv, "click", function() {
		  map.setMapType(G_NORMAL_MAP);
        map.setCenter(new GLatLng(52.682789,-1.830034), 8);
		  map.closeInfoWindow();
	  });

	  map.getContainer().appendChild(container);
	  return container;
	}

	// By default, the control will appear in the top left corner of the
	// map with 7 pixels of padding.
	levels.prototype.getDefaultPosition = function() {
	  return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(12, 12));
	}

	// Sets the proper CSS for the given button element.
	levels.prototype.setButtonStyle_ = function(button) {
	  button.style.textDecoration = "underline";
	  button.style.color = "#002674";
	  button.style.backgroundColor = "white";
	  button.style.font = "1em Arial";
	  button.style.border = "1px solid black";
	  button.style.padding = "2px";
	  button.style.marginBottom = "3px";
	  button.style.textAlign = "center";
	  button.style.width = "6em";
	  button.style.cursor = "pointer";
	}


    function load(mapID) {
      if (GBrowserIsCompatible()) {
		var mapObj = document.getElementById(mapID);
        var map = new GMap2(mapObj);
		  map.addControl(new GSmallMapControl());
		 map.addControl(new GMapTypeControl(),new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(12,12)));
        map.setCenter(new GLatLng(52.682789,-1.830034), 16);
		  map.setMapType(G_HYBRID_MAP);

		GMap2.prototype.wheelZoom = function(event)
		{ if(event.cancelable) event.preventDefault(); map.closeInfoWindow(); 
		if((event.detail || -event.wheelDelta) < 0) {map.zoomIn();} else {map.zoomOut();} return false; }
		GEvent.addDomListener(mapObj, "DOMMouseScroll", map.wheelZoom);
		GEvent.addDomListener(mapObj, "mousewheel", map.wheelZoom);


		// Create our "tiny" marker icon
		var locationicon = new GIcon();
		locationicon.image = "http://"+window.location.hostname+"/pics/layout/mapmarker.png";
		locationicon.iconSize = new GSize(157, 69);
		locationicon.iconAnchor = new GPoint(107, 0);
		locationicon.infoWindowAnchor = new GPoint(107, 0);

		var bandb = new GMarker(new GLatLng(52.682789,-1.830034),locationicon);
		GEvent.addListener(bandb, "click", function() {
			bandb.openInfoWindowHtml("<div style=\"width: 200px; background: #ffffff;\"><h2>Get Directions!</h2><p>Simply enter your postcode...</p><form style=\"margin: 0 0 20px 0;padding: 0;\" method=\"POST\" target=\"_blank\" onsubmit=\"this.action = 'http://maps.google.com/maps?f=d&source=s_d&saddr=' + this.postcode.value + '&daddr=52.683778,-1.830136&hl=en&geocode=&mra=ls&sll=52.683778,-1.830136&sspn=0.006205,0.019312&ie=UTF8&t=h&z=7';return true;\"><input type=\"text\" name=\"postcode\"> <input type=\"submit\" value=\"Get Directions.\"></form></div>");
			//&daddr=51.642391,-2.455477&hl=en&geocode=&mra=ls&sll=51.642112,-2.456539&sspn=0.006205,0.019312&ie=UTF8&t=h&z=7
		});
		GEvent.addListener(bandb, "infowindowclose", function(){
		  map.panTo(new GLatLng(52.682789,-1.830034));
		})
		map.addOverlay(bandb);
		map.addControl(new levels());


     }
    }


    //]]>
