 	    strokeWeight: 10,
 			map: window.map
 	  });
-	
+
+
+drawRoute = (start, end) -> 
+		request = 
+			origin: start.getPosition(),
+			destination: end.getPosition(),
+			travelMode: google.maps.TravelMode.DRIVING
+
+		directionsService.route(request, (response, status) ->
+			if (status == google.maps.DirectionsStatus.OK) 
+				directionsDisplay.setDirections(response);
+			);
+		
 getMarker = (elem,type) ->
 	new google.maps.Marker({
 					position: new google.maps.LatLng(getLat(elem), getLng(elem)),

window.main_stuff.init = ->
	$("#load_scenario").click ->
      xml_text = $("#scenario_text").val()
      xml = $.parseXML(xml_text)
      window.textarea_scenario = window.aurora.Scenario.from_xml($(xml).children())
      window.main_stuff.display()

	myOptions =
    center: new google.maps.LatLng(37, -122)
    zoom: 14
    mapTypeId: google.maps.MapTypeId.ROADMAP
    mapTypeControl: false
    zoomControl: true
    zoomControlOptions: {
      style: google.maps.ZoomControlStyle.DEFAULT,
	    position: google.maps.ControlPosition.TOP_LEFT
     }
   window.map = new google.maps.Map(document.getElementById("map_canvas"),myOptions)
  
window.main_stuff.display = ->
	network = window.textarea_scenario.get('network')
	window.map.setCenter(new google.maps.LatLng(getLat(network), getLng(network)))
	drawNodes(network.get('nodelist').get('node'))
	drawSensors(network.get('sensorlist').get('sensor'))
	drawLinks(network.get('linklist').get('link'))
  # node.lat = window.textarea_scenario.get('network').get('nodelist').get('node')[0].get('position').get('point')[0].get('lat')

getLng = (elem) ->
		elem.get('position').get('point')[0].get('lng')

drawPolyLine = (marker1, marker2) ->
	new google.maps.Polyline({
	    path: [marker1.getPosition(),marker2.getPosition()],
	    strokeColor: "#240489",
