@payment_form = (element) ->
  if element.attr('checked') == "checked"
    element.closest(".field").find(".payment_form").hide()
  else
    element.closest(".field").find(".payment_form").show()
	
@check_form = (element) ->
  if element.val() is "1"
    element.closest(".field").find(".check_form").show()
  else
    element.closest(".field").find(".check_form").hide()
	
	
$(document).ready ->
	
	if $("#sheets_chart").length > 0
		Morris.Line
			element: 'sheets_chart'
			data: $('#sheets_chart').data('values')
			xkey: 'y'
			ykeys: ['foyers', 'familles', 'associations',"individuel", "bienfaiteurs", "pouvoirs"]
			labels: ['Foyers', 'Familles', 'Associations',"Individuel", "Bienfaiteurs", "Pouvoirs"]
			lineColors: ["#FF9900", "#4942CC", "#008000", "#FF45A3", "#DC3912", "#4684EE"]
			parseTime:false

