//<![CDATA[
		function loadGoogleMaps() {
		  if (GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById("map"));
			// Add and set the maptype to physical (terrein)
			map.addMapType(G_PHYSICAL_MAP) ; 
			map.setMapType(G_PHYSICAL_MAP);
			// Add extra zoom functionality
			map.enableDoubleClickZoom();
			map.enableContinuousZoom();
			map.enableScrollWheelZoom();
			// Set the center of the map to the center of the Netherlands
			map.setCenter(new GLatLng(52.469397, 5.509644), 7);
			// Add the controls
			map.addControl(new GLargeMapControl());
			map.addControl(new GMenuMapTypeControl());
			map.addControl(new GOverviewMapControl());

			// Map dragevent
			GEvent.addListener(map, "dragstart", function() {
				hideInfoWindow();
			});
			// Map zoomevent
			GEvent.addListener(map, "zoomend", function() {
				hideInfoWindow();
			});
			
			// Info window
			var infoWindow = document.createElement('div');
			infoWindow.id = 'infoWindow';
			infoWindow.className = 'infoWindow';
			document.getElementById('map').appendChild(infoWindow);
			
			// Define the icons
			var mapIconBouw = new GIcon();
			mapIconBouw.image = "/img/mapimages/imgMapPointInfra.png";
			mapIconBouw.iconSize = new GSize(16, 16);
			mapIconBouw.iconAnchor = new GPoint(8, 8);
			mapIconBouw.infoWindowAnchor = new GPoint(8, 8);
			
			var mapIconInfra = new GIcon();
			mapIconInfra.image = "/img/mapimages/imgMapPointBouw.png";
			mapIconInfra.iconSize = new GSize(16, 16);
			mapIconInfra.iconAnchor = new GPoint(8, 8);
			mapIconInfra.infoWindowAnchor = new GPoint(8, 8);
			
			var mapIconAdvies = new GIcon();
			mapIconAdvies.image = "/img/mapimages/imgMapPointAdvies.png";
			mapIconAdvies.iconSize = new GSize(16, 16);
			mapIconAdvies.iconAnchor = new GPoint(8, 8);
			mapIconAdvies.infoWindowAnchor = new GPoint(8, 8);
			
			var mapIconDiensten = new GIcon();
			mapIconDiensten.image = "/img/mapimages/imgMapPointDiensten.png";
			mapIconDiensten.iconSize = new GSize(16, 16);
			mapIconDiensten.iconAnchor = new GPoint(8, 8);
			mapIconDiensten.infoWindowAnchor = new GPoint(8, 8);
			
			var mapIconGroep = new GIcon();
			mapIconGroep.image = "/img/mapimages/imgMapPointGroep.png";
			mapIconGroep.iconSize = new GSize(16, 16);
			mapIconGroep.iconAnchor = new GPoint(8, 8);
			mapIconGroep.infoWindowAnchor = new GPoint(8, 8);
			
			function createMarker(latLng, id, mapIcon)
			{
				var marker = new GMarker(latLng, { icon:mapIcon });
				marker.id = id;
				GEvent.addListener(marker, 'click', function() {
					toggleInfoWindow(marker);
				});
				return marker;
			}
			
			// Add the points
			var bounds = new GLatLngBounds();
			$('.projects > div').each(function() {
				var oProject = $(this);
				var point = new GLatLng(parseFloat(oProject.find('.lat').text()), parseFloat(oProject.find('.long').text()));
				if ($(oProject.children('div').get(0)).is('.bouw'))
				{
					map.addOverlay(createMarker(point, oProject.attr('id'), mapIconBouw));
				}
				else if ($(oProject.children('div').get(0)).is('.infra'))
				{
					map.addOverlay(createMarker(point, oProject.attr('id'), mapIconInfra));
				}
				else if ($(oProject.children('div').get(0)).is('.advies'))
				{
					map.addOverlay(createMarker(point, oProject.attr('id'), mapIconAdvies));
				}
				else if ($(oProject.children('div').get(0)).is('.diensten'))
				{
					map.addOverlay(createMarker(point, oProject.attr('id'), mapIconDiensten));
				}
				else
				{
					map.addOverlay(createMarker(point, oProject.attr('id'), mapIconGroep));
				}
				bounds.extend(point);
			});
			
			// Zoom in to put all points in view
			window.setTimeout(function() {
			  map.setZoom(map.getBoundsZoomLevel(bounds));
			  map.setCenter(bounds.getCenter());
			}, 500);
			
			function toggleInfoWindow(marker)
			{
				var oInfoWindow = $('#infoWindow');
				var oInfoWindowContent = $('#' + marker.id);
				
				if (oInfoWindow.is(':visible') && oInfoWindow.html().length > 0 && 
					oInfoWindow.find('.lat').text() == oInfoWindowContent.find('.lat').text() &&
					oInfoWindow.find('.long').text() == oInfoWindowContent.find('.long').text())
				{
					hideInfoWindow();
				}
				else
				{
					oInfoWindow.html(oInfoWindowContent.html());
					
					var point = map.getCurrentMapType().getProjection().fromLatLngToPixel(map.getBounds().getSouthWest(),map.getZoom());
					var offset = map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),map.getZoom());
					var anchor = marker.getIcon().iconAnchor;
					var width = marker.getIcon().iconSize.width;
					var pos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(offset.x - point.x - oInfoWindow.width() + 25, - offset.y + point.y +anchor.y));
					
					pos.apply(oInfoWindow.get(0));
					oInfoWindow.show();
					
				}
			}
				
			function hideInfoWindow()
			{

				$('#infoWindow').hide();
			}
		  }
		}
		//]]>