
#= require jquery

#= require jquery_ujs

#=require ./popover


$ ->
  top = 0
  resize = () ->
    top = $(".sub_menu_bar").offset().top
	  $(".middle").css
      "min-height" : ($(window).height()-$(".top").height()-$(".bottom").height()-20)+"px"
  

  $(window).on "resize", ->
    resize()


  
  resize()
  
  
  $(document).on "scroll", ->
    scroll_ajust()
  
  $(document).on "touchmove", ->
    scroll_ajust()

  scroll_ajust = () ->
    var_scroll = $(window).scrollTop()
    if var_scroll > top
      $(".sub_menu_bar").addClass("move_top")
    else
      $(".sub_menu_bar").removeClass("move_top")
    
  
