#= require jquery
#= require jquery_ujs
#= require_tree .


resize = () ->
  $(".electrolux2_img .img").css("padding-top", ($(".electrolux2_img").height() - $(".electrolux2_img img").height())/ 2)
  $(".miele_img .img").css("padding-top", ($(".miele_img").height() - $(".miele_img img").height())/ 2)
  $(".gold_img .img").css("padding-top", ($(".gold_img").height() - $(".gold_img img").height())/ 2)
  
  $(".with_ratio").each ->
    ratio = parseFloat($(this).data("ratio"))
    height = $(this).width()*ratio
    
    $(this).css("height",height+"px")
  
  
  #$(".panels").css("top", ($(window).height() - $(".row").height())/ 2)
  
$ ->
  resize()
  $(window).bind "resize", ->
    resize()
  
  $(".electrolux2, .miele, .gold").click (event) ->
    window.location.href = $(this).find("a:first").attr("href")
    