       suggestion: (data) ->
         "<div>#{data.properties.Adresse}</div>"
   ).on 'typeahead:selected typeahead:autocompleted', (event, suggestion) ->
-    coords = suggestion.geometry.coordinates
-    $('#event_lng').val coords[0]
-    $('#event_lat').val coords[1]
+    updateCoordinates suggestion

  selects[8].value = ("0" + endhour).slice(-2)

document.addEventListener "page:change", ->
  addressSearch = new Bloodhound
    datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value')
    queryTokenizer: Bloodhound.tokenizers.whitespace

    remote:
      url: "http://data.wien.gv.at/daten/OGDAddressService.svc/GetAddressInfo?Address=%QUERY&crs=EPSG:4326"
      filter: (addresses) ->
        updateCoordinates addresses.features[0]
        addresses.features
      wildcard: '%QUERY'

