-$(document).ready ->
+initPage = ->
   if $(".toggle-container").length
     $(".toggle-container").hide()
     $(".box-toggle").on "click", ".trigger", (e) ->

      notification.html($(this).html())

      notification.click ->
        console.log $(this).height()
        console.log bar.height()
        bar.animate({
          'height': "#{bar.height() - $(this).height() - 7}px"
        }, 'fast', 'linear', ->

      self.toggleClass("active").next().stop(true, true).slideToggle "slow"
      e.preventDefault()

  $('.datepicker').datepicker()

  notifications = $('body').find($('.flash_notification'))
  if notifications.length > 0
    bar = $('<ul id="notifications-bar" class="container"></ul>')
