 
   # Respond to conditional inputs - click events
   $(".reveal-next-input").click (e) ->
-    console.log "showing hidden input"
     changeFocusDirect($(this), $(this).nextAll('.hidden-input'))
 
 


  # Submit a survey answer
  @submitAnswer = (questionForm) ->
    console.log questionForm
    console.log questionForm.serialize()
    console.log questionForm.attr("action")
    $.post(questionForm.attr("action"), questionForm.serialize(), (data) ->
      console.log data
    , 'json')

  # Respond to user clicking different questions

  # Scroll to active question
  @nextQuestionScroll = (element1, element2) ->
    # Submit Previous Question
    submitAnswer(element1)
    if element2 is null
      return
    else
      # Check for multiple questions, and position the first question in the center
      if element2.find('.current').length > 0
        currentHeight = element2.find('.current').offset().top
        elementOffsetHeight = element2.find('.current').outerHeight() / 2
      else
        currentHeight = element2.offset().top
        elementOffsetHeight = element2.outerHeight() / 2
      offsetHeight = $(window).outerHeight() / 2
      # Check for large questions on small screens
      if elementOffsetHeight > offsetHeight
        newHeight = currentHeight - 91
      else
        newHeight = currentHeight - offsetHeight + elementOffsetHeight
      $("body").animate
        scrollTop: newHeight
      , 400
      , "swing"
      , ->
        changeFocus(element1, element2)
        return

  # Change focus
  @changeFocus = (question1, question2) ->
