$(document).ready ->

	#show first question
	$("#claims.question").show()

	#progression of the form
	$("form .navButtons button").click ->
		navButtons = $(this).parent(".navButtons")
		step = navButtons.attr("id")
		active = $("li.question.active")
		active.hide().removeClass("active")

		if $(this).hasClass("next")
			if step == "9" 
				navButtons.find('.next').hide()
				navButtons.find('.submit').show()

			if step == "1"
				navButtons.find('.previous').addClass('active').prop('disabled', false)

			step = parseInt(step) + 1
			navButtons.attr("id", step)
			current = active.next(".question")
			current.show().addClass("active")
		else if $(this).hasClass("previous")
			if step == "10" 
				navButtons.find('.next').show()
				navButtons.find('.submit').hide()

			if step == "2"
				navButtons.find('.previous').removeClass('active').prop('disabled', true)

			step = parseInt(step) - 1
			navButtons.attr("id", step)
			current = active.prev(".question")
			current.show().addClass("active")






