       #                this.currentLeftMenuItem = s;
       #                this.notify('tabChange', s);
       #            }
-      #            
-      
-      #
-      #            // Unread change
-      #            var l = this.getInboxLink() || this.priorityInboxLink;
-      #            if((el[0] == l[0]) || isDescendant(el, l)) {
-      #                var newCount = this.numUnread();
-      #                if(this.currentNumUnread != newCount) {
-      #                    this.notify(@EVENT_UNREAD_CHANGE, newCount, this.currentNumUnread);
-      #                    this.currentNumUnread = newCount;
-      #                }
-      #            }
-      #            
+
+      newCount = @numUnread()
+      if @currentNumUnread isnt newCount
+          dbg "Unread count changed"
+          @notify @EVENT_UNREAD_CHANGE, newCount, @currentNumUnread
+          @currentNumUnread = newCount
+         
       if @elements.canvas.find(".ha").length > 0
         unless @inConversationView
           @inConversationView = true

            @notify @EVENT_INBOX_COUNT_CHANGE, toolbarCount, @currentInboxCount  if @currentInboxCount isnt null
            @currentInboxCount = toolbarCount


  Gmailr = new Gmailr

  window.Gmailr = Gmailr

    
    debug:                false
    priorityInboxLink:    null
    inboxLink:            null
    currentNumUnread:     null
    currentInboxCount:    null
    elements:             {}
