// Direct Cars - Google Maps Javascript

	function initialize() {
		if (GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById("map_canvas"));
			map.setCenter(new GLatLng(53.202331, -1.233902), 11);
			map.setUIToDefault();
			
			map.hideControls();
			GEvent.addListener(map, "mouseover", function(){map.showControls();});
			GEvent.addListener(map, "mouseout", function(){map.hideControls();}); 
			
			var directIcon = new GIcon();
			directIcon.image = "http://www.gamesmaniauk.net/warsopford/images/googlemap.png";
			directIcon.shadow = "";
			directIcon.iconSize = new GSize(128, 40);
			directIcon.iconAnchor = new GPoint(11, 20);

			
			markerOptions = { icon:directIcon };
			
			var point = new GLatLng(53.20226, -1.157438);
			map.addOverlay(new GMarker(point, markerOptions));
		}
	}
	
	// This adds an onload and onunload attribute to the <body> tag.
	
	function addLoadEvent(func) {
	  var oldonload = window.onload;
	  if (typeof window.onload != 'function') {
		window.onload = func;
	  } else {
		window.onload = function() {
		  if (oldonload) {
			oldonload();
		  }
		  func();
		}
	  }
	}
	
	addLoadEvent(initialize);
	
	// arrange for our onunload handler to 'listen' for onunload events
	if (window.attachEvent) {
			window.attachEvent("onunload", function() {
					GUnload();      // Internet Explorer
			});
	} else {
	
			window.addEventListener("unload", function() {
					GUnload(); // Firefox and standard browsers
			}, false);
	
	}
