var directionDisplay;
var directionsService = new google.maps.DirectionsService();

var map;

// Location of the marker / company
var myLatLng = new google.maps.LatLng('51.721683', '5.641773');

function qMaps() {};

qMaps.initialize = function() {
	directionsDisplay = new google.maps.DirectionsRenderer();
	var myOptions = {
		      zoom: 11,
		      center: myLatLng,
		      mapTypeId: google.maps.MapTypeId.ROADMAP
		    };
	map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	directionsDisplay.setMap(map);
	directionsDisplay.setPanel(document.getElementById("directionsPanel"));
	
	var marker = new google.maps.Marker({position: myLatLng, map: map});
}
window.onload = qMaps.initialize;


qMaps.calcRoute = function() {
	var start = document.getElementById("addressInput").value;
	var request = {
		origin : start,
		destination : myLatLng,
		travelMode : google.maps.DirectionsTravelMode.DRIVING
	};
	directionsService.route(request, function(response, status) {
		if (status == google.maps.DirectionsStatus.OK) {
			directionsDisplay.setDirections(response);
		}
	});
}

qMaps.manageAddressInput = function( mode )
{
   holder = document.getElementById('addressInput') 
   if (mode==1 && holder.value == 'Voer uw vertrekpunt in')
      holder.value = ''
   else if (mode==0 && holder.value == '')
      holder.value = 'Voer uw vertrekpunt in'
}

