     
   return
 
-set_field = (type, value) ->
-  $("input#trip_from_#{type}").val value
+set_field = (type, destination, value) ->
+  $("input#trip_#{destination}_#{type}").val value
   return
 
-window.get_location = (location, suggest_field) ->
+window.setNewRoute = (from, to) ->
+  request = {
+    origin: from, 
+    destination: to,
+    travelMode: google.maps.DirectionsTravelMode.DRIVING
+  }
+  directionsService.route request, (response, status) ->
+    if status == google.maps.DirectionsStatus.OK
+      directionsDisplay.setDirections response
+
+window.get_location = (location, suggest_field, destination) ->
   if google?
     if !geocoder?
       geocoder = new google.maps.Geocoder()

              value = address_components[x].long_name
              switch type
                when 'locality'
                  set_field 'city', value
                when 'country'
                  set_field 'country', value
                  set_field 'country_code_iso', address_components[x].short_name
                when 'postal_code'
                  set_field 'zip', value
                when 'route'
                  set_field 'street', value
                when 'street_number'
                  set_field 'street_no', value

            if !window.marker?
              window.marker = new google.maps.Marker { map: window.map }

              if results[x]
                full_address = results[x].formatted_address
                link_to = "<a href='#' data-full-address='#{full_address}' class='set_map_search'>#{full_address}</a><br />"
                $(suggest_field).append link_to
            $(suggest_field).show()
        else
          $(suggest_field).hide()
          location = results[0].geometry.location
          window.map.setCenter location
          $("input#trip_#{destination}_lat").val location.lat()
          $("input#trip_#{destination}_lng").val location.lng()
          address_components = results[0].address_components
          if address_components.length > 0
            for x in [0..address_components.length-1]
