+$imagesContainer = $('#images')
+$modalContainer = $('#gallery-modal')
+
 window.tmpl = (id) ->
   if id is 'template-upload'
     return (data) -> JST['templates/file'](data)

hasher.init()

$ ->
  $('#toggle_selection').click (e) ->
    e.preventDefault()
    if $(this).hasClass('active')


  $modalContainer.data 'gallery', gallery

handleHashChange = (newHash) ->
  if imageId = newHash.match(/images\/(\d+)/)?[1]
    newIndex = $("#image_#{imageId}").index('.image a')
