
#= require jquery

#= require jquery_ujs

#=require ./popover

#= require jquery.superslides
#= require jquery.easing.1.3

$ ->
  
  resize = () ->
    
    $(".slider").each ->
      $(this).css({"width": $(this).parent().width()+"px"})
    
      height = ($(window).height())
      optimal_height = Math.round($(this).width()/ 1.9)
      if optimal_height < height
        height = optimal_height
  
      $(this).css({"height": height+"px"})
    
	  #$(".middle").css
    #  "min-height" : ($(window).height()-$(".top").height()-$(".bottom").height()-20)+"px"
  
  resize()
  $(window).on "resize", ->
    resize()
    
  $(".slider .slides").superslides
    inherit_width_from: ".slider"
    inherit_height_from: ".slider"
    play: 8000
    animation_speed: 800
    animation_easing: "swing"
  