var map;
			var gdir;
			var geocoder = null;
			var addressMarker;
			var point;
			var locale;
				
			function initialize( location) 
			{
				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);
					
					if ( location == 'Biddinghuizen' ) {
						map.setCenter(new GLatLng(52.463504,5.705237), 13);
						point = new GLatLng(52.463504,5.705237);
					}else{
						map.setCenter(new GLatLng(52.967933,5.884702), 13);
						point = new GLatLng(52.967933,5.884702);
					}
					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,location) {
				
				map.clearOverlays();
				if ( location == 'Biddinghuizen' ) {
					toAddress = 'Plantweg 8 8256 SH Biddinghuizen';
				}else{
					toAddress = 'innovatielaan 25 8466 SN Heerenveen';	
				}
				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;