#= require jquery
#= require jquery_ujs

#= require bootstrap

#= require ./shared/jquery.backstretch.js

@flash_delay = ->
  $("#flashs").find(".alert").each ->
    
    if !$(this).hasClass("delay")
      $(this).addClass("delay")
      $(this).delay(3000).fadeOut();
    
$ ->
  flash_delay();
  
  $.backstretch("/login_background5.jpg")
  
place = ->
  margin = ($(window).height() - ($(".form-signin").outerHeight()+60) )/ 2 
  
  $(".form-signin").css("margin-top" : margin+"px")
  

$(document).ready ->
  place();
  $(".form-signin").hide()
  $(".form-signin").css("opacity",1 )
  $(".form-signin").fadeIn(1500)
  $(window).on "resize", ->
    place();