     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


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

# Start action functions


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