function addEvent( obj, type, fn ) {
if ( obj.attachEvent ) {
obj['e'+type+fn] = fn;
obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
obj.attachEvent( 'on'+type, obj[type+fn] );
} else
obj.addEventListener( type, fn, false );
}
function removeEvent( obj, type, fn ) {
if ( obj.detachEvent ) {
obj.detachEvent( 'on'+type, obj[type+fn] );
obj[type+fn] = null;
} else
obj.removeEventListener( type, fn, false );
}

addEvent(window, 'load', 
		function initialize() {
			if (GBrowserIsCompatible()) { 

				// A function to create the marker and set up the event window
				// Dont try to unroll this function. It has to be here for the function closure
				// Each instance of the function preserves the contends of a different instance
				// of the "marker" and "html" variables which will be needed later when the event triggers.    
				function createMarker(point,html) {
					var marker = new GMarker(point);
					GEvent.addListener(marker, "click", function() {
						marker.openInfoWindowHtml(html);
					});
					return marker;
				}

				// 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 GMapTypeControl());
				map.setCenter(new GLatLng(51.1724,4.72018),9);

				// Set up three markers with info windows 

				var point = new GLatLng(51.1724,4.72018);
				var marker = createMarker(point,'<strong>Nelis Bouwonderneming</strong><br />Hazelaardreef 13, 2280<br /> Grobbendonk, Belgium')
				map.addOverlay(marker);

			}

			// display a warning if the browser was not compatible
			else {
				alert("Sorry, the Google Maps API is not compatible with this browser");
			}
		}
);

addEvent(window, 'unload',
	function() {
		GUnload();
	});