// JavaScript Document

    //<![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");

	  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_TOP_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 = "#0000cc";
	  button.style.backgroundColor = "white";
	  button.style.font = "11px 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() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("gmap"));
		map.addControl(new GSmallMapControl());
        // map.setCenter(new GLatLng(53.377114, -1.064022), 13);
        map.setCenter(new GLatLng(53.984989, -1.046469), 14);



		// Create our "tiny" marker icon
		var bandbicon = new GIcon();
		bandbicon.image = "http://www.squeegee-design.co.uk/_images/structure/mapmarker.png";
		bandbicon.iconSize = new GSize(167, 69);
		bandbicon.iconAnchor = new GPoint(84, 67);
		bandbicon.infoWindowAnchor = new GPoint(84, 67);
		
		// Create our "tiny" marker icon
		var locationicon = new GIcon();
		locationicon.image = "http://www.nycom.co.uk/_lib/_images/_structure/nycom_map_icon.png";
		locationicon.iconSize = new GSize(139, 88);
		locationicon.iconAnchor = new GPoint(65, 88);
		//locationicon.infoWindowAnchor = new GPoint(107, 0);

		var bandb = new GMarker(new GLatLng(53.984989, -1.046469),locationicon);
		/*GEvent.addListener(bandb, "click", function() {
			bandb.openInfoWindowHtml("<div style=\"width: 290px; 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&hl=en&saddr=' + this.postcode.value + '&daddr=YO31+7JA,+UK&om=1';return true;\"><input type=\"text\" name=\"postcode\"> <input type=\"submit\" value=\"Get Directions.\"></form></div>");
		});*/
		GEvent.addListener(bandb, "click", function(){
		  window.open('http://maps.google.com/maps?f=q&hl=en&geocode=&q=YO32+9JR&ie=UTF8&ll=53.984913,-1.046469&spn=0.008453,0.020084&z=16&iwloc=addr&om=1', 'googlemap', '');
		});
		map.addOverlay(bandb);
		map.addControl(new levels());
		
		
		
		
		
		
		
		
		
		
		
		/*var bandb = new GMarker(new GLatLng(53.376685, -1.064751),bandbicon);
		GEvent.addListener(bandb, "click", function() {
			bandb.openInfoWindowHtml("<div style=\"width: 290px; 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&hl=en&saddr=' + this.postcode.value + '&daddr=YO30+4GR,+UK&om=1';return true;\"><input type=\"text\" name=\"postcode\"> <input type=\"submit\" value=\"Get Directions.\"></form></div>");
		});
		GEvent.addListener(bandb, "infowindowclose", function(){
		  map.panTo(new GLatLng(53.37689, -1.064129));
		})*/
		//map.addOverlay(bandb);
		//map.addControl(new levels());


     }
    }

    //]]>
