/* This function takes the start value given by the user in a text field
*  and stores it in the "start" variable, then takes their choice of
*  campus from the dropdown menu, and creates a path between the
*  two points.
*/

function calcRoute() {
	// text field value
	var start = document.getElementById("startAddress").value;
	
	// dropdown choice
	var end = document.getElementById("endAddress").value;
	// takes variables and creates an object in the "request" variable
	
	map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
	var request = {
		origin:start, 
		destination:end,
		travelMode: google.maps.DirectionsTravelMode.DRIVING
	};
	// takes "request" and places it in a route, output to the map
	directionsService.route(request, function(result, status) {
		if (status == google.maps.DirectionsStatus.OK) {
			directionsDisplay.setDirections(result);
		}
	});
	directionsDisplay.setMap(map);
	start = "";
	end = "";
	toggleMe();
}
