// global "map" variable
var map;

function makeMap() {
    if (GBrowserIsCompatible()) {
      // resize the map
      var m = document.getElementById("map");
      m.style.height = "360px";
      m.style.width = "455px";
      // create the map
      map = new GMap(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
		//map.addControl(new GOverviewMapControl(),
               //new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10, 10)));
      map.centerAndZoom(new GPoint(-1.075526, 53.780982), 6);
		
		var point = new GPoint(-1.075526, 53.780982);
		var mhtml = '<h4>Hazeldene Guest House</h4><p>32 - 34 Brook Street, Doncaster Road,<br />Selby, North Yorkshire. YO8 4AR</p>';
		mhtml = '<div style="white-space: nowrap;">' + mhtml + '</div>';
		
 	 	
		
		//map.addControl(GOverviewMapControl(new GSize(200, 200)));
		map.addControl(new GOverviewMapControl (new GSize(120, 120)));
      
		var omap=document.getElementById("map_overview");
      var mapdiv =document.getElementById("map");
      omap.style.position = "relative";
      omap.style.right = "0px";
      omap.style.bottom = "8px";
      mapdiv.appendChild(omap); 
		
		var marker = createMarker(point,mhtml);
  		map.addOverlay(marker);
		marker.openInfoWindowHtml(mhtml);
		
		// click to see where you are
		/*
   	GEvent.addListener(map, 'click', function(overlay, point) {
     	if (point) {
       	document.getElementById('ggcords').value = 'You clicked at: ' + point;
      }
   	});
		*/
    } else {
      alert("your browser does not support Google Maps!");
    }
}

function createMarker(point,html) {
        // FF 1.5 fix
        //html = '<div style="white-space:nowrap;">' + html + '</div>';
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
		  
        return marker;
		  
}

