       right: 0
     .animate(
       right: -320
-    , speed
+    , speed, =>
+      @frame.hide()
     )
     
     @trigger.removeClass('active')
     @active = false
+
+  preSeed: (path) ->
+    @seeded = true
     
   clearNotifications: =>
     $.cookie "dashboard:notifications:#{@name}", 0, 

    .submit () =>
      @validateInput()
      
  show: (speed) ->
    super speed
    if @chat_container
      unless @seeded
        @preSeed()
        @seeded = true
      @correctWindow(true)
      
  preSeed: =>
    @seeded = true
    @frame.append("<div class='shader' />")
    $.getJSON "/chat/messages", (data) =>
      i = data.length - 1
      $.each data, (key, val) =>
        @chat_container.prepend("<div timestamp='#{val.timestamp}'class='message'><h5 class='sender'>#{val.sender}</h5><p class='content'>#{val.content}</p></div>")
        @correctWindow(true)
        if key == i
          window.setTimeout ( =>
            @correctWindow(true)
          ), 500
  
  resizeElements: () ->
    window.setTimeout ( =>

    if readyForCorrection
      @chat_container.scrollTop(@chat_container[0].scrollHeight)      
      
  addMessage: (timestamp,sender,content) ->
    readyForCorrection = @isReadingHistory()
    t = new Date(Date._parse(timestamp))
    @chat_container.append(
      "<div timestamp='#{timestamp}'class='message'>
      <h5 class='sender'>#{sender}<span class='time'>#{t.toString('HH:mm:ss')}</span></h5>
      <p class='content'>#{content}</p></div>")
    @correctWindow(readyForCorrection)
    @addNotification()
    
  validateInput: () ->
    if (@chat_input.attr('value').match(/^\s*$/) == null) and (@chat_input.val.length > 0)
