var map;
var gdir;
var directionsPanel;

function initializeRouteMap() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("route_map"),{size:new GSize(550,500)});
		map.setCenter(new GLatLng(52.173490,5.412615),13);
		var point = new GLatLng(52.173490,5.412615);
		map.addOverlay(new GMarker(point));
	}
}

// deze functie moet aangeroepen worden bij het initieel opbouwen van de map voor IE.
// Dit voorkomt dat de map maar half zichtbaar is in IE
function mapReload() {
	setTimeout(resizeMap, 1000);
}

function resizeMap() {
	map.checkResize();
}

function geefRoute() {
	map = new GMap2(document.getElementById("route_map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	directionsPanel = document.getElementById("route_text");
	directionsPanel.innerHTML = '';
	map.setCenter(new GLatLng(52.173490,5.412615),13);
	gdir = new GDirections(map, directionsPanel);
	var uwadres = $('uwadres').value;
	uwadres = uwadres+", Netherlands";
	setDirections(uwadres);
	
}
    
function setDirections(fromAddress) {
      gdir.load("from: " + fromAddress + " to: hardwareweg 5c, Amersfoort, Netherlands");
}


