var map;
			var gdir;
			var geocoder = null;
			var addressMarker;
			var point;
			var locale;
				
			function initialize() 
			{
				if (GBrowserIsCompatible()) 
				{    
					locale = 'nl_NL';
 
					map = new GMap2(document.getElementById("map"));
					gdir = new GDirections(map, document.getElementById("route"));
					GEvent.addListener(gdir, "load", onGDirectionsLoad);
					GEvent.addListener(gdir, "error", handleErrors);
					
					var icon = new GIcon(G_DEFAULT_ICON);
					
					map.setCenter(new GLatLng(52.942399,6.262808), 13);
					point = new GLatLng(52.942399,6.262808);
					map.addOverlay(new GMarker(point,icon));
					map.addControl(new GLargeMapControl());
					
					map.addMapType(G_NORMAL_MAP);
					map.addMapType(G_SATELLITE_MAP);
					map.addMapType(G_HYBRID_MAP);
					map.addMapType(G_PHYSICAL_MAP);
					
					map.setMapType(G_HYBRID_MAP);
					
					map.addControl(new GMapTypeControl());	
				}
			}
			
			function planRoute(fromAddress) {
				map.clearOverlays();
				toAddress = 'kloosterweg 3 8424 Elsloo';
				gdir.load("from: " + fromAddress + " to: " + toAddress, { "locale": locale });		
			}
			
			function handleErrors()
			{
				if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
					alert("Het opgegeven adres kon niet teruggevonden worden, dat kan te wijten zijn aan het feit dat het een recent of onjuist adres is");
				else if (document.getElementById("address").value=="")
					alert('Gelieve een adres op te geven...');
				else 
					alert("Unknow error");
			}
			
			function onGDirectionsLoad()
			{
				//plaats hier acties tijdens het laden van de route
			}

			
			window.onunload = GUnload;
