   previousTab: (callback) -> selectTab(callback, "previous")
   firstTab: (callback) -> selectTab(callback, "first")
   lastTab: (callback) -> selectTab(callback, "last")
-  moveTabLeft: (callback) -> moveTab(callback, -1)
-  moveTabRight: (callback) -> moveTab(callback, 1)
   removeTab: ->
     chrome.tabs.getSelected(null, (tab) ->
       chrome.tabs.remove(tab.id))


moveTab = (callback, direction) ->
  chrome.tabs.getSelected(null, (tab) ->
    chrome.tabs.move(tab.id, {index: tab.index + direction }, callback))

# Start action functions


    chrome.tabs.getSelected(null, (tab) ->
      chrome.tabs.sendMessage(tab.id,
        { name: "toggleHelpDialog", dialogHtml: helpDialogHtml(), frameId:frameId }))
  moveTabLeft: (count) -> moveTab(null, -count)
  moveTabRight: (count) -> moveTab(null, count)
  nextFrame: (count) ->
    chrome.tabs.getSelected(null, (tab) ->
      frames = framesForTab[tab.id].frames
