             event.which == 38  # up arrow key
           event.stopPropagation()
           set_last_value(event.target)
-# @@@ fix for ENTER press
-#        if event.which == 13
-#          event.stopPropagation()
-#          form_tag = $(event.target).closest("form")
-#          setTimeout ( -> $(event.target).blur() ), 0
-#          setTimeout ( -> form_tag.submit() ), 100
     $(".field input").each ->
       register_field this
     if $(".field_with_errors").length

#   window.prompt "Cash given (in EUR):"
#   bind_overlay_hotkeys()

mark_error = (element) ->
  play_error_sound()
  element.parent().addClass "field_with_errors"
  # deactivate blur handler of newly focused element ->
  # setTimeout() because this code here is executed _before_ the focus actually changes
  setTimeout (-> $(document.activeElement).off "blur"), 0
  # re-focus the currently focused element (will be unfocused right after this blur handler finishes)
  # ...and afterwards reinstall the blur handler of the intermediately focused element
  setTimeout( ( ->
      newly_focused_element = $(document.activeElement)
      setTimeout (-> newly_focused_element.blur input_blur_handler), 0
      element.focus() ),
    1 )

unmark_error = (element) ->
  element.parent().removeClass "field_with_errors"

  else
    !text.trim()

check_and_correct_field = (event, element, test_function, warn_function) ->
  # wrapper for pass-by-modifiable-reference
  new_val = val: element.val()
  correct = false
