           @updateScreen 'artistList',@category,'#slideshow','slideshow',html
         @showSlide 0
         
-    @saveState type
+    @currentView = type
+    @saveState()
 
   updateScreen: (previousType, previousName, currentType, currentName, currentHtml) ->
     @hideAllViews()

  '#albumList .images .img click': (el) ->
    imageId = el.data 'id'
    @showSingleSlide imageId



  #- Dropbox -#
  
  setDraggable: (el) ->
    el.draggable {
      containment: 'document'
      helper: 'clone'
      zIndex: 100
      start: ->
        $("#dropbox .active").show()
      stop: ->
        $("#dropbox .active").hide()
    }
  
  loadDropbox: ->
    $("#dropbox .imagelist").html("")
    @showImageInDropbox id for id in @imageCookie.getAll() if @imageCookie.getAll()?
    
    $("#dropbox").droppable {
      drop: (ev, ui) =>
        id = ui.draggable.data('id')
        if not @imageCookie.contains id
          @imageCookie.add id
          @showImageInDropbox id
        else
          alert 'already here'
    }
        
  showImageInDropbox: (imageId, imageMeta) ->
    if imageMeta?
      $("#dropbox .imagelist").append @view('dropboximage',{ image: meta })
    else
      @model.getImage imageId, {}, @callback('showImageInDropbox',imageId)
  
  '#dropbox .cancel click': (el) -> #TODO: fix
    @imageCookie.clear()
    $("#dropbox .imagelist").html("")
  
  
  

      @showArtistList() if @category?
      @showAlbumList() if @artist?
      
      $("#dropbox").offset state.dropbox if state.dropbox
      
      log state.currentView
      
      @displayScreen state.currentView, null
      
      
  ## DROPBOX ##
  
  loadDropbox: ->
    $("#dropbox .imagelist").html("")
    @showImageInDropbox id for id in @imageCookie.getAll() if @imageCookie.getAll()?

    $("#dropbox").droppable {
      drop: (ev, ui) =>
        id = ui.draggable.data('id')
        if not @imageCookie.contains id
          @imageCookie.add id
          @showImageInDropbox id
        else
          alert 'already here'
    }
    $("#dropbox").draggable {
      stop: =>
        @saveState()
    }

  showImageInDropbox: (imageId, imageMeta) ->
    if imageMeta?
      $("#dropbox .imagelist").append @view('dropboximage',{ image: imageMeta })
    else
      @model.getImage imageId, {}, @callback('showImageInDropbox', imageId)  
      
  '#dropbox .cancel click': (el) -> #TODO: fix
    @imageCookie.clear()
    $("#dropbox .imagelist").html("")

  setDraggable: (el) ->
    el.draggable {
      containment: 'document'
      helper: 'clone'
      zIndex: 100
      start: ->
        $("#dropbox .active").show()
      stop: ->
        $("#dropbox .active").hide()
    }   
      
  
  ## GENERAL DISPLAY
  
