<?xml version="1.0"?>


<?xml-stylesheet href="chrome://messenger/skin/folderMenus.css" type="text/css"?>

<!-- Overlaying utilityOverlay.xul here is a temporary band-aid for a
     hard-to-reproduce problem where File, Edit, and View menus disappear on
     Mac when certain add-ons are installed (bug 398702).  Work to find a
     better fix is ongoing.  Ultimately, utilityOverlay.xul wants to
     disappear from Thunderbird entirely (bug 359748). -->
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>

<?xul-overlay href="chrome://communicator/content/charsetOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/macMenuOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/baseMenuOverlay.xul"?>

<!DOCTYPE overlay [
  <!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd">
  %messengerDTD;
  <!ENTITY % msgViewPickerDTD SYSTEM "chrome://messenger/locale/msgViewPickerOverlay.dtd" >
  %msgViewPickerDTD;
  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
  %brandDTD;
  <!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd">
  %textcontextDTD;
  <!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://messenger/locale/baseMenuOverlay.dtd">
  %baseMenuOverlayDTD;
  <!ENTITY % utilityDTD SYSTEM "chrome://communicator/locale/utilityOverlay.dtd">
  %utilityDTD;
  <!ENTITY % charsetDTD SYSTEM "chrome://global/locale/charsetMenu.dtd">
  %charsetDTD;
  <!ENTITY % viewZoomOverlayDTD SYSTEM "chrome://messenger/locale/viewZoomOverlay.dtd">
  %viewZoomOverlayDTD;
]>

<overlay  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/javascript" src="chrome://messenger/content/mailCommands.js"/>
<script type="application/javascript" src="chrome://messenger/content/junkCommands.js"/>
<script type="application/javascript" src="chrome://messenger/content/mailWindowOverlay.js"/>
<script type="application/javascript" src="chrome://messenger/content/mailTabs.js"/>
<script type="application/javascript" src="chrome://messenger/content/messageDisplay.js"/>
<script type="application/javascript" src="chrome://messenger/content/folderDisplay.js"/>
<script type="application/javascript" src="chrome://messenger-newsblog/content/newsblogOverlay.js"/>
<script type="application/javascript" src="chrome://messenger/content/mail-offline.js"/>
<script type="application/javascript" src="chrome://global/content/printUtils.js"/>
<script type="application/javascript" src="chrome://messenger/content/msgViewPickerOverlay.js"/>
<script type="application/javascript" src="chrome://messenger/content/plugins.js"/>
<script type="application/javascript" src="chrome://global/content/viewZoomOverlay.js"/>
<script type="application/javascript" src="chrome://messenger/content/newmailaccount/uriListener.js"/>

<stringbundleset id="stringbundleset">
  <stringbundle id="brand_bundle" src="chrome://branding/locale/brand.properties"/>
  <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
  <stringbundle id="bundle_offlinePrompts" src="chrome://messenger/locale/offline.properties"/>
</stringbundleset>

<!-- Performance optimization...we include utilityOverlay.xul which defines some command sets
     which are updated based on events like focus and select. We have our own custom events
     which we use to optmize when we do command updating. To avoid unnecessary command updating,
     we are going to override the events the global edit menu items and select edit menu items
     are updated on with events of our own controlling.
 -->

<commandset id="globalEditMenuItems"
            commandupdater="true"
            events="create-menu-edit"
            oncommandupdate="goUpdateGlobalEditMenuItems()"/>
<commandset id="selectEditMenuItems"
            commandupdater="true"
            events="create-menu-edit"
            oncommandupdate="goUpdateSelectEditMenuItems()"/>

<!-- End command set merging -->

<commandset id="mailFileMenuItems"
            commandupdater="true"
            events="create-menu-file"
            oncommandupdate="goUpdateMailMenuItems(this)">

    <command id="cmd_getNewMessages" oncommand="goDoCommand('cmd_getNewMessages')" disabled="true"/>
    <command id="cmd_open" oncommand="goDoCommand('cmd_open')"/>

    <command id="cmd_emptyTrash" oncommand="goDoCommand('cmd_emptyTrash')" disabled="true"/>
    <command id="cmd_compactFolder" oncommand="goDoCommand('cmd_compactFolder')" disabled="true"/>
    <command id="cmd_printSetup" oncommand="goDoCommand('cmd_printSetup')" disabled="true"/>
    <command id="cmd_print" oncommand="goDoCommand('cmd_print')" disabled="true"/>
    <command id="cmd_printpreview" oncommand="goDoCommand('cmd_printpreview')" disabled="true"/>
    <command id="cmd_saveAsFile" oncommand="goDoCommand('cmd_saveAsFile')" disabled="true"/>
    <command id="cmd_saveAsTemplate" oncommand="goDoCommand('cmd_saveAsTemplate')" disabled="true"/>
    <command id="cmd_getNextNMessages" oncommand="goDoCommand('cmd_getNextNMessages')" disabled="true"/>
    <command id="cmd_deleteFolder" oncommand="goDoCommand('cmd_deleteFolder')"/>
    <command id="cmd_renameFolder" oncommand="goDoCommand('cmd_renameFolder')" />
    <command id="cmd_sendUnsentMsgs" oncommand="goDoCommand('cmd_sendUnsentMsgs')" />
    <command id="cmd_synchronizeOffline" oncommand="goDoCommand('cmd_synchronizeOffline')" disabled="true"/>
    <command id="cmd_downloadFlagged" oncommand="goDoCommand('cmd_downloadFlagged')" disabled="true"/>
    <command id="cmd_downloadSelected" oncommand="goDoCommand('cmd_downloadSelected')" disabled="true"/>
    <command id="cmd_settingsOffline" oncommand="goDoCommand('cmd_settingsOffline')" disabled="true"/>
</commandset>

<commandset id="mailCommands">
  <command id="cmd_quit"/>
  <!--The cmd_createFilterFromPopup is used to notify the email context popup -->
  <command id="cmd_createFilterFromPopup"/>
  <command id="cmd_pageSetup"/>
  <command id="cmd_CustomizeMailToolbar"
           oncommand="CustomizeMailToolbar('mail-toolbox', 'CustomizeMailToolbar')"/>
</commandset>

<commandset id="mailViewMenuItems"
            commandupdater="true"
            events="create-menu-view"
            oncommandupdate="goUpdateMailMenuItems(this)">

   <command id="cmd_viewPageSource" oncommand="goDoCommand('cmd_viewPageSource')" disabled="true"/>
   <command id="cmd_setFolderCharset" oncommand="goDoCommand('cmd_setFolderCharset')" />

   <command id="cmd_expandAllThreads" oncommand="goDoCommand('cmd_expandAllThreads')" disabled="true"/>
   <command id="cmd_collapseAllThreads" oncommand="goDoCommand('cmd_collapseAllThreads')" disabled="true"/>
   <command id="cmd_viewClassicMailLayout" oncommand="goDoCommand('cmd_viewClassicMailLayout')" disabled="true"/>
   <command id="cmd_viewWideMailLayout" oncommand="goDoCommand('cmd_viewWideMailLayout')" disabled="true"/>
   <command id="cmd_viewVerticalMailLayout" oncommand="goDoCommand('cmd_viewVerticalMailLayout')" disabled="true"/>
   <command id="cmd_toggleFolderPane" oncommand="goDoCommand('cmd_toggleFolderPane')" disabled="true"/>
   <command id="cmd_toggleMessagePane" oncommand="goDoCommand('cmd_toggleMessagePane')" disabled="true"/>
   <command id="cmd_viewAllMsgs" oncommand="goDoCommand('cmd_viewAllMsgs')" disabled="true"/>
   <command id="cmd_viewUnreadMsgs" oncommand="goDoCommand('cmd_viewUnreadMsgs')" disabled="true"/>
   <command id="cmd_viewThreadsWithUnread" oncommand="goDoCommand('cmd_viewThreadsWithUnread')" disabled="true"/>
   <command id="cmd_viewWatchedThreadsWithUnread" oncommand="goDoCommand('cmd_viewWatchedThreadsWithUnread')" disabled="true"/>
   <command id="cmd_viewIgnoredThreads" oncommand="goDoCommand('cmd_viewIgnoredThreads')" disabled="true"/>
   <commandset id="viewZoomCommands"
               commandupdater="true"
               events="create-menu-view"
               oncommandupdate="goUpdateMailMenuItems(this);">
     <command id="cmd_fullZoomReduce"
              oncommand="goDoCommand('cmd_fullZoomReduce');"/>
     <command id="cmd_fullZoomEnlarge"
              oncommand="goDoCommand('cmd_fullZoomEnlarge');"/>
     <command id="cmd_fullZoomReset"
              oncommand="goDoCommand('cmd_fullZoomReset');"/>
     <command id="cmd_fullZoomToggle"
              oncommand="goDoCommand('cmd_fullZoomToggle');"/>
   </commandset>
</commandset>

<commandset id="mailEditMenuItems"
            commandupdater="true"
            events="create-menu-edit"
            oncommandupdate="goUpdateMailMenuItems(this)">

  <command id="cmd_undo"
         valueDeleteMsg="&undoDeleteMsgCmd.label;"
         valueMoveMsg="&undoMoveMsgCmd.label;"
         valueCopyMsg="&undoCopyMsgCmd.label;"
         valueUnmarkAllMsgs="&undoMarkAllCmd.label;"
         valueDefault="&undoDefaultCmd.label;"/>
  <command id="cmd_redo"
         valueDeleteMsg="&redoDeleteMsgCmd.label;"
         valueMoveMsg="&redoMoveMsgCmd.label;"
         valueCopyMsg="&redoCopyMsgCmd.label;"
         valueUnmarkAllMsgs="&redoMarkAllCmd.label;"
         valueDefault="&redoDefaultCmd.label;"/>
  <command id="cmd_cut"/>
  <command id="cmd_copy"/>
  <command id="cmd_paste"/>
  <command id="cmd_delete"
         valueFolder="&deleteFolderCmd.label;"
         valueFolderAccessKey="&deleteFolderCmd.accesskey;"
         valueNewsgroup="&unsubscribeNewsgroupCmd.label;"
         valueNewsgroupAccessKey="&unsubscribeNewsgroupCmd.accesskey;"
         valueMessage="&deleteMsgCmd.label;"
         valueMessageAccessKey="&deleteMsgCmd.accesskey;"
         valueIMAPDeletedMessage="&undeleteMsgCmd.label;"
         valueIMAPDeletedMessageAccessKey="&undeleteMsgCmd.accesskey;"
         valueMessages="&deleteMsgsCmd.label;"
         valueMessagesAccessKey="&deleteMsgsCmd.accesskey;"
         valueIMAPDeletedMessages="&undeleteMsgsCmd.label;"
         valueIMAPDeletedMessagesAccessKey="&undeleteMsgsCmd.accesskey;"/>
  <command id="cmd_cancel" oncommand="goDoCommand('cmd_cancel')"/>
  <command id="cmd_selectAll"/>
  <command id="cmd_selectThread" oncommand="goDoCommand('cmd_selectThread')"/>
  <command id="cmd_selectFlagged" oncommand="goDoCommand('cmd_selectFlagged')"/>
  <command id="cmd_properties" oncommand="goDoCommand('cmd_properties')"
         valueNewsgroup="&folderPropsNewsgroupCmd2.label;"
         valueFolder="&folderPropsFolderCmd2.label;"
         valueGeneric="&folderPropsCmd2.label;"/>
  <command id="cmd_find" oncommand="goDoCommand('cmd_find')" disabled="true"/>
  <command id="cmd_findAgain" oncommand="goDoCommand('cmd_findAgain')" disabled="true"/>
  <command id="cmd_findPrevious" oncommand="goDoCommand('cmd_findPrevious')"
           disabled="true"/>
  <command id="cmd_search" oncommand="goDoCommand('cmd_search')"/>
  <!-- Stop/abort current network activities. -->
  <command id="cmd_stop" oncommand="goDoCommand('cmd_stop')"/>
  <command id="cmd_reload" oncommand="goDoCommand('cmd_reload')"/>
</commandset>

<commandset id="mailEditContextMenuItems">
  <command id="cmd_copyLink"/>
  <command id="cmd_copyImage"/>
</commandset>

<commandset id="mailGoMenuItems"
            commandupdater="true"
            events="create-menu-go"
            oncommandupdate="goUpdateMailMenuItems(this)">

  <command id="cmd_nextMsg" oncommand="goDoCommand('cmd_nextMsg')" disabled="true"/>
  <command id="cmd_nextUnreadMsg" oncommand="goDoCommand('cmd_nextUnreadMsg')" disabled="true"/>
  <command id="cmd_nextFlaggedMsg" oncommand="goDoCommand('cmd_nextFlaggedMsg')" disabled="true"/>
  <command id="cmd_nextUnreadThread" oncommand="goDoCommand('cmd_nextUnreadThread')" disabled="true"/>
  <command id="cmd_previousMsg" oncommand="goDoCommand('cmd_previousMsg')" disabled="true"/>
  <command id="cmd_previousUnreadMsg" oncommand="goDoCommand('cmd_previousUnreadMsg')" disabled="true"/>
  <command id="cmd_previousFlaggedMsg" oncommand="goDoCommand('cmd_previousFlaggedMsg')" disabled="true"/>
  <command id="cmd_goStartPage" oncommand="goDoCommand('cmd_goStartPage');"/>
  <command id="cmd_undoCloseTab" oncommand="goDoCommand('cmd_undoCloseTab');"/> 
  <command id="cmd_goForward" oncommand="goDoCommand('cmd_goForward')" disabled="true"/>
  <command id="cmd_goBack" oncommand="goDoCommand('cmd_goBack')" disabled="true"/>
  <command id="cmd_chat" oncommand="goDoCommand('cmd_chat')" disabled="true"/>
</commandset>

<commandset id="mailMessageMenuItems"
            commandupdater="true"
            events="create-menu-message"
            oncommandupdate="goUpdateMailMenuItems(this)">
  <command id="cmd_archive" oncommand="goDoCommand('cmd_archive')"/>
  <command id="cmd_newMessage" oncommand="MsgNewMessage(event)"/>
  <command id="cmd_reply" oncommand="MsgReplyMessage(event)"/>
  <command id="cmd_replySender" oncommand="MsgReplySender(event);"/>
  <command id="cmd_replyGroup" oncommand="MsgReplyGroup(event);"/>
  <command id="cmd_replyall" oncommand="MsgReplyToAllMessage(event);"/>
  <command id="cmd_replylist" oncommand="MsgReplyToListMessage(event);"/>
  <command id="cmd_forward" oncommand="MsgForwardMessage(event);"/>
  <command id="cmd_forwardInline" oncommand="MsgForwardAsInline(event)"/>
  <command id="cmd_forwardAttachment" oncommand="MsgForwardAsAttachment(event);"/>
  <command id="cmd_editAsNew" oncommand="goDoCommand('cmd_editAsNew')"/>
  <command id="cmd_openMessage" oncommand="goDoCommand('cmd_openMessage')"/>
  <command id="cmd_openConversation" oncommand="goDoCommand('cmd_openConversation')"/>
  <command id="cmd_moveToFolderAgain" oncommand="goDoCommand('cmd_moveToFolderAgain')"/>
  <command id="cmd_createFilterFromMenu" oncommand="goDoCommand('cmd_createFilterFromMenu')"/>
  <command id="cmd_killThread" oncommand="goDoCommand('cmd_killThread')"/>
  <command id="cmd_killSubthread" oncommand="goDoCommand('cmd_killSubthread')"/>
  <command id="cmd_watchThread" oncommand="goDoCommand('cmd_watchThread')"/>
</commandset>

<commandset id="mailToolbarItems"
            commandupdater="true"
            events="mail-toolbar"
            oncommandupdate="goUpdateMailMenuItems(this)">
  <command id="button_reply"/>
  <command id="button_replyall"/>
  <command id="button_replylist"/>
  <command id="button_followup"/>
  <command id="button_archive"/>
  <command id="button_forward"/>
  <command id="button_delete"/>
  <command id="button_mark"/>
  <command id="cmd_tag"/>
  <command id="button_getNewMessages"/>
  <command id="button_print"/>
  <command id="button_previous"/>
  <command id="button_previousMsg"/>
  <command id="button_next"/>
  <command id="button_nextMsg"/>
  <command id="button_goBack"/>
  <command id="button_goForward"/>
  <command id="button_file"/>
  <command id="cmd_delete"/>
  <command id="button_junk"/>
  <command id="button_compact"/>
  <command id="cmd_chat"/>
</commandset>

<commandset id="mailGetMsgMenuItems"
            commandupdater="true"
            events="create-menu-getMsgToolbar,create-menu-file"
            oncommandupdate="goUpdateMailMenuItems(this)">

    <command id="cmd_getMsgsForAuthAccounts"
             oncommand="goDoCommand('cmd_getMsgsForAuthAccounts'); event.stopPropagation()"
             disabled="true"/>
</commandset>

<commandset id="mailMarkMenuItems"
              commandupdater="true"
              events="create-menu-mark"
              oncommandupdate="goUpdateMailMenuItems(this)">

    <command id="cmd_toggleRead" oncommand="goDoCommand('cmd_toggleRead'); event.stopPropagation()" disabled="true"/>
    <command id="cmd_markAsRead" oncommand="goDoCommand('cmd_markAsRead'); event.stopPropagation()" disabled="true"/>
    <command id="cmd_markAsUnread" oncommand="goDoCommand('cmd_markAsUnread'); event.stopPropagation()" disabled="true"/>
    <command id="cmd_markAllRead" oncommand="goDoCommand('cmd_markAllRead'); event.stopPropagation()" disabled="true"/>
    <command id="cmd_markThreadAsRead" oncommand="goDoCommand('cmd_markThreadAsRead'); event.stopPropagation()" disabled="true"/>
    <command id="cmd_markReadByDate" oncommand="goDoCommand('cmd_markReadByDate');" disabled="true"/>
    <command id="cmd_markAsFlagged" oncommand="goDoCommand('cmd_markAsFlagged'); event.stopPropagation()" disabled="true"/>
    <command id="cmd_markAsJunk" oncommand="goDoCommand('cmd_markAsJunk'); event.stopPropagation()" disabled="true"/>
    <command id="cmd_markAsNotJunk" oncommand="goDoCommand('cmd_markAsNotJunk'); event.stopPropagation()" disabled="true"/>
    <command id="cmd_recalculateJunkScore" oncommand="goDoCommand('cmd_recalculateJunkScore');" disabled="true"/>
    <command id="cmd_viewAllHeader" oncommand="goDoCommand('cmd_viewAllHeader');" disabled="true"/>
    <command id="cmd_viewNormalHeader" oncommand="goDoCommand('cmd_viewNormalHeader');" disabled="true"/>
</commandset>

<commandset id="mailTagMenuItems"
            commandupdater="true"
            events="create-menu-tag"
            oncommandupdate="goUpdateMailMenuItems(this);">

    <command id="cmd_addTag" oncommand="goDoCommand('cmd_addTag'); event.stopPropagation();"/>
    <command id="cmd_manageTags" oncommand="goDoCommand('cmd_manageTags'); event.stopPropagation();"/>
    <command id="cmd_removeTags" oncommand="goDoCommand('cmd_removeTags'); event.stopPropagation();"/>
</commandset>

<commandset id="mailToolsMenuItems"
              commandupdater="true"
              events="create-menu-tasks"
              oncommandupdate="goUpdateMailMenuItems(this)">
  <command id="cmd_displayMsgFilters"
           oncommand="goDoCommand('cmd_displayMsgFilters');" disabled="true"/>
  <command id="cmd_applyFilters" oncommand="goDoCommand('cmd_applyFilters');" disabled="true"/>
  <command id="cmd_applyFiltersToSelection"
           oncommand="goDoCommand('cmd_applyFiltersToSelection');"
           disabled="true"
           valueSelection="&filtersApplyToSelection.label;"
           valueSelectionAccessKey="&filtersApplyToSelection.accesskey;"
           valueMessage="&filtersApplyToMessage.label;"
           valueMessageAccessKey="&filtersApplyToMessage.accesskey;"/>
  <command id="cmd_runJunkControls" oncommand="goDoCommand('cmd_runJunkControls');" disabled="true"/>
  <command id="cmd_deleteJunk" oncommand="goDoCommand('cmd_deleteJunk');" disabled="true"/>
</commandset>

<commandset id="macWindowMenuItems">
  <!-- Mac Window menu -->
  <command id="minimizeWindow" label="&minimizeWindow.label;" oncommand="window.minimize();"/>
  <command id="zoomWindow" label="&zoomWindow.label;" oncommand="zoomWindow();"/>
  <command id="Tasks:Mail" oncommand="focusOnMail(1);"/>
  <command id="Tasks:AddressBook" oncommand="toAddressBook();"/>
</commandset>

<keyset id="mailKeys">
  <key id="space" key=" " modifiers="shift any" oncommand="SpaceHit(event);"/>

  <!-- File Menu -->
  <key id="key_close"/>
  <key id="key_quit"/>
  <!-- Edit Menu -->
  <key id="key_undo"/>
  <key id="key_redo"/>
  <key id="key_cut"/>
  <key id="key_copy"/>
  <key id="key_paste"/>
  <key id="key_delete" keycode="VK_BACK"
       oncommand="goDoCommand('cmd_delete');"/>
  <key id="key_delete2" keycode="VK_DELETE"
       oncommand="goDoCommand('cmd_delete');"/>
  <key id="cmd_shiftDelete" keycode="VK_BACK"
       oncommand="goDoCommand('cmd_shiftDelete');" modifiers="shift"/>
  <key id="cmd_shiftDelete2" keycode="VK_DELETE"
       oncommand="goDoCommand('cmd_shiftDelete');" modifiers="shift"/>
  <key id="key_selectAll"/>
  <key id="key_selectThread" key="&selectThreadCmd.key;"             oncommand="goDoCommand('cmd_selectThread');" modifiers="accel, shift"/>

  <key id="key_toggleRead" key="&toggleReadCmd.key;"                 oncommand="goDoCommand('cmd_toggleRead');"/>
  <key id="key_toggleFlagged" key="&markStarredCmd.key;"             oncommand="goDoCommand('cmd_markAsFlagged');"/>
  <key id="key_markJunk" key="&markAsJunkCmd.key;"                   oncommand="goDoCommand('cmd_markAsJunk');"/>
  <key id="key_markNotJunk" key="&markAsNotJunkCmd.key;"             oncommand="goDoCommand('cmd_markAsNotJunk');"
       modifiers="shift"/>

  <key id="key_markAllRead" key="&markAllReadCmd.key;"
       oncommand="goDoCommand('cmd_markAllRead');" modifiers="shift"/>

  <key id="key_markThreadAsRead" key="&markThreadAsReadCmd.key;"     oncommand="goDoCommand('cmd_markThreadAsRead')"/>
  <key id="key_markReadByDate" key="&markReadByDateCmd.key;"         oncommand="goDoCommand('cmd_markReadByDate')"/>
  <key id="key_nextMsg" key="&nextMsgCmd.key;"                       oncommand="goDoCommand('cmd_nextMsg')"/>
  <key id="key_nextUnreadMsg" key="&nextUnreadMsgCmd.key;"           oncommand="goDoCommand('cmd_nextUnreadMsg')"/>
  <key id="key_expandAllThreads" key="&expandAllThreadsCmd.key;"     oncommand="goDoCommand('cmd_expandAllThreads')"/>
  <key key="&expandAllThreadsCmd.key;" modifiers="shift"             oncommand="goDoCommand('cmd_expandAllThreads')"/>
  <key id="key_collapseAllThreads" key="&collapseAllThreadsCmd.key;" oncommand="goDoCommand('cmd_collapseAllThreads')"/>
  <key key="&collapseAllThreadsCmd.key;" modifiers="shift"           oncommand="goDoCommand('cmd_collapseAllThreads')"/>
  <key id="key_nextUnreadThread" key="&nextUnreadThread.key;"        oncommand="goDoCommand('cmd_nextUnreadThread')"/>
  <key id="key_previousMsg" key="&prevMsgCmd.key;"                   oncommand="goDoCommand('cmd_previousMsg')"/>
  <key id="key_previousUnreadMsg" key="&prevUnreadMsgCmd.key;"       oncommand="goDoCommand('cmd_previousUnreadMsg')"/>
  <key id="key_archive" key="&archiveMsgCmd.key;"                    oncommand="goDoCommand('cmd_archive')"/>
  <key id="key_goForward" key="&goForwardCmd.commandKey;"            oncommand="goDoCommand('cmd_goForward')"/>
  <key id="key_goBack" key="&goBackCmd.commandKey;"                  oncommand="goDoCommand('cmd_goBack')"/>
  <key id="key_goChat" key="&goChatCmd.key;"                         oncommand="goDoCommand('cmd_chat')" modifiers="accel,shift"/>
  <key id="key_goStartPage" keycode="VK_HOME"                        oncommand="goDoCommand('cmd_goStartPage')" modifiers="alt"/>
  <key id="key_undoCloseTab" key="&undoCloseTabCmd.commandkey;"      oncommand="goDoCommand('cmd_undoCloseTab')" modifiers="accel, shift"/> 
  <key id="key_reply" key="&replyMsgCmd.key;"                        oncommand="goDoCommand('cmd_reply')" modifiers="accel"/>
  <key id="key_replyall" key="&replyToAllMsgCmd.key;"                oncommand="goDoCommand('cmd_replyall')" modifiers="accel, shift"/>
  <key id="key_replylist" key="&replyToListMsgCmd.key;"              oncommand="goDoCommand('cmd_replylist')" modifiers="accel, shift"/>
  <key id="key_forward" key="&forwardMsgCmd.key;"                    oncommand="goDoCommand('cmd_forward')" modifiers="accel"/>
  <key id="key_editAsNew" key="&editAsNewMsgCmd.key;"                oncommand="goDoCommand('cmd_editAsNew')" modifiers="accel"/>
  <key id="key_watchThread" key="&watchThreadMenu.key;"              oncommand="goDoCommand('cmd_watchThread')" />
  <key id="key_killThread" key="&killThreadMenu.key;"                oncommand="goDoCommand('cmd_killThread')" />
  <key id="key_killSubthread" key="&killSubthreadMenu.key;"          oncommand="goDoCommand('cmd_killSubthread')" modifiers="shift" />
  <key id="key_openMessage" key="&openMessageWindowCmd.key;"         oncommand="goDoCommand('cmd_openMessage')" modifiers="accel"/>
  <key id="key_openConversation" key="&openConversationCmd.key;"     oncommand="goDoCommand('cmd_openConversation')" modifiers="accel, shift"/>
  <key id="key_moveToFolderAgain" key="&moveToFolderAgainCmd.key;"   oncommand="goDoCommand('cmd_moveToFolderAgain')" modifiers="alt, accel"/>
  <key id="key_print" key="&printCmd.key;"                           oncommand="goDoCommand('cmd_print')" modifiers="accel"/>
  <key id="key_saveAsFile" key="&saveAsFileCmd.key;"                 oncommand="goDoCommand('cmd_saveAsFile')" modifiers="accel"/>
  <key id="key_viewPageSource" key="&pageSourceCmd.key;"             oncommand="goDoCommand('cmd_viewPageSource')" modifiers="accel"/>
  <key id="key_getNewMessagesAlt" keycode="VK_F5"
       oncommand="goDoCommand('cmd_getNewMessages');"/>
  <key id="key_getAllNewMessagesAlt" keycode="VK_F5" modifiers="shift"
       oncommand="goDoCommand('cmd_getMsgsForAuthAccounts');"/>
  <key id="key_getNewMessages" key="&getNewMessagesCmd.key;" modifiers="accel"
       oncommand="goDoCommand('cmd_getNewMessages');"/>
  <key id="key_getAllNewMessages" key="&getAllNewMessagesCmd.key;" modifiers="accel, shift"
       oncommand="goDoCommand('cmd_getMsgsForAuthAccounts');"/>
  <key id="key_find" key="&findCmd.key;"  oncommand="goDoCommand('cmd_find')" modifiers="accel"/>
  <key id="key_findAgain" key="&findAgainCmd.key;"   oncommand="goDoCommand('cmd_findAgain')" modifiers="accel"/>
  <key id="key_findPrev"  key="&findPrevCmd.key;"    oncommand="goDoCommand('cmd_findPrevious')"  modifiers="accel, shift"/>
  <key keycode="&findAgainCmd.key2;"   oncommand="goDoCommand('cmd_findAgain')"/>
  <key keycode="&findPrevCmd.key2;"    oncommand="goDoCommand('cmd_findPrevious')"  modifiers="shift"/>
  <key id="key_quickSearchFocus" key="&quickSearchCmd.key;"  oncommand="QuickSearchFocus()" modifiers="accel"/>

  <keyset id="viewZoomKeys">
    <key id="key_fullZoomReduce"  key="&fullZoomReduceCmd.commandkey;"
         command="cmd_fullZoomReduce"  modifiers="accel"/>
    <key                          key="&fullZoomReduceCmd.commandkey2;"
         command="cmd_fullZoomReduce"  modifiers="accel"/>
    <key id="key_fullZoomEnlarge" key="&fullZoomEnlargeCmd.commandkey;"
         command="cmd_fullZoomEnlarge" modifiers="accel"/>
    <key                          key="&fullZoomEnlargeCmd.commandkey2;"
         command="cmd_fullZoomEnlarge" modifiers="accel"/>
    <key                          key="&fullZoomEnlargeCmd.commandkey3;"
         command="cmd_fullZoomEnlarge" modifiers="accel"/>
    <key id="key_fullZoomReset"   key="&fullZoomResetCmd.commandkey;"
         command="cmd_fullZoomReset"   modifiers="accel"/>
    <key                          key="&fullZoomResetCmd.commandkey2;"
         command="cmd_fullZoomReset"   modifiers="accel"/>
  </keyset>

  <!-- Tab/F6 Keys -->
  <key keycode="VK_TAB" oncommand="SwitchPaneFocus(event);" modifiers="control,shift"/>
  <key keycode="VK_TAB" oncommand="SwitchPaneFocus(event);" modifiers="control"/>
  <key keycode="VK_F6" oncommand="SwitchPaneFocus(event);" modifiers="control,shift"/>
  <key keycode="VK_F6" oncommand="SwitchPaneFocus(event);" modifiers="control"/>
  <key keycode="VK_F6" oncommand="SwitchPaneFocus(event);" modifiers="shift"/>
  <key keycode="VK_F6" oncommand="SwitchPaneFocus(event);"/>

  <!-- View Toggle Keys (F8) -->
  <key id="key_toggleMessagePane" keycode="VK_F8" oncommand="goDoCommand('cmd_toggleMessagePane');"/>

  <!-- Tag Keys -->
  <!-- Includes both shifted and not, for Azerty and other layouts where the
       numeric keys are shifted. -->
  <key id="key_tag0" key="&tagCmd0.key;" modifiers="shift any"
       oncommand="goDoCommand('cmd_removeTags');"/>
  <key id="key_tag1" key="&tagCmd1.key;" modifiers="shift any"
       oncommand="goDoCommand('cmd_tag1');"/>
  <key id="key_tag2" key="&tagCmd2.key;" modifiers="shift any"
       oncommand="goDoCommand('cmd_tag2');"/>
  <key id="key_tag3" key="&tagCmd3.key;" modifiers="shift any"
       oncommand="goDoCommand('cmd_tag3');"/>
  <key id="key_tag4" key="&tagCmd4.key;" modifiers="shift any"
       oncommand="goDoCommand('cmd_tag4');"/>
  <key id="key_tag5" key="&tagCmd5.key;" modifiers="shift any"
       oncommand="goDoCommand('cmd_tag5');"/>
  <key id="key_tag6" key="&tagCmd6.key;" modifiers="shift any"
       oncommand="goDoCommand('cmd_tag6');"/>
  <key id="key_tag7" key="&tagCmd7.key;" modifiers="shift any"
       oncommand="goDoCommand('cmd_tag7');"/>
  <key id="key_tag8" key="&tagCmd8.key;" modifiers="shift any"
       oncommand="goDoCommand('cmd_tag8');"/>
  <key id="key_tag9" key="&tagCmd9.key;" modifiers="shift any"
       oncommand="goDoCommand('cmd_tag9');"/>

  <!-- Tools Keys -->
  <key id="key_searchMail" key="&searchMailCmd.key;" oncommand="goDoCommand('cmd_search')" modifiers="accel, shift"/>
  <key id="key_errorConsole" key="&errorConsoleCmd.commandkey;" oncommand="toJavaScriptConsole();" modifiers="accel,shift"/>
  <key id="key_addressbook"
       key="&addressBookCmd.key;"
       modifiers="accel, shift"
       oncommand="toAddressBook();"/>
  <key id="key_savedFiles"
       key="&savedFiles.key;"
       modifiers="accel"
       oncommand="openSavedFilesWnd();"/>


   <key id="key_mail" oncommand="focusOnMail(0, event);" key="1" modifiers="accel"/>
   <key id="key_selectTab2" oncommand="focusOnMail(1, event);" key="2" modifiers="accel"/>
   <key id="key_selectTab3" oncommand="focusOnMail(2, event);" key="3" modifiers="accel"/>
   <key id="key_selectTab4" oncommand="focusOnMail(3, event);" key="4" modifiers="accel"/>
   <key id="key_selectTab5" oncommand="focusOnMail(4, event);" key="5" modifiers="accel"/>
   <key id="key_selectTab6" oncommand="focusOnMail(5, event);" key="6" modifiers="accel"/>
   <key id="key_selectTab7" oncommand="focusOnMail(6, event);" key="7" modifiers="accel"/>
   <key id="key_selectTab8" oncommand="focusOnMail(7, event);" key="8" modifiers="accel"/>
   <key id="key_selectLastTab" oncommand="focusOnMail(-1, event);" key="9" modifiers="accel"/>

  <!-- Mac Window menu keys -->
  <key id="key_minimizeWindow" command="minimizeWindow" key="&minimizeWindow.key;" modifiers="accel"/>
    <!-- the following 3 keys are used in the application menu on Mac OS X Cocoa widgets -->
  <key id="key_preferencesCmdMac" key="&preferencesCmdMac.commandkey;" modifiers="&preferencesCmdMac.modifiers;"/>
  <key id="key_hideThisAppCmdMac" key="&hideThisAppCmdMac.commandkey;" modifiers="&hideThisAppCmdMac.modifiers;"/>
  <key id="key_hideOtherAppsCmdMac" key="&hideOtherAppsCmdMac.commandkey;" modifiers="&hideOtherAppsCmdMac.modifiers;"/>

  <!-- Common keys for the base menu overlay -->
  <keyset id="baseMenuKeyset"/>
</keyset>

  <!-- "Please keep all items and separators up to date in nsContextMenu.js when making changes here" -->
  <menupopup id="mailContext"
             pagemenu="start"
             onpopupshowing="return fillMailContextMenu(event);"
             onpopuphiding="mailContextOnPopupHiding(event);">

    <menuseparator id="page-menu-separator"/>

    <!-- Spellchecking suggestions -->
    <menuitem id="mailContext-spell-no-suggestions"
              disabled="true"
              label="&spellNoSuggestions.label;"/>
    <menuitem id="mailContext-spell-add-to-dictionary"
              label="&spellAddToDictionary.label;"
              accesskey="&spellAddToDictionary.accesskey;"
              oncommand="gSpellChecker.addToDictionary();"/>
    <menuseparator id="mailContext-spell-suggestions-separator"/>

    <menuitem id="mailContext-openInBrowser"
              label="&openInBrowser.label;"
              accesskey="&openInBrowser.accesskey;"
              oncommand="gContextMenu.openInBrowser();"/>
    <menuitem id="mailContext-openLinkInBrowser"
              label="&openLinkInBrowser.label;"
              accesskey="&openLinkInBrowser.accesskey;"
              oncommand="gContextMenu.openLinkInBrowser();"/>
    <menuseparator id="mailContext-sep-open-browser"/>
    <menuitem id="mailContext-reload"
              label="&reloadCmd.label;"
              accesskey="&reloadCmd.accesskey;"
              command="cmd_reload"/>
    <menuitem id="mailContext-stop"
              label="&stopCmd.label;"
              accesskey="&stopCmd.accesskey;"
              command="cmd_stop"/>
    <menuseparator id="mailContext-sep-link"/>
    <menuitem id="mailContext-undo"
              label="&undoDefaultCmd.label;"
              accesskey="&undoDefaultCmd.accesskey;"
              command="cmd_undo"/>
    <menuseparator id="mailContext-sep-undo"/>
    <menuitem id="mailContext-cut"
              label="&cutCmd.label;"
              accesskey="&cutCmd.accesskey;"
              command="cmd_copy"/>
    <menuitem id="mailContext-copy"
              label="&copyCmd.label;"
              accesskey="&copyCmd.accesskey;"
              command="cmd_copy"/>
    <menuitem id="mailContext-paste"
              label="&pasteCmd.label;"
              accesskey="&pasteCmd.accesskey;"
              command="cmd_paste"/>
    <menuitem id="mailContext-selectall"
              label="&selectAllCmd.label;"
              accesskey="&selectAllCmd.accesskey;"
              command="cmd_selectAll"/>
    <menuseparator id="mailContext-sep-clipboard"/>

    <menuitem id="mailContext-searchTheWeb"
              label="[glodaComplete.webSearch1.label]"
              oncommand="openSearchTab(event.target.value)"/>

    <!-- Spellchecking general menu items (enable, add dictionaries...) -->
    <menuseparator id="mailContext-spell-separator"/>
    <menuitem id="mailContext-spell-check-enabled"
              label="&spellCheckToggle.label;"
              type="checkbox"
              accesskey="&spellCheckToggle.accesskey;"
              oncommand="gSpellChecker.toggleEnabled();"/>
    <menuitem id="mailContext-spell-add-dictionaries-main"
              label="&spellAddDictionaries.label;"
              accesskey="&spellAddDictionaries.accesskey;"
              oncommand="gContextMenu.addDictionaries();"/>
    <menu id="mailContext-spell-dictionaries"
          label="&spellDictionaries.label;"
          accesskey="&spellDictionaries.accesskey;">
        <menupopup id="mailContext-spell-dictionaries-menu">
            <menuseparator id="mailContext-spell-language-separator"/>
            <menuitem id="mailContext-spell-add-dictionaries"
                      label="&spellAddDictionaries.label;"
                      accesskey="&spellAddDictionaries.accesskey;"
                      oncommand="gContextMenu.addDictionaries();"/>
        </menupopup>
    </menu>

    <menuseparator id="mailContext-sep-open"/>
    <menuitem id="mailContext-media-play"
              label="&contextPlay.label;"
              accesskey="&contextPlay.accesskey;"
              oncommand="gContextMenu.mediaCommand('play');"/>
    <menuitem id="mailContext-media-pause"
              label="&contextPause.label;"
              accesskey="&contextPause.accesskey;"
              oncommand="gContextMenu.mediaCommand('pause');"/>
    <menuitem id="mailContext-media-mute"
              label="&contextMute.label;"
              accesskey="&contextMute.accesskey;"
              oncommand="gContextMenu.mediaCommand('mute');"/>
    <menuitem id="mailContext-media-unmute"
              label="&contextUnmute.label;"
              accesskey="&contextUnmute.accesskey;"
              oncommand="gContextMenu.mediaCommand('unmute');"/>
    <menuitem id="threadPaneContext-openNewTab"
              label="&contextOpenNewTab.label;"
              accesskey="&contextOpenNewTab.accesskey;"
              oncommand="OpenMessageInNewTab(event);"/>
    <menuitem id="mailContext-openNewWindow"
              label="&contextOpenNewWindow.label;"
              accesskey="&contextOpenNewWindow.accesskey;"
              oncommand="MsgOpenNewWindowForMessage();"/>
    <menuitem id="mailContext-openConversation"
              label="&contextOpenConversation.label;"
              accesskey="&contextOpenConversation.accesskey;"
              oncommand="gConversationOpener.openConversationForMessages(gFolderDisplay.selectedMessages);"/>
    <menuitem id="mailContext-openContainingFolder"
              label="&contextOpenContainingFolder.label;"
              accesskey="&contextOpenContainingFolder.accesskey;"
              oncommand="OpenContainingFolder();"/>
    <menuseparator id="mailContext-sep-open2"/>
    <menuitem id="mailContext-replyNewsgroup"
              label="&contextReplyNewsgroup2.label;"
              accesskey="&contextReplyNewsgroup2.accesskey;"
              oncommand="MsgReplyGroup(event);"/>
    <menuitem id="mailContext-replySender"
              label="&contextReplySender.label;"
              accesskey="&contextReplySender.accesskey;"
              oncommand="MsgReplySender(event);"/>
    <menuitem id="mailContext-replyAll"
              label="&contextReplyAll.label;"
              accesskey="&contextReplyAll.accesskey;"
              oncommand="MsgReplyToAllMessage(event);"/>
    <menuitem id="mailContext-replyList"
              label="&contextReplyList.label;"
              accesskey="&contextReplyList.accesskey;"
              oncommand="MsgReplyToListMessage(event);"/>
    <menuitem id="mailContext-forward"
              label="&contextForward.label;"
              accesskey="&contextForward.accesskey;"
              oncommand="MsgForwardMessage(event);"/>
    <menu id="mailContext-forwardAsMenu"
          label="&contextForwardAsMenu.label;"
          accesskey="&contextForwardAsMenu.accesskey;">
      <menupopup id="mailContext-forwardAsPopup">
        <menuitem id="mailContext-forwardAsInline"
                  label="&contextForwardAsInline.label;"
                  accesskey="&contextForwardAsInline.accesskey;"
                  command="cmd_forwardInline"/>
        <menuitem id="mailContext-forwardAsAttachment"
                  label="&contextForwardAsAttachmentItem.label;"
                  accesskey="&contextForwardAsAttachmentItem.accesskey;"
                  command="cmd_forwardAttachment"/>
      </menupopup>
    </menu>
    <menuitem id="mailContext-multiForwardAsAttachment"
              label="&contextMultiForwardAsAttachment.label;"
              accesskey="&contextMultiForwardAsAttachment.accesskey;"
              oncommand="MsgForwardAsAttachment(event);"/>
    <menuitem id="mailContext-editAsNew"
              label="&contextEditMsgAsNew.label;"
              accesskey="&contextEditMsgAsNew.accesskey;"
              oncommand="MsgEditMessageAsNew();"/>
    <menuseparator id="mailContext-sep-reply"/>
    <menu id="mailContext-tags" label="&tagMenu.label;" accesskey="&tagMenu.accesskey;">
      <menupopup id="mailContext-tagpopup"
                 onpopupshowing="InitMessageTags(this);">
        <menuitem id="addNewTag"
                  label="&addNewTag.label;"
                  accesskey="&addNewTag.accesskey;"
                  command="cmd_addTag"/>
        <menuitem id="manageTags"
                  label="&manageTags.label;"
                  accesskey="&manageTags.accesskey;"
                  command="cmd_manageTags"/>
        <menuseparator id="mailContext-sep-afterTagAddNew"/>
        <menuitem id="mailContext-tagRemoveAll"
                  command="cmd_removeTags"/>
        <menuseparator id="mailContext-sep-afterTagRemoveAll"/>
      </menupopup>
    </menu>
    <menu id="mailContext-mark"
          label="&markMenu.label;"
          accesskey="&markMenu.accesskey;">
      <menupopup id="mailContext-markPopup"
                 onpopupshowing="InitMessageMark()">
        <menuitem id="mailContext-markRead"
                  label="&markAsReadCmd.label;"
                  accesskey="&markAsReadCmd.accesskey;"
                  command="cmd_markAsRead"/>
        <menuitem id="mailContext-markUnread"
                  label="&markAsUnreadCmd.label;"
                  accesskey="&markAsUnreadCmd.accesskey;"
                  command="cmd_markAsUnread"/>
        <menuitem id="mailContext-markThreadAsRead"
                  label="&markThreadAsReadCmd.label;"
                  accesskey="&markThreadAsReadCmd.accesskey;"
                  command="cmd_markThreadAsRead"/>
        <menuitem id="mailContext-markReadByDate"
                  label="&markReadByDateCmd.label;"
                  accesskey="&markReadByDateCmd.accesskey;"
                  command="cmd_markReadByDate"/>
        <menuitem id="mailContext-markAllRead"
                  label="&markAllReadCmd.label;"
                  accesskey="&markAllReadCmd.accesskey;"
                  command="cmd_markAllRead"/>
        <menuseparator id="mailContext-sep-afterMarkAllRead"/>
        <menuitem id="mailContext-markFlagged"
                  type="checkbox"
                  label="&markStarredCmd.label;"
                  accesskey="&markStarredCmd.accesskey;"
                  command="cmd_markAsFlagged"/>
        <menuseparator id="mailContext-sep-afterMarkFlagged"/>
        <menuitem id="mailContext-markAsJunk"
                  label="&markAsJunkCmd.label;"
                  accesskey="&markAsJunkCmd.accesskey;"
                  command="cmd_markAsJunk"/>
        <menuitem id="mailContext-markAsNotJunk"
                  label="&markAsNotJunkCmd.label;"
                  accesskey="&markAsNotJunkCmd.accesskey;"
                  command="cmd_markAsNotJunk"/>
        <menuitem id="mailContext-recalculateJunkScore"
                  label="&recalculateJunkScoreCmd.label;"
                  accesskey="&recalculateJunkScoreCmd.accesskey;"
                  command="cmd_recalculateJunkScore"/>
      </menupopup>
    </menu>
    <menuseparator id="mailContext-sep-afterMarkMenu"/>
    <menuitem id="mailContext-copyMessageUrl"
              label="&copyMessageLocation.label;"
              accesskey="&copyMessageLocation.accesskey;"
              oncommand="CopyMessageUrl()"/>
    <menuitem id="mailContext-archive"
              label="&contextArchive.label;"
              accesskey="&contextArchive.accesskey;"
              oncommand="MsgArchiveSelectedMessages(event);"/>
    <menu id="mailContext-moveMenu"
          label="&contextMoveMsgMenu.label;"
          accesskey="&contextMoveMsgMenu.accesskey;"
          oncommand="MsgMoveMessage(event.target._folder)">
      <menupopup id="mailContext-fileHereMenu"
                 type="folder"
                 mode="filing"
                 showFileHereLabel="true"
                 showRecent="true"
                 recentLabel="&contextMoveCopyMsgRecentMenu.label;"
                 recentAccessKey="&contextMoveCopyMsgRecentMenu.accesskey;"/>
    </menu>
    <menu id="mailContext-copyMenu"
          label="&contextCopyMsgMenu.label;"
          accesskey="&contextCopyMsgMenu.accesskey;"
          oncommand="MsgCopyMessage(event.target._folder)">
      <menupopup id="mailContext-copyHereMenu"
                 type="folder"
                 mode="filing"
                 showFileHereLabel="true"
                 showRecent="true"
                 recentLabel="&contextMoveCopyMsgRecentMenu.label;"
                 recentAccessKey="&contextMoveCopyMsgRecentMenu.accesskey;"/>
    </menu>
    <menuitem id="mailContext-moveToFolderAgain"
              command="cmd_moveToFolderAgain"
              label="&moveToFolderAgain.label;"
              accesskey="&moveToFolderAgain.accesskey;"/>
    <menuseparator id="paneContext-afterMove"/>
    <menuitem id="mailContext-ignoreThread"
              label="&contextKillThreadMenu.label;"
              accesskey="&contextKillThreadMenu.accesskey;"
              command="cmd_killThread"/>
    <menuitem id="mailContext-ignoreSubthread"
              label="&contextKillSubthreadMenu.label;"
              command="cmd_killSubthread"/>
    <menuitem id="mailContext-watchThread"
              label="&contextWatchThreadMenu.label;"
              command="cmd_watchThread"/>
    <menuseparator id="mailContext-afterWatchThread"/>
    <menuitem id="mailContext-saveAs"
              label="&contextSaveAs.label;"
              accesskey="&contextSaveAs.accesskey;"
              oncommand="MsgSaveAsFile();"/>
    <menuitem id="mailContext-printpreview"
              label="&contextPrintPreview.label;"
              accesskey="&contextPrintPreview.accesskey;"
              observes="cmd_printpreview"
              command="cmd_printpreview"/>
    <menuitem id="mailContext-print"
              label="&contextPrint.label;"
              accesskey="&contextPrint.accesskey;"
              observes="cmd_print"
              command="cmd_print"/>
    <menuitem id="mailContext-delete"
              command="cmd_delete"/>
    <menuitem id="downloadSelected"
              label="&downloadSelectedCmd.label;"
              accesskey="&downloadSelectedCmd.accesskey;"
              command="cmd_downloadSelected"/>
    <menuseparator id="mailContext-sep-edit"/>
    <menuitem id="mailContext-copylink"
              label="&copyLinkCmd.label;"
              accesskey="&copyLinkCmd.accesskey;"
              command="cmd_copyLink"/>
    <menuitem id="mailContext-copyimage"
              label="&copyImageAllCmd.label;"
              accesskey="&copyImageAllCmd.accesskey;"
              command="cmd_copyImage"/>
    <menuitem id="mailContext-addemail"
              label="&AddToAddressBook.label;"
              accesskey="&AddToAddressBook.accesskey;"
              oncommand="addEmail();"/>
    <menuitem id="mailContext-composeemailto"
              label="&SendMessageTo.label;"
              accesskey="&SendMessageTo.accesskey;"
              oncommand="composeEmailTo();"/>
    <menuitem id="mailContext-copyemail"
              label="&copyEmailCmd.label;"
              accesskey="&copyEmailCmd.accesskey;"
              oncommand="gContextMenu.copyEmail();"/>
    <menuseparator id="mailContext-sep-copy"/>
    <menuitem id="mailContext-savelink"
              label="&saveLinkAsCmd.label;"
              accesskey="&saveLinkAsCmd.accesskey;"
              oncommand="gContextMenu.saveLink();"/>
    <menuitem id="mailContext-saveimage"
              label="&saveImageAsCmd.label;"
              accesskey="&saveImageAsCmd.accesskey;"
              oncommand="gContextMenu.saveImage();"/>
    <menuseparator id="mailContext-sep-reportPhishing"/>
    <menuitem id="mailContext-reportPhishingURL"
              label="&reportPhishingURL.label;"
              accesskey="&reportPhishingURL.accesskey;"
              oncommand="gPhishingDetector.reportPhishingURL(gContextMenu.linkURL);"/>

  </menupopup>

  <menupopup id="folderPaneContext"
             onpopupshowing="return fillFolderPaneContextMenu();"
             onpopuphiding="if (event.target == this) folderPaneOnPopupHiding();">
    <menuitem id="folderPaneContext-getMessages"
              label="&folderContextGetMessages.label;"
              accesskey="&folderContextGetMessages.accesskey;"
              oncommand="MsgGetMessage();"/>
    <menuitem id="folderPaneContext-openNewTab"
              label="&folderContextOpenNewTab.label;"
              accesskey="&folderContextOpenNewTab.accesskey;"
              oncommand="FolderPaneContextMenuNewTab(event);"/>
    <menuitem id="folderPaneContext-openNewWindow"
              label="&folderContextOpenInNewWindow.label;"
              accesskey="&folderContextOpenInNewWindow.accesskey;"
              oncommand="MsgOpenNewWindowForFolder(null,-1);"/>
    <menuitem id="folderPaneContext-searchMessages"
              label="&folderContextSearchForMessages.label;"
              accesskey="&folderContextSearchForMessages.accesskey;"
              oncommand="gFolderTreeController.searchMessages();"/>
    <menuitem id="folderPaneContext-subscribe"
              label="&folderContextSubscribe.label;"
              accesskey="&folderContextSubscribe.accesskey;"
              oncommand="MsgSubscribe();"/>
    <menuitem id="folderPaneContext-newsUnsubscribe"
              label="&folderContextUnsubscribe.label;"
              accesskey="&folderContextUnsubscribe.accesskey;"
              oncommand="MsgUnsubscribe();"/>
    <menuseparator id="folderPaneContext-sep1"/>
    <menuitem id="folderPaneContext-new"
              label="&folderContextNew.label;"
              accesskey="&folderContextNew.accesskey;"
              oncommand="gFolderTreeController.newFolder();"/>
    <menuitem id="folderPaneContext-remove"
              label="&folderContextRemove.label;"
              accesskey="&folderContextRemove.accesskey;"
              oncommand="gFolderTreeController.deleteFolder();"/>
    <menuitem id="folderPaneContext-rename"
              label="&folderContextRename.label;"
              accesskey="&folderContextRename.accesskey;"
              oncommand="gFolderTreeController.renameFolder();"/>
    <menuseparator id="folderPaneContext-sep2"/>
    <menuitem id="folderPaneContext-compact"
              label="&folderContextCompact.label;"
              accesskey="&folderContextCompact.accesskey;"
              oncommand="gFolderTreeController.compactFolders();"/>
    <menuitem id="folderPaneContext-markMailFolderAllRead"
              label="&folderContextMarkMailFolderRead.label;"
              accesskey="&folderContextMarkMailFolderRead.accesskey;"
              oncommand="MsgMarkAllRead();"/>
    <menuitem id="folderPaneContext-markNewsgroupAllRead"
              label="&folderContextMarkNewsgroupRead.label;"
              accesskey="&folderContextMarkNewsgroupRead.accesskey;"
              oncommand="MsgMarkAllRead();"/>
    <menuitem id="folderPaneContext-emptyTrash"
              label="&folderContextEmptyTrash.label;"
              accesskey="&folderContextEmptyTrash.accesskey;"
              oncommand="gFolderTreeController.emptyTrash();"/>
    <menuitem id="folderPaneContext-emptyJunk"
              label="&folderContextEmptyJunk.label;"
              accesskey="&folderContextEmptyJunk.accesskey;"
              oncommand="gFolderTreeController.emptyJunk();"/>
    <menuitem id="folderPaneContext-sendUnsentMessages"
              label="&folderContextSendUnsentMessages.label;"
              accesskey="&folderContextSendUnsentMessages.accesskey;"
              oncommand="goDoCommand('cmd_sendUnsentMsgs')"/>
    <menuseparator id="folderPaneContext-sep3"/>
    <menuitem id="folderPaneContext-favoriteFolder"
              type="checkbox"
              label="&folderContextFavoriteFolder.label;"
              accesskey="&folderContextFavoriteFolder.accesskey;"
              checked="false"
              oncommand="ToggleFavoriteFolderFlag();"/>
    <menuitem id="folderPaneContext-properties"
              label="&folderContextProperties2.label;"
              accesskey="&folderContextProperties2.accesskey;"
              oncommand="gFolderTreeController.editFolder();"/>
    <menuitem id="folderPaneContext-settings"
              label="&folderContextSettings2.label;"
              accesskey="&folderContextSettings2.accesskey;"
              oncommand="gFolderTreeController.editFolder();"/>
  </menupopup>

  <menupopup id="toolbar-context-menu"
             onpopupshowing="onViewToolbarsPopupShowing(event, 'mail-toolbox');">
    <menuseparator id="customizeMailToolbarMenuSeparator"/>
    <menuitem id="CustomizeMailToolbar"
              command="cmd_CustomizeMailToolbar"
              label="&customizeToolbar.label;"
              accesskey="&customizeToolbar.accesskey;"/>
  </menupopup>

  <menupopup id="remoteContentOptions" value=""
             onpopupshowing="onRemoteContentOptionsShowing(event);">
    <menuitem id="remoteContentOptionAllowForMsg"
              label="&remoteContentOptionsAllowForMsg.label;"
              accesskey="&remoteContentOptionsAllowForMsg.accesskey;"
              oncommand="LoadMsgWithRemoteContent();"/>
    <menuseparator id="remoteContentSettingsMenuSeparator"/>
    <menuitem id="editRemoteContentSettings"
              label="&editRemoteContentSettingsUnix.label;"
              accesskey="&editRemoteContentSettingsUnix.accesskey;"
              oncommand="editRemoteContentSettings();"/>
  </menupopup>

  <menupopup id="phishingOptions">
    <menuitem id="phishingOptionIgnore"
              label="&phishingOptionIgnore.label;"
              accesskey="&phishingOptionIgnore.accesskey;"
              oncommand="IgnorePhishingWarning();"/>
    <menuitem id="phishingOptionSettings"
              label="&phishingOptionSettingsUnix.label;"
              accesskey="&phishingOptionSettingsUnix.accesskey;"
              oncommand="OpenPhishingSettings();"/>
  </menupopup>

<popupset id="mainPopupSet">
  <menupopup id="appmenu-popup"
             onpopupshowing="initAppMenuPopup(this, event);">
    <hbox>
      <vbox id="appmenuPrimaryPane">
        <splitmenu id="appmenu_newMessage"
                   label="&appmenuNewMsgCmd.label;"
                   command="cmd_newMessage">
            <menupopup id="appmenu_newMenupopup">
              <menuitem id="newNewMsgCmd"
                        label="&newNewMsgCmd.label;"
                        key="key_newMessage2"
                        command="cmd_newMessage"/>
              <menuitem id="appmenu_newFolder"
                        label="&newFolderCmd.label;"
                        oncommand="gFolderTreeController.newFolder();"/>
              <menuitem id="appmenu_newVirtualFolder"
                        label="&newVirtualFolderCmd.label;"
                        oncommand="gFolderTreeController.newVirtualFolder();"/>
              <menuseparator id="appmenu_newAccountPopupMenuSeparator"/>
              <menuitem id="appmenu_newCreateEmailAccountMenuItem"
                        label="&newCreateEmailAccountCmd.label;"
                        oncommand="NewMailAccountProvisioner(msgWindow);"/>
              <menuitem id="appmenu_newMailAccountMenuItem"
                        label="&newExistingEmailAccountCmd.label;"
                        oncommand="NewMailAccount(msgWindow);"/>
              <menuitem id="appmenu_newIMAccountMenuItem"
                        label="&newIMAccountCmd.label;"
                        oncommand="openIMAccountWizard();"/>
              <menuitem id="appmenu_newFeedAccountMenuItem"
                        label="&newFeedAccountCmd.label;"
                        accesskey="&newFeedAccountCmd.accesskey;"
                        oncommand="AddFeedAccount();"/>
              <menuitem id="appmenu_newAccountMenuItem"
                        label="&newOtherAccountsCmd.label;"
                        oncommand="MsgAccountWizard();"/>
              <menuseparator id="appmenu_newPopupMenuSeparator"/>
              <menuitem id="appmenu_newCard"
                        label="&appmenuNewContactCmd.label;"
                        command="cmd_newCard"/>
              <menuitem id="appmenu_newIMContactMenuItem"
                        label="&newIMContactCmd.label;"
                        oncommand="chatHandler.addBuddy();"/>
            </menupopup>
        </splitmenu>
        <menu id="appmenu_msgAttachmentMenu"
              label="&openAttachmentListCmd.label;"
              disabled="true">
          <menupopup id="appmenu_attachmentMenuList"
                     onpopupshowing="FillAttachmentListPopup(this);"/>
        </menu>
        <menuseparator class="appmenu-menuseparator"/>
        <hbox>
          <menuitem id="appmenu-edit-label"
                    label="&appmenuEditMenu.label;"
                    disabled="true"/>
          <toolbarbutton id="appmenu-cut"
                         class="appmenu-edit-button"
                         command="cmd_cut"
                         onclick="if (!this.disabled) hidePopup();"
                         tooltiptext="&cutCmd.label;"/>
          <toolbarbutton id="appmenu-copy"
                         class="appmenu-edit-button"
                         command="cmd_copy"
                         onclick="if (!this.disabled) hidePopup();"
                         tooltiptext="&copyCmd.label;"/>
          <toolbarbutton id="appmenu-paste"
                         class="appmenu-edit-button"
                         command="cmd_paste"
                         onclick="if (!this.disabled) hidePopup();"
                         tooltiptext="&pasteCmd.label;"/>
          <spacer flex="1"/>
          <menu id="appmenu-editmenu">
            <menupopup id="appmenu-editmenu-menupopup">
              <menuitem id="appmenu-editmenu-cut"
                        class="menuitem-iconic"
                        label="&cutCmd.label;"
                        key="key_cut"
                        command="cmd_cut"/>
              <menuitem id="appmenu-editmenu-copy"
                        class="menuitem-iconic"
                        label="&copyCmd.label;"
                        key="key_copy"
                        command="cmd_copy"/>
              <menuitem id="appmenu-editmenu-paste"
                        class="menuitem-iconic"
                        label="&pasteCmd.label;"
                        key="key_paste"
                        command="cmd_paste"/>
              <menuseparator/>
              <menuitem id="appmenu-editmenu-undo"
                        label="&undoCmd.label;"
                        key="key_undo"
                        command="cmd_undo"/>
              <menuitem id="appmenu-editmenu-redo"
                        label="&redoCmd.label;"
                        key="key_redo"
                        command="cmd_redo"/>
              <menuseparator id="appmenu_messageAfterRedoEditSeparator"/>
              <menuitem id="appmenu_delete"
                        label="&deleteCmd.label;"
                        acceltext="⌫"
                        command="cmd_delete"/>
              <menuseparator id="appmenu_messageAfterDeleteEditSeparator"/>
              <menuitem id="appmenu-editmenu-selectAll"
                        label="&selectAllCmd.label;"
                        key="key_selectAll"
                        command="cmd_selectAll"/>
              <menuitem id="appmenu_selectThread"
                        label="&appmenuSelectThread.label;"
                        key="key_selectThread"
                        command="cmd_selectThread"/>
              <menuitem id="appmenu_selectFlagged"
                        label="&appmenuSelectFlagged.label;"
                        command="cmd_selectFlagged"/>
            </menupopup>
          </menu>
        </hbox>
        <splitmenu id="appmenu_find"
                   label="&findMenu.label;"
                   command="cmd_find">
          <menupopup id="appmenu_FindPopup">
            <menuitem id="appmenu_findCmd"
                      label="&findCmd.label;"
                      key="key_find"
                      command="cmd_find"/>
            <menuitem id="appmenu_findAgainCmd"
                      label="&findAgainCmd.label;"
                      key="key_findAgain"
                      command="cmd_findAgain"/>
            <menuseparator id="appMenuAfterFindSeparator"/>
            <menuitem id="appmenu_searchMailCmd"
                      label="&searchMailCmd.label;"
                      key="key_searchMail"
                      command="cmd_search"/>
            <menuitem id="appmenu_searchAddressesCmd"
                      label="&searchAddressesCmd.label;"
                      oncommand="MsgSearchAddresses()"/>
          </menupopup>
        </splitmenu>
        <splitmenu id="appmenu_print"
                   iconic="true"
                   label="&printCmd.label;"
                   key="printKb"
                   command="cmd_print">
            <menupopup>
              <menuitem id="appmenu_print_popup"
                        class="menuitem-iconic"
                        label="&printCmd.label;"
                        key="key_print"
                        command="cmd_print"/>
              <menuitem id="appmenu_printSetup"
                        label="&printSetupCmd.label;"
                        command="cmd_printSetup"/>
            </menupopup>
        </splitmenu>
        <menuseparator class="appmenu-menuseparator"/>
        <menu id="appmenu_saveAs"
              label="&saveAsMenu.label;">
          <menupopup id="menu_SavePopup">
            <menuitem id="appmenu_saveAsFile"
                      label="&saveAsFileCmd.label;"
                      key="key_saveAsFile"
                      command="cmd_saveAsFile"/>
            <menuitem id="appmenu_saveAsTemplate"
                      label="&saveAsTemplateCmd.label;"
                      command="cmd_saveAsTemplate"/>
          </menupopup>
        </menu>
        <menu id="appmenu_FolderViews"
              label="&folderView.label;">
          <menupopup id="appmenu_FolderViewsPopup"
                     onpopupshowing="InitAppFolderViewsMenu();
                                     InitViewFolderViewsMenu(event);">
            <menuitem id="appmenu_allFolders"
                      value="all"
                      label="&allFolders.label;"
                      type="radio"
                      name="viewmessages"
                      oncommand="gFolderTreeView.toggleMode(this.value);"/>
            <menuitem id="appmenu_smartFolders"
                      value="smart"
                      label="&unifiedFolders.label;"
                      type="radio"
                      name="viewmessages"
                      oncommand="gFolderTreeView.toggleMode(this.value);"/>
            <menuitem id="appmenu_unreadFolders"
                      value="unread"
                      label="&unreadFolders.label;"
                      type="radio"
                      name="viewmessages"
                      oncommand="gFolderTreeView.toggleMode(this.value);"/>
            <menuitem id="appmenu_favoriteFolders"
                      value="favorite"
                      label="&favoriteFolders.label;"
                      type="radio"
                      name="viewmessages"
                      oncommand="gFolderTreeView.toggleMode(this.value);"/>
            <menuitem id="appmenu_recentFolders"
                      value="recent"
                      label="&recentFolders.label;"
                      type="radio"
                      name="viewmessages"
                      oncommand="gFolderTreeView.toggleMode(this.value);"/>
            <menuseparator id="appmenu_compactViewSeparator"/>
            <menuitem id="appmenu_compactFolderView"
                      label="&compactVersion.label;"
                      type="checkbox"
                      oncommand="gFolderTreeView.toggleCompact(this.getAttribute('checked') == 'true');"/>
            <menuseparator id="appmenu_favoritePropertiesSeparator"/>
            <menuitem id="appmenu_favoriteFolder"
                      type="checkbox"
                      label="&menuFavoriteFolder.label;"
                      checked="false"
                      oncommand="ToggleFavoriteFolderFlag();"/>
            <menuitem id="appmenu_properties"
                      label="&folderPropsCmd2.label;"
                      command="cmd_properties"/>
          </menupopup>
        </menu>
        <menuitem id="appmenu_emptyTrash"
                  label="&emptyTrashCmd.label;"
                  command="cmd_emptyTrash"/>
        <spacer flex="1"/>
        <menuitem id="appmenu-quit"
                  class="menuitem-iconic"
                  label="&quitApplicationCmdUnix.label;"
                  command="cmd_quit"/>
      </vbox>
      <vbox id="appmenuSecondaryPane">
        <menuitem id="appmenu_activityManager"
                  label="&activitymanager.label;"
                  oncommand="openActivityMgr();"/>
        <splitmenu id="appmenu_filters"
                  label="&filtersCmd2.label;"
                  command="cmd_displayMsgFilters">
          <menupopup id="appmenu_FilterMenu">
            <menuitem id="appmenu_filtersCmd"
                      label="&filtersCmd2.label;"
                      command="cmd_displayMsgFilters"/>
            <menuitem id="applyFilters"
                      label="&filtersApply.label;"
                      command="cmd_applyFilters"/>
            <menuitem id="applyFiltersToSelection"
                      label="&filtersApplyToMessage.label;"
                      command="cmd_applyFiltersToSelection"/>
          </menupopup>
        </splitmenu>
        <spacer class="appmenuPane-spacer"/>
        <menuitem id="appmenu_addons"
                  class="menuitem-iconic"
                  label="&addons.label;"
                  oncommand="openAddonsMgr();"/>
        <splitmenu id="appmenu_customize"
                   label="&preferencesCmdUnix.label;"
                   oncommand="openOptionsDialog();">
          <menupopup id="appmenu_customizeMenu"
                     onpopupshowing="onViewToolbarsPopupShowing(event, 'mail-toolbox', document.getElementById('appmenu_quickFilterBar'));">
            <menuitem id="appmenu_preferences"
                      label="&preferencesCmdUnix.label;"
                      oncommand="openOptionsDialog();"/>
            <menuitem id="appmenu_accountmgr"
                      label="&accountManagerCmd2.label;"
                      oncommand="MsgAccountManager(null);"/>
            <menuseparator/>
            <menuitem id="appmenu_showStatusbar"
                      type="checkbox"
                      label="&showTaskbarCmd.label;"
                      oncommand="goToggleToolbar('status-bar', 'menu_showTaskbar')"
                      checked="true"
                      observes="menu_showTaskbar"/>
            <menuseparator id="appmenu_toggleToolbarsSeparator"/>
            <menuitem id="appmenu_toolbarLayout"
                      label="&appmenuToolbarLayout.label;"
                      command="cmd_CustomizeMailToolbar"/>
            <menuseparator id="appmenu_paneViewSeparator"/>
            <menu id="appmenu_MessagePaneLayout"
                  label="&messagePaneLayoutStyle.label;">
              <menupopup id="appmenu_view_layout_popup"
                         onpopupshowing="InitViewLayoutStyleMenu(event)">
                <menuitem id="appmenu_messagePaneClassic"
                          type="radio"
                          label="&messagePaneClassic.label;"
                          name="viewlayoutgroup"
                          command="cmd_viewClassicMailLayout"/>
                <menuitem id="appmenu_messagePaneWide"
                          type="radio"
                          label="&messagePaneWide.label;"
                          name="viewlayoutgroup"
                          command="cmd_viewWideMailLayout"/>
                <menuitem id="appmenu_messagePaneVertical"
                          type="radio"
                          label="&messagePaneVertical.label;"
                          name="viewlayoutgroup"
                          command="cmd_viewVerticalMailLayout"/>
                <menuseparator id="appmenu_viewMenuAfterPaneVerticalSeparator"/>
                <menuitem id="appmenu_showFolderPane"
                          type="checkbox"
                          label="&showFolderPaneCmd.label;"
                          command="cmd_toggleFolderPane"/>
                <menuitem id="appmenu_showMessage"
                          type="checkbox"
                          label="&showMessageCmd.label;"
                          key="key_toggleMessagePane"
                          command="cmd_toggleMessagePane"/>
              </menupopup>
            </menu>
          </menupopup>
        </splitmenu>
        <spacer class="appmenuPane-spacer"/>
        <!-- File menu -->
        <menu id="appmenu_File"
              label="&fileMenu.label;">
          <menupopup id="appmenu_FilePopup">
            <menuitem id="appmenu_openMessageFileMenuitem"
                      label="&openMessageFileCmd.label;"
                      oncommand="MsgOpenFromFile();"/>
            <menuitem id="appmenu_close"
                      label="&closeCmd.label;"
                      key="key_close"
                      command="cmd_close"/>
            <menuseparator id="appmenu_fileMenuAfterCloseSeparator"/>
            <menu id="appmenu_getNewMsgFor"
                  label="&getNewMsgForCmd.label;"
                  oncommand="MsgGetMessagesForAccount(event.target._folder)">
              <menupopup type="folder"
                         mode="getMail"
                         id="appmenu_getAllNewMsgPopup"
                         expandFolders="false">
                <menuitem id="appmenu_getnewmsgs_all_accounts"
                          label="&getAllNewMsgCmdPopupMenu.label;"
                          key="key_getAllNewMessages"
                          command="cmd_getMsgsForAuthAccounts"/>
                <menuitem id="appmenu_getnewmsgs_current_account"
                          label="&getNewMsgCurrentAccountCmdPopupMenu.label;"
                          key="key_getNewMessages"
                          command="cmd_getNewMessages"/>
                <menuseparator/>
              </menupopup>
            </menu>
            <menuitem id="appmenu_getNextNMsgs"
                      label="&getNextNMsgCmd.label;"
                      command="cmd_getNextNMessages"/>
            <menuitem id="appmenu_sendUnsentMsgs"
                      label="&sendUnsentCmd.label;"
                      command="cmd_sendUnsentMsgs"/>
            <menuitem id="appmenu_subscribe"
                      label="&subscribeCmd.label;"
                      oncommand="MsgSubscribe();"/>
            <menuseparator id="appmenu_fileMenuAfterSubscribeSeparator"/>
            <menuitem id="appmenu_deleteFolder"
                      label="&deleteFolder.label;"
                      command="cmd_deleteFolder"/>
            <menuitem id="appmenu_renameFolder"
                      label="&renameFolder.label;"
                      key="key_renameFolder"
                      command="cmd_renameFolder"/>
            <menuseparator id="appmenu_fileMenuAfterRenameSeparator"/>
            <menuitem id="appmenu_compactFolder"
                      label="&compactFolders.label;"
                      command="cmd_compactFolder"/>
            <menuseparator id="appmenu_fileMenuAfterCompactSeparator"/>
            <menu id="appmenu_offline"
                  label="&offlineMenu.label;">
              <menupopup id="appmenu_OfflinePopup">
                <menuitem id="appmenu_goOffline"
                          type="checkbox"
                          label="&offlineGoOfflineCmd.label;"
                          oncommand="MailOfflineMgr.toggleOfflineStatus();"/>
                <menuseparator id="appmenu_offlineMenuAfterGoSeparator"/>
                <menuitem id="appmenu_synchronizeOffline"
                          label="&synchronizeOfflineCmd.label;"
                          command="cmd_synchronizeOffline"/>
                <menuitem id="appmenu_settingsOffline"
                          label="&settingsOfflineCmd2.label;"
                          command="cmd_settingsOffline"/>
                <menuseparator id="app_offlineMenuAfterSettingsSeparator"/>
                <menuitem id="appmenu_downloadFlagged"
                          label="&downloadStarredCmd.label;"
                          command="cmd_downloadFlagged"/>
                <menuitem id="appmenu_downloadSelected"
                          label="&downloadSelectedCmd.label;"
                          command="cmd_downloadSelected"/>
              </menupopup>
            </menu>
          </menupopup>
        </menu>
        <!-- View menu -->
        <menu id="appmenu_View"
              label="&viewMenu.label;">
          <menupopup id="appmenu_View_Popup">
            <menu id="appmenu_viewSortMenu"
                  label="&sortMenu.label;">
              <menupopup id="appmenu_viewSortPopup" onpopupshowing="InitAppViewSortByMenu()">
                <menuitem id="appmenu_sortByDateMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByDateCmd.label;"
                          oncommand="MsgSortThreadPane('byDate')"/>
                <menuitem id="appmenu_sortByReceivedMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByReceivedCmd.label;"
                          oncommand="MsgSortThreadPane('byReceived')"/>
                <menuitem id="appmenu_sortByFlagMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByStarCmd.label;"
                          oncommand="MsgSortThreadPane('byFlagged')"/>
                <menuitem id="appmenu_sortByOrderReceivedMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByOrderReceivedCmd.label;"
                          oncommand="MsgSortThreadPane('byId')"/>
                <menuitem id="appmenu_sortByPriorityMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByPriorityCmd.label;"
                          oncommand="MsgSortThreadPane('byPriority')"/>
                <menuitem id="appmenu_sortByFromMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByFromCmd.label;"
                          oncommand="MsgSortThreadPane('byAuthor')"/>
                <menuitem id="appmenu_sortByRecipientMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByRecipientCmd.label;"
                          oncommand="MsgSortThreadPane('byRecipient')"/>
                <menuitem id="appmenu_sortBySizeMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortBySizeCmd.label;"
                          oncommand="MsgSortThreadPane('bySize')"/>
                <menuitem id="appmenu_sortByStatusMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByStatusCmd.label;"
                          oncommand="MsgSortThreadPane('byStatus')"/>
                <menuitem id="appmenu_sortBySubjectMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortBySubjectCmd.label;"
                          oncommand="MsgSortThreadPane('bySubject')"/>
                <menuitem id="appmenu_sortByUnreadMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByUnreadCmd.label;"
                          oncommand="MsgSortThreadPane('byUnread')"/>
                <menuitem id="appmenu_sortByTagsMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByTagsCmd.label;"
                          oncommand="MsgSortThreadPane('byTags')"/>
                <menuitem id="appmenu_sortByJunkStatusMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByJunkStatusCmd.label;"
                          oncommand="MsgSortThreadPane('byJunkStatus')"/>
                <menuitem id="appmenu_sortByAttachmentsMenuitem"
                          type="radio"
                          name="sortby"
                          label="&sortByAttachmentsCmd.label;"
                          oncommand="MsgSortThreadPane('byAttachments')"/>
                <menuseparator id="appmenu_sortAfterAttachmentSeparator"/>
                <menuitem id="appmenu_sortAscending"
                          type="radio"
                          name="sortdirection"
                          label="&sortAscending.label;"
                          oncommand="MsgSortAscending()"/>
                <menuitem id="appmenu_sortDescending"
                          type="radio"
                          name="sortdirection"
                          label="&sortDescending.label;"
                          oncommand="MsgSortDescending()"/>
                <menuseparator id="appmenu_sortAfterDescendingSeparator"/>
                <menuitem id="appmenu_sortThreaded"
                          type="radio"
                          name="threaded"
                          label="&sortThreaded.label;"
                          oncommand="MsgSortThreaded();"/>
                <menuitem id="appmenu_sortUnthreaded"
                          type="radio"
                          name="threaded"
                          label="&sortUnthreaded.label;"
                          oncommand="MsgSortUnthreaded();"/>
                <menuitem id="appmenu_groupBySort"
                          type="radio"
                          name="group"
                          label="&groupBySort.label;"
                          oncommand="MsgGroupBySort();"/>
              </menupopup>
            </menu>
            <menu id="appmenu_viewMessageViewMenu"
                  label="&msgsMenu.label;"
                  command="mailHideMenus"
                  oncommand="ViewChangeByMenuitem(event.target);">
              <menupopup id="appmenu_viewMessagePopup"
                         onpopupshowing="RefreshViewPopup(this, false);">
                <menuitem id="appmenu_viewMessageAll"
                          value="0"
                          type="radio"
                          label="&viewAll.label;"/>
                <menuitem id="appmenu_viewMessageUnread"
                          value="1"
                          type="radio"
                          label="&viewUnread.label;"/>
                <menuitem id="appmenu_viewMessageNotDeleted"
                          value="3"
                          type="radio"
                          label="&viewNotDeleted.label;"/>
                <menuseparator id="appmenu_messageViewAfterUnreadSeparator"/>
                <menu id="viewMessageTags"
                      label="&viewTags.label;">
                  <menupopup id="appmenu_viewMessageTagsPopup"
                             onpopupshowing="RefreshTagsPopup(this, false);"/>
                </menu>
                <menu id="appmenu_viewMessageCustomViews"
                      label="&viewCustomViews.label;">
                  <menupopup id="appmenu_viewMessageCustomViewsPopup"
                             onpopupshowing="RefreshCustomViewsPopup(this, false);"/>
                </menu>
                <menuseparator id="appmenu_messageViewAfterCustomSeparator"/>
                <menuitem id="appmenu_viewMessageVirtualFolder"
                          value="7"
                          label="&viewVirtualFolder.label;"/>
                <menuitem id="appmenu_viewMessageCustomize"
                          value="8"
                          label="&viewCustomizeView.label;"/>
              </menupopup>
            </menu>
            <menu label="&threads.label;"
                  id="appmenu_viewMessagesMenu">
              <menupopup id="appmenu_ThreadsPopup"
                         onpopupshowing="InitAppmenuViewMessagesMenu()">
                <menuitem id="appmenu_viewAllMessagesMenuItem"
                          type="radio"
                          name="viewmessages"
                          label="&allMsgsCmd.label;"
                          disabled="true"
                          command="cmd_viewAllMsgs"/>
                <menuitem id="appmenu_viewUnreadMessagesMenuItem"
                          type="radio"
                          name="viewmessages"
                          label="&unreadMsgsCmd.label;"
                          disabled="true"
                          command="cmd_viewUnreadMsgs"/>
                <menuitem id="appmenu_viewThreadsWithUnreadMenuItem"
                          type="radio"
                          name="viewmessages"
                          label="&threadsWithUnreadCmd.label;"
                          disabled="true"
                          command="cmd_viewThreadsWithUnread"/>
                <menuitem id="appmenu_viewWatchedThreadsWithUnreadMenuItem"
                          type="radio"
                          name="viewmessages"
                          label="&watchedThreadsWithUnreadCmd.label;"
                          disabled="true"
                          command="cmd_viewWatchedThreadsWithUnread"/>
                <menuseparator id="appmenu_threadsAfterWatchedSeparator"/>
                <menuitem id="appmenu_viewIgnoredThreadsMenuItem"
                          type="checkbox"
                          label="&ignoredThreadsCmd.label;"
                          disabled="true"
                          command="cmd_viewIgnoredThreads"/>
                <menuseparator id="appmenu_threadsAfterIgnoredSeparator"/>
                <menuitem id="appmenu_expandAllThreads"
                          label="&expandAllThreadsCmd.label;"
                          key="key_expandAllThreads"
                          disabled="true"
                          command="cmd_expandAllThreads"/>
                <menuitem id="appmenu_collapseAllThreads"
                          label="&collapseAllThreadsCmd.label;"
                          key="key_collapseAllThreads"
                          disabled="true"
                          command="cmd_collapseAllThreads"/>
              </menupopup>
            </menu>
            <menuseparator id="appmenu_viewAfterThreadsSeparator"/>
            <menu id="appmenu_viewHeadersMenu"
                  label="&headersMenu.label;">
              <menupopup id="appmenu_HeadersPopup" onpopupshowing="InitViewHeadersMenu();">
                <menuitem id="appmenu_viewallheaders"
                          type="radio"
                          name="viewheadergroup"
                          label="&headersAllCmd.label;"
                          command="cmd_viewAllHeader"/>
                <menuitem id="appmenu_viewnormalheaders"
                          type="radio"
                          name="viewheadergroup"
                          label="&headersNormalCmd.label;"
                          command="cmd_viewNormalHeader"/>
              </menupopup>
            </menu>
            <menu id="appmenu_viewBodyMenu"
                  label="&bodyMenu.label;">
              <menupopup id="appmenu_viewBodyPopMenu"
                         onpopupshowing="InitAppmenuViewBodyMenu()">
                <menuitem id="appmenu_bodyAllowHTML"
                          type="radio"
                          name="bodyPlaintextVsHTMLPref"
                          label="&bodyAllowHTML.label;"
                          oncommand="MsgBodyAllowHTML()"/>
                <menuitem id="appmenu_bodySanitized"
                          type="radio"
                          name="bodyPlaintextVsHTMLPref"
                          label="&bodySanitized.label;"
                          oncommand="MsgBodySanitized()"/>
                <menuitem id="appmenu_bodyAsPlaintext"
                          type="radio"
                          name="bodyPlaintextVsHTMLPref"
                          label="&bodyAsPlaintext.label;"
                          oncommand="MsgBodyAsPlaintext()"/>
                <menuitem id="appmenu_bodyAllParts"
                          type="radio"
                          name="bodyPlaintextVsHTMLPref"
                          label="&bodyAllParts.label;"
                          oncommand="MsgBodyAllParts()"/>
              </menupopup>
            </menu>
            <menu id="appmenu_viewFeedSummary"
                  label="&bodyMenuFeed.label;">
              <menupopup id="appmenu_viewFeedSummaryPopupMenu"
                         onpopupshowing="InitAppmenuViewBodyMenu()">
                <menuitem id="appmenu_bodyFeedGlobalWebPage"
                          type="radio"
                          name="viewFeedSummaryGroup"
                          label="&viewFeedWebPage.label;"
                          observes="bodyFeedGlobalWebPage"
                          oncommand="FeedMessageHandler.onSelectPref = 0"/>
                <menuitem id="appmenu_bodyFeedGlobalSummary"
                          type="radio"
                          name="viewFeedSummaryGroup"
                          label="&viewFeedSummary.label;"
                          observes="bodyFeedGlobalSummary"
                          oncommand="FeedMessageHandler.onSelectPref = 1"/>
                <menuitem id="appmenu_bodyFeedPerFolderPref"
                          type="radio"
                          name="viewFeedSummaryGroup"
                          label="&viewFeedSummaryFeedPropsPref.label;"
                          observes="bodyFeedPerFolderPref"
                          oncommand="FeedMessageHandler.onSelectPref = 2"/>
                <menuseparator id="appmenu_viewFeedSummarySeparator"/>
                <menuitem id="appmenu_bodyFeedSummaryAllowHTML"
                          type="radio"
                          name="viewFeedBodyHTMLGroup"
                          label="&bodyAllowHTML.label;"
                          oncommand="MsgFeedBodyRenderPrefs(false, 0, 0)"/>
                <menuitem id="appmenu_bodyFeedSummarySanitized"
                          type="radio"
                          name="viewFeedBodyHTMLGroup"
                          label="&bodySanitized.label;"
                          oncommand="MsgFeedBodyRenderPrefs(false, 3, gDisallow_classes_no_html)"/>
                <menuitem id="appmenu_bodyFeedSummaryAsPlaintext"
                          type="radio"
                          name="viewFeedBodyHTMLGroup"
                          label="&bodyAsPlaintext.label;"
                          oncommand="MsgFeedBodyRenderPrefs(true, 1, gDisallow_classes_no_html)"/>
              </menupopup>
            </menu>
            <menuitem id="appmenu_viewAttachmentsInlineMenuitem"
                      label="&viewAttachmentsInlineCmd.label;"
                      oncommand="ToggleInlineAttachment(event.target)"
                      type="checkbox"
                      checked="true"/>
            <menuseparator id="appmenu_viewAfterAttachmentsSeparator"/>
            <menu id="appmenu_viewFullZoomMenu"
                  label="&fullZoom.label;"
                  onpopupshowing="UpdateFullZoomMenu()">
              <menupopup id="appmenu_viewFullZoomPopupMenu">
                <menuitem id="appmenu_fullZoomEnlarge"
                          label="&fullZoomEnlargeCmd.label;"
                          key="key_fullZoomEnlarge"
                          command="cmd_fullZoomEnlarge"/>
                <menuitem id="appmenu_fullZoomReduce"
                          label="&fullZoomReduceCmd.label;"
                          key="key_fullZoomReduce"
                          command="cmd_fullZoomReduce"/>
                <menuseparator id="appmenu_fullZoomAfterReduceSeparator"/>
                <menuitem id="appmenu_fullZoomReset"
                          label="&fullZoomResetCmd.label;"
                          key="key_fullZoomReset"
                          command="cmd_fullZoomReset"/>
                <menuseparator id="appmenu_fullZoomAfterResetSeparator"/>
                <menuitem id="appmenu_fullZoomToggle"
                          label="&fullZoomToggleCmd.label;"
                          type="checkbox"
                          command="cmd_fullZoomToggle"
                          checked="false"/>
              </menupopup>
            </menu>
            <menu id="appmenu_charsetMenu"
                  onpopupshowing="UpdateCharsetMenu(msgWindow.mailCharacterSet, this);"
                  oncommand="MailSetCharacterSet(event)"
                  label="&charsetMenu.label;"
                  accesskey="&charsetMenu.accesskey;">
              <menupopup id="appmenu_charsetPopup"
                         onpopupshowing="CharsetMenu.build(this, true, this.getAttribute('detectors') != 'false');"/>
            </menu>
            <menuseparator id="appmenu_viewAfterCharsetSeparator"/>
            <menuitem id="appmenu_pageSourceMenuItem"
                      label="&pageSourceCmd.label;"
                      key="key_viewPageSource"
                      command="cmd_viewPageSource"/>
          </menupopup>
        </menu>
        <!-- Go menu -->
        <menu id="appmenu_Go"
              label="&goMenu.label;">
          <menupopup id="appmenu_GoPopup">
            <menu id="appmenu_goNextMenu"
                  label="&nextMenu.label;">
              <menupopup id="appmenu_GoNextPopup">
                <menuitem id="appmenu_nextMsg"
                          label="&nextMsgCmd.label;"
                          key="key_nextMsg"
                          command="cmd_nextMsg"/>
                <menuitem id="appmenu_nextUnreadMsg"
                          label="&nextUnreadMsgCmd.label;"
                          key="key_nextUnreadMsg"
                          command="cmd_nextUnreadMsg"/>
                <menuitem id="appmenu_nextFlaggedMsg"
                          label="&nextStarredMsgCmd.label;"
                          command="cmd_nextFlaggedMsg"/>
                <menuseparator id="appmenu_goNextAfterFlaggedSeparator"/>
                <menuitem id="appmenu_nextUnreadThread"
                          label="&nextUnreadThread.label;"
                          key="key_nextUnreadThread"
                          command="cmd_nextUnreadThread"/>
              </menupopup>
            </menu>
            <menu id="appmenu_goPreviousMenu"
                  label="&prevMenu.label;">
              <menupopup id="appmenu_GoPreviousPopup">
                <menuitem id="appmenu_prevMsg"
                          label="&prevMsgCmd.label;"
                          key="key_previousMsg"
                          command="cmd_previousMsg"/>
                <menuitem id="appmenu_prevUnreadMsg"
                          label="&prevUnreadMsgCmd.label;"
                          key="key_previousUnreadMsg"
                          command="cmd_previousUnreadMsg"/>
                <menuitem id="appmenu_prevFlaggedMsg"
                          label="&prevStarredMsgCmd.label;"
                          command="cmd_previousFlaggedMsg"/>
              </menupopup>
            </menu>
            <menuitem id="appmenu_goForward"
                      label="&goForwardCmd.label;"
                      key="key_goForward"
                      command="cmd_goForward"/>
            <menuitem id="appmenu_goBack"
                      label="&goBackCmd.label;"
                      key="key_goBack"
                      command="cmd_goBack"/>
            <menuseparator id="appmenu_goNextSeparator"/>
            <menuitem id="appmenu_goChat"
                      label="&goChatCmd.label;"
                      key="key_goChat"
                      command="cmd_chat"/>
            <menuseparator id="appmenu_goChatSeparator"/>
            <menu id="appmenu_goFolderMenu"
                  label="&folderMenu.label;"
                  oncommand="gFolderTreeView.selectFolder(event.target._folder, true)">
              <menupopup id="appmenu_GoFolderPopup"
                         type="folder"
                         showFileHereLabel="true"
                         showRecent="true"
                         recentLabel="&contextMoveCopyMsgRecentMenu.label;"/>
            </menu>
            <menuseparator id="appmenu_goFolderSeparator"/>
            <menu id="appmenu_goRecentlyClosedTabs"
                  label="&goRecentlyClosedTabs.label;"
                  observes="cmd_undoCloseTab">
              <menupopup id="appmenu_GoRecentlyClosedTabsPopup"
                         onpopupshowing="return InitRecentlyClosedTabsPopup(this)" />
            </menu>
            <menuseparator id="appmenu_goRecentlyClosedTabsSeparator"/>
            <menuitem id="appmenu_goStartPage"
                      label="&startPageCmd.label;"
                      key="key_goStartPage"
                      command="cmd_goStartPage"/>
          </menupopup>
        </menu>
        <!-- Message menu -->
        <menu id="appmenu_messageMenu"
              label="&msgMenu.label;">
          <menupopup id="appmenu_messageMenuPopup"
                     onpopupshowing="InitAppMessageMenu();">
            <menuitem id="appmenu_newMsgCmd"
                      label="&newMsgCmd.label;"
                      key="key_newMessage2"
                      command="cmd_newMessage"/>
            <menuitem id="appmenu_replyMainMenu"
                      label="&replyMsgCmd.label;"
                      key="key_reply"
                      command="cmd_reply"/>
            <menuitem id="appmenu_replyNewsgroupMainMenu"
                      label="&replyNewsgroupCmd2.label;"
                      key="key_reply"
                      command="cmd_replyGroup"/>
            <menuitem id="appmenu_replySenderMainMenu"
                      label="&replySenderCmd.label;"
                      command="cmd_replySender"/>
            <menuitem id="appmenu_replyToAll"
                      label="&replyToAllMsgCmd.label;"
                      key="key_replyall"
                      command="cmd_replyall"/>
            <menuitem id="appmenu_replyToList"
                      label="&replyToListMsgCmd.label;"
                      key="key_replylist"
                      command="cmd_replylist"/>
            <menuitem id="appmenu_forwardMsg"
                      label="&forwardMsgCmd.label;"
                      key="key_forward"
                      command="cmd_forward"/>
            <menu id="appmenu_forwardAsMenu"
                  label="&forwardAsMenu.label;">
              <menupopup id="appmenu_forwardAsPopup">
                <menuitem id="appmenu_forwardAsInline"
                          label="&forwardAsInline.label;"
                          command="cmd_forwardInline"/>
                <menuitem id="appmenu_forwardAsAttachment"
                          label="&forwardAsAttachmentCmd.label;"
                          command="cmd_forwardAttachment"/>
              </menupopup>
            </menu>
            <menuitem id="appmenu_editMsgAsNew"
                      label="&editAsNewMsgCmd.label;"
                      key="key_editAsNew"
                      command="cmd_editAsNew"/>
            <menuseparator id="appmenu_messageMenuAfterCompositionCommandsSeparator"/>
            <menuitem id="appmenu_openMessageWindowMenuitem"
                      label="&openMessageWindowCmd.label;"
                      key="key_openMessage"
                      command="cmd_openMessage"/>
            <menuitem id="appmenu_openConversationMenuitem"
                      label="&openConversationCmd.label;"
                      key="key_openConversation"
                      command="cmd_openConversation"/>
            <menu id="appmenu_openFeedMessage"
                  label="&openFeedMessage1.label;">
              <menupopup id="appmenu_openFeedMessagePopup">
                <menuitem id="appmenu_openFeedWebPage"
                          type="radio"
                          name="openFeedGroup"
                          label="&openFeedWebPage.label;"
                          oncommand="FeedMessageHandler.onOpenPref = 0"/>
                <menuitem id="appmenu_openFeedSummary"
                          type="radio"
                          name="openFeedGroup"
                          label="&openFeedSummary.label;"
                          oncommand="FeedMessageHandler.onOpenPref = 1"/>
                <menuitem id="appmenu_openFeedWebPageInMessagePane"
                          type="radio"
                          name="openFeedGroup"
                          label="&openFeedWebPageInMP.label;"
                          oncommand="FeedMessageHandler.onOpenPref = 2"/>
              </menupopup>
            </menu>
            <menuseparator id="appmenu_messageAfterOpenMsgSeparator"/>
            <menu id="appmenu_tagMenu"
                  label="&tagMenu.label;"
                  command="cmd_tag">
              <menupopup id="appmenu_tagMenu-tagpopup"
                         onpopupshowing="InitMessageTags(this);">
                <menuitem id="appmenu_addNewTag"
                          label="&addNewTag.label;"
                          command="cmd_addTag"/>
                <menuitem id="appmenu_manageTags"
                          label="&manageTags.label;"
                          command="cmd_manageTags"/>
                <menuseparator id="appmenu_tagMenu-sep-afterTagAddNew"/>
                <menuitem id="appmenu_tagMenu-tagRemoveAll"
                          command="cmd_removeTags"/>
                <menuseparator id="appmenu_tagMenuAfterRemoveSeparator"/>
              </menupopup>
            </menu>
            <menu id="appmenu_markMenu"
                  label="&markMenu.label;">
              <menupopup id="appmenu_MarkPopup"
                         onpopupshowing="InitMessageMark()">
                <menuitem id="appmenu_markReadMenuItem"
                          label="&markAsReadCmd.label;"
                          command="cmd_markAsRead"/>
                <menuitem id="appmenu_markUnreadMenuItem"
                          label="&markAsUnreadCmd.label;"
                          command="cmd_markAsUnread"/>
                <menuitem id="appmenu_markThreadAsRead"
                          label="&markThreadAsReadCmd.label;"
                          key="key_markThreadAsRead"
                          command="cmd_markThreadAsRead"/>
                <menuitem id="appmenu_markReadByDate"
                          label="&markReadByDateCmd.label;"
                          key="key_markReadByDate"
                          command="cmd_markReadByDate"/>
                <menuitem id="appmenu_markAllRead"
                          label="&markAllReadCmd.label;"
                          key="key_markAllRead"
                          command="cmd_markAllRead"/>
                <menuseparator id="markMenuAfterAllReadSeparator"/>
                <menuitem id="appmenu_markFlaggedMenuItem"
                          type="checkbox"
                          label="&markStarredCmd.label;"
                          key="key_toggleFlagged"
                          command="cmd_markAsFlagged"/>
                <menuseparator id="markMenuAfterFlaggedSeparator"/>
                <menuitem id="appmenu_markAsJunk"
                          label="&markAsJunkCmd.label;"
                          key="key_markJunk"
                          command="cmd_markAsJunk"/>
                <menuitem id="appmenu_markAsNotJunk"
                          label="&markAsNotJunkCmd.label;"
                          key="key_markNotJunk"
                          command="cmd_markAsNotJunk"/>
                <menuitem id="appmenu_recalculateJunkScore"
                          label="&recalculateJunkScoreCmd.label;"
                          command="cmd_recalculateJunkScore"/>
              </menupopup>
            </menu>
            <menuseparator id="appmenu_messageMenuAfterMarkSeparator"/>
            <menuitem id="appmenu_archiveMainMenu"
                      label="&archiveMsgCmd.label;"
                      key="key_archive"
                      command="cmd_archive"/>
            <menuitem id="appmenu_cancel"
                      command="cmd_cancel"
                      label="&cancelNewsMsgCmd.label;"/>
            <menu id="appmenu_moveMenu"
                  label="&moveMsgToMenu.label;"
                  oncommand="MsgMoveMessage(event.target._folder)">
              <menupopup type="folder"
                         mode="filing"
                         showFileHereLabel="true"
                         showRecent="true"
                         recentLabel="&moveCopyMsgRecentMenu.label;"/>
            </menu>
            <menu id="appmenu_copyMenu"
                  label="&copyMsgToMenu.label;"
                  oncommand="MsgCopyMessage(event.target._folder)">
              <menupopup type="folder"
                         mode="filing"
                         showFileHereLabel="true"
                         showRecent="true"
                         recentLabel="&moveCopyMsgRecentMenu.label;"/>
            </menu>
            <menuitem id="appmenu_moveToFolderAgain"
                      command="cmd_moveToFolderAgain"
                      key="key_moveToFolderAgain"
                      label="&moveToFolderAgain.label;"/>
            <menuseparator id="appmenu_messageMenuAfterMoveCommandsSeparator"/>
            <menuitem id="appmenu_createFilter"
                      label="&createFilter.label;"
                      command="cmd_createFilterFromMenu"/>
            <menuseparator id="appmenu_threadItemsSeparator"/>
            <menuitem label="&killThreadMenu.label;"
                      id="appmenu_killThread"
                      key="key_killThread"
                      type="checkbox"
                      command="cmd_killThread"/>
            <menuitem label="&killSubthreadMenu.label;"
                      id="appmenu_killSubthread"
                      key="key_killSubthread"
                      type="checkbox"
                      command="cmd_killSubthread"/>
            <menuitem label="&watchThreadMenu.label;"
                      id="appmenu_watchThread"
                      key="key_watchThread"
                      type="checkbox"
                      command="cmd_watchThread"/>
          </menupopup>
        </menu>
        <!-- Tools menu -->
        <menu id="appmenu_tasksMenu"
              label="&tasksMenu.label;">
          <menupopup id="appmenu_taskPopup">
            <menuitem hidden="true"
                      id="appmenu_tasksMenuMail"
                      class="menuitem-iconic menu-iconic"
                      label="&messengerCmd.label;"
                      key="key_mail"
                      oncommand="toMessengerWindow();"/>
            <menuitem id="appmenu_addressBook"
                      label="&addressBookCmd.label;"
                      key="key_addressbook"
                      oncommand="toOpenWindowByType('mail:addressbook', 'chrome://messenger/content/addressbook/addressbook.xul');"/>
            <menuseparator id="devToolsSeparator"/>
            <menuitem id="appmenu_openSavedFilesWnd"
                      label="&savedFiles.label;"
                      key="key_savedFiles"
                      oncommand="openSavedFilesWnd();"/>
            <menu id="appmenu_imAccountsStatus"
                  label="&imAccountsStatus.label;"
                  oncommand="chatHandler.setStatusMenupopupCommand(event);">
              <menupopup id="appmenu_imStatusMenupopup">
                <menuitem id="appmenu_imStatusAvailable"
                          status="available"
                          label="&imStatus.available;"
                          class="menuitem-iconic"/>
                <menuitem id="appmenu_imStatusUnavailable"
                          status="unavailable"
                          label="&imStatus.unavailable;"
                          class="menuitem-iconic"/>
                <menuseparator id="appmenu_imStatusOfflineSeparator"/>
                <menuitem id="appmenu_imStatusOffline"
                          status="offline"
                          label="&imStatus.offline;"
                          class="menuitem-iconic"/>
                <menuseparator id="appmenu_imStatusShowAccountsSeparator"/>
                <menuitem id="appmenu_imStatusShowAccounts"
                          label="&imStatus.showAccounts;"/>
              </menupopup>
            </menu>
            <menuitem id="appmenu_joinChatMenuItem"
                      label="&joinChatCmd.label;"
                      oncommand="chatHandler.joinChat();"/>
            <menuseparator id="appmenu_afterChatSeparator"/>
            <menuitem id="appmenu_runJunkControls"
                      label="&runJunkControls.label;"
                      command="cmd_runJunkControls"/>
            <menuitem id="appmenu_deleteJunk"
                      label="&deleteJunk.label;"
                      command="cmd_deleteJunk"/>
            <menuseparator id="tasksMenuAfterDeleteSeparator"/>
            <menuitem id="appmenu_import"
                      label="&importCmd.label;"
                      oncommand="toImport();"/>
            <menuitem id="appmenu_javascriptConsole"
                      label="&errorConsoleCmd.label;"
                      key="key_errorConsole"
                      oncommand="toJavaScriptConsole();"/>
            <menuitem id="appmenu_sanitizeHistory"
                      label="&clearRecentHistory.label;"
                      oncommand="toSanitize();"/>
          </menupopup>
        </menu>
        <!-- Help menu -->
        <splitmenu id="appmenu_help"
                   label="&helpMenuWin.label;"
                   oncommand="openSupportURL();">
            <menupopup id="appmenu_helpMenupopup">
              <menuitem id="appmenu_openHelp"
                        label="&openHelp.label;"
                        key="key_openHelp"
                        oncommand="openSupportURL();"/>
              <menuitem id="appmenu_whatsNew"
                        label="&whatsNewCmd.label;"
                        oncommand="openWhatsNew();"/>
              <menuitem id="appmenu_releaseNotes"
                        label="&releaseCmd2.label;"
                        oncommand="openFormattedURL('app.releaseNotesURL');"/>
              <menuseparator/>
              <menuitem id="appmenu_troubleshootingInfo"
                        label="&helpTroubleshootingInfo.label;"
                        oncommand="AboutSupportOverlay.openInNewTab();"/>
              <menuseparator/>
              <menuitem id="appmenu_safeMode"
                  label="&helpSafeMode.label;"
                  oncommand="safeModeRestart();"/>
              <menuseparator/>
              <menuitem id="appmenu_about"
                  label="&aboutMenuCmd.label;"
                  oncommand="openAboutDialog();"/>
            </menupopup>
        </splitmenu>
      </vbox>
    </hbox>
  </menupopup>
</popupset>

<!-- The reason we put the menubar inside a toolbox is due to the labelalign and
     defaultlabelalign attributes that the toolbars might expect from their
     parent toolboxes.  This lets us control how toolbar buttons appear in the
     toolbars by default.

     We also put the toolbars inside a toolbox named "navigation-toolbox" to
     leverage overlays, since we currently have several windows (3pane,
     message reader, compose, address book) that take advantage of these
     toolbars.
-->
<toolbox id="navigation-toolbox" class="toolbox-top" labelalign="end" defaultlabelalign="end">
  <!-- Menu -->
  <toolbar type="menubar" id="mail-toolbar-menubar2" class="chromeclass-menubar" customizable="true"
           toolboxid="mail-toolbox"
           defaultset="menubar-items"
           context="toolbar-context-menu"
           mode="icons"
           insertbefore="tabs-toolbar"
           prependmenuitem="true">
    <toolbaritem id="menubar-items" align="center">
      <menubar id="mail-menubar" style="border:0px;padding:0px;margin:0px;-moz-appearance:none">
        <!-- File -->
        <menu id="menu_File">
          <menupopup id="menu_FilePopup" onpopupshowing="file_init();">
          <menu id="menu_New">
            <menupopup id="menu_NewPopup" onpopupshowing="menu_new_init();">
              <menuitem id="newNewMsgCmd" label="&newNewMsgCmd.label;"
                        accesskey="&newNewMsgCmd.accesskey;"
                        key="key_newMessage2"
                        command="cmd_newMessage"/>
              <menuitem id="menu_newFolder" label="&newFolderCmd.label;"
                         oncommand="gFolderTreeController.newFolder();"
                         accesskey="&newFolderCmd.accesskey;"/>
              <menuitem id="menu_newVirtualFolder" label="&newVirtualFolderCmd.label;"
                         oncommand="gFolderTreeController.newVirtualFolder();"
                         accesskey="&newVirtualFolderCmd.accesskey;"/>
              <menuseparator id="newAccountPopupMenuSeparator"/>
              <menuitem id="newCreateEmailAccountMenuItem"
                        label="&newCreateEmailAccountCmd.label;"
                        accesskey="&newCreateEmailAccountCmd.accesskey;"
                        oncommand="NewMailAccountProvisioner(msgWindow);"/>
              <menuitem id="newMailAccountMenuItem"
                        label="&newExistingEmailAccountCmd.label;"
                        accesskey="&newExistingEmailAccountCmd.accesskey;"
                        oncommand="NewMailAccount(msgWindow);"/>
              <menuitem id="newIMAccountMenuItem"
                        label="&newIMAccountCmd.label;"
                        accesskey="&newIMAccountCmd.accesskey;"
                        oncommand="openIMAccountWizard();"/>
              <menuitem id="newFeedAccountMenuItem"
                        label="&newFeedAccountCmd.label;"
                        accesskey="&newFeedAccountCmd.accesskey;"
                        oncommand="AddFeedAccount();"/>
              <menuitem id="newAccountMenuItem"
                        label="&newOtherAccountsCmd.label;"
                        accesskey="&newOtherAccountsCmd.accesskey;"
                        oncommand="MsgAccountWizard();"/>
              <menuseparator id="newPopupMenuSeparator"/>
              <menuitem id="menu_newCard"/>
              <menuitem id="newIMContactMenuItem"
                        label="&newIMContactCmd.label;"
                        accesskey="&newIMContactCmd.accesskey;"
                        oncommand="chatHandler.addBuddy();"/>
            </menupopup>
          </menu>
          <menuitem id="openMessageFileMenuitem" label="&openMessageFileCmd.label;"
            accesskey="&openMessageFileCmd.accesskey;"
            oncommand="MsgOpenFromFile();"/>
          <menuitem id="menu_close"/>
          <menuseparator id="fileMenuAfterCloseSeparator"/>
          <menu id="menu_saveAs" label="&saveAsMenu.label;" accesskey="&saveAsMenu.accesskey;">
            <menupopup id="menu_SavePopup">
              <menuitem id="menu_saveAsFile" label="&saveAsFileCmd.label;"
               accesskey="&saveAsFileCmd.accesskey;"
               key="key_saveAsFile"
               command="cmd_saveAsFile"/>
              <menuitem id="menu_saveAsTemplate" label="&saveAsTemplateCmd.label;"
               accesskey="&saveAsTemplateCmd.accesskey;"
               command="cmd_saveAsTemplate"/>
            </menupopup>
          </menu>
          <menuseparator id="fileMenuAfterSaveSeparator"/>
          <menu label="&getNewMsgForCmd.label;" accesskey="&getNewMsgForCmd.accesskey;"
                id="menu_getAllNewMsg"
                oncommand="MsgGetMessagesForAccount(event.target._folder)">
            <menupopup type="folder" mode="getMail" id="menu_getAllNewMsgPopup"
                       expandFolders="false">
              <menuitem id="menu_getnewmsgs_all_accounts"
                        label="&getAllNewMsgCmdPopupMenu.label;"
                        accesskey="&getAllNewMsgCmdPopupMenu.accesskey;"
                        key="key_getAllNewMessages"
                        command="cmd_getMsgsForAuthAccounts"/>
              <menuitem id="menu_getnewmsgs_current_account"
                        label="&getNewMsgCurrentAccountCmdPopupMenu.label;"
                        accesskey="&getNewMsgCurrentAccountCmdPopupMenu.accesskey;"
                        key="key_getNewMessages"
                        command="cmd_getNewMessages"/>
              <menuseparator/>
            </menupopup>
          </menu>
          <menuitem id="menu_getnextnmsg" label="&getNextNMsgCmd.label;" accesskey="&getNextNMsgCmd.accesskey;"
                    command="cmd_getNextNMessages"/>
          <menuitem id="menu_sendunsentmsgs" label="&sendUnsentCmd.label;"
                    accesskey="&sendUnsentCmd.accesskey;" command="cmd_sendUnsentMsgs"/>
          <menuitem id="menu_subscribe" label="&subscribeCmd.label;"
                    accesskey="&subscribeCmd.accesskey;" oncommand="MsgSubscribe();"/>
          <menuseparator id="fileMenuAfterSubscribeSeparator"/>
          <menuitem id="menu_deleteFolder" label="&deleteFolder.label;"
                 accesskey="&deleteFolder.accesskey;"
                 command="cmd_deleteFolder"/>
          <menuitem id="menu_renameFolder" label="&renameFolder.label;"
                 accesskey="&renameFolder.accesskey;"
                 key="key_renameFolder"
                 command="cmd_renameFolder"/>
          <menuitem id="menu_compactFolder" 
                    label="&compactFolders.label;" 
                    accesskey="&compactFolders.accesskey;" 
                    command="cmd_compactFolder"/>
          <menuitem id="menu_emptyTrash" label="&emptyTrashCmd.label;"
                 accesskey="&emptyTrashCmd.accesskey;"
                 command="cmd_emptyTrash"/>
          <menuseparator id="trashMenuSeparator"/>
          <menu id="offlineMenuItem" label="&offlineMenu.label;" accesskey="&offlineMenu.accesskey;">
            <menupopup id="menu_OfflinePopup">
              <menuitem id="goOfflineMenuItem" type="checkbox" label="&offlineGoOfflineCmd.label;"
                        accesskey="&offlineGoOfflineCmd.accesskey;" oncommand="MailOfflineMgr.toggleOfflineStatus();"/>
              <menuseparator id="offlineMenuAfterGoSeparator"/>
              <menuitem id="menu_synchronizeOffline"
                        label="&synchronizeOfflineCmd.label;"
                        accesskey="&synchronizeOfflineCmd.accesskey;"
                        command="cmd_synchronizeOffline"/>
              <menuitem id="menu_settingsOffline"
                        label="&settingsOfflineCmd2.label;"
                        accesskey="&settingsOfflineCmd2.accesskey;"
                        command="cmd_settingsOffline"/>
              <menuseparator id="offlineMenuAfterSettingsSeparator"/>
              <menuitem id="menu_downloadFlagged"
                        label="&downloadStarredCmd.label;"
                        accesskey="&downloadStarredCmd.accesskey;"
                        command="cmd_downloadFlagged"/>
              <menuitem id="menu_downloadSelected"
                        label="&downloadSelectedCmd.label;"
                        accesskey="&downloadSelectedCmd.accesskey;"
                        command="cmd_downloadSelected"/>
            </menupopup>
          </menu>
          <menuseparator id="fileMenuAfterOfflineSeparator"/>
          <menuitem id="printSetupMenuItem" label="&printSetupCmd.label;" accesskey="&printSetupCmd.accesskey;" command="cmd_printSetup"/>
          <menuitem id="printMenuItem" key="key_print" label="&printCmd.label;" accesskey="&printCmd.accesskey;" command="cmd_print"/>
        </menupopup>
      </menu>

    <!-- Edit -->
    <menu id="menu_Edit" oncommand="CommandUpdate_UndoRedo();">
      <menupopup id="menu_EditPopup" onpopupshowing="InitEditMessagesMenu()">
        <menuitem id="menu_undo" label="&undoDefaultCmd.label;" accesskey="&undoDefaultCmd.accesskey;" key="key_undo" command="cmd_undo"/>
        <menuitem id="menu_redo" label="&redoDefaultCmd.label;" accesskey="&redoDefaultCmd.accesskey;" key="key_redo" command="cmd_redo"/>
        <menuseparator id="editMenuAfterRedoSeparator"/>
        <menuitem id="menu_cut"/>
        <menuitem id="menu_copy"/>
        <menuitem id="menu_paste"/>
        <menuitem id="menu_delete" command="cmd_delete"/>
        <menuseparator id="editMenuAfterDeleteSeparator"/>
        <menu id="menu_select" label="&selectMenu.label;" accesskey="&selectMenu.accesskey;">
          <menupopup id="menu_SelectPopup">
            <menuitem id="menu_SelectAll" label="&all.label;"
                      accesskey="&all.accesskey;" key="key_selectAll"
                      command="cmd_selectAll"/>
            <menuseparator id="selectMenuSeparator"/>
            <menuitem id="menu_selectThread" label="&selectThreadCmd.label;"
             accesskey="&selectThreadCmd.accesskey;"
             key="key_selectThread"
             command="cmd_selectThread"/>
            <menuitem id="menu_selectFlagged"
                      label="&selectFlaggedCmd.label;"
                      accesskey="&selectFlaggedCmd.accesskey;"
                      command="cmd_selectFlagged"/>
          </menupopup>
        </menu>
        <menuseparator id="editMenuAfterSelectSeparator"/>
        <menu id="menu_find" label="&findMenu.label;" accesskey="&findMenu.accesskey;">
          <menupopup id="menu_FindPopup">
            <menuitem id="menu_findCmd" label="&findCmd.label;" key="key_find" accesskey="&findCmd.accesskey;" command="cmd_find"/>
            <menuitem id="menu_findAgainCmd" label="&findAgainCmd.label;" key="key_findAgain" accesskey="&findAgainCmd.accesskey;" command="cmd_findAgain"/>
            <menuseparator id="editMenuAfterFindSeparator"/>
            <menuitem id="searchMailCmd" label="&searchMailCmd.label;"
                      key="key_searchMail"
                      accesskey="&searchMailCmd.accesskey;"
                      command="cmd_search"/>
            <menuitem id="searchAddressesCmd" label="&searchAddressesCmd.label;"
                      accesskey="&searchAddressesCmd.accesskey;"
                      oncommand="MsgSearchAddresses()"/>
          </menupopup>
        </menu>
        <menuseparator id="editPropertiesSeparator"/>
        <menuitem id="menu_favoriteFolder"
                  type="checkbox"
                  label="&menuFavoriteFolder.label;"
                  accesskey="&menuFavoriteFolder.accesskey;"
                  checked="false"
                  oncommand="ToggleFavoriteFolderFlag();"/>
        <menuitem id="menu_properties" label="&folderPropsCmd2.label;"
                  accesskey="&folderPropsCmd.accesskey;"
                  command="cmd_properties"/>
      </menupopup>
    </menu>

    <!-- View -->
    <menu id="menu_View">
      <menupopup id="menu_View_Popup" onpopupshowing="view_init();">
        <menu id="menu_Toolbars" onpopupshowing="onViewToolbarsPopupShowing(event, 'mail-toolbox');">
          <menupopup id="view_toolbars_popup">
            <menuitem id="menu_showTaskbar" type="checkbox"/>
            <menuseparator id="viewMenuBeforeCustomizeMailToolbarsSeparator"/>
            <menuitem id="customizeMailToolbars"
                      command="cmd_CustomizeMailToolbar"
                      label="&customizeToolbar.label;"
                      accesskey="&customizeToolbar.accesskey;"/>
          </menupopup>
        </menu>
        <menu id="menu_MessagePaneLayout" label="&messagePaneLayoutStyle.label;" accesskey="&messagePaneLayoutStyle.accesskey;">
          <menupopup id="view_layout_popup" onpopupshowing="InitViewLayoutStyleMenu(event)">
            <menuitem id="messagePaneClassic" type="radio" label="&messagePaneClassic.label;" name="viewlayoutgroup"
                      accesskey="&messagePaneClassic.accesskey;" command="cmd_viewClassicMailLayout"/>
            <menuitem id="messagePaneWide" type="radio" label="&messagePaneWide.label;" name="viewlayoutgroup"
                      accesskey="&messagePaneWide.accesskey;" command="cmd_viewWideMailLayout"/>
            <menuitem id="messagePaneVertical" type="radio" label="&messagePaneVertical.label;" name="viewlayoutgroup"
                      accesskey="&messagePaneVertical.accesskey;" command="cmd_viewVerticalMailLayout"/>
            <menuseparator id="viewMenuAfterPaneVerticalSeparator"/>
            <menuitem id="menu_showFolderPane" type="checkbox" label="&showFolderPaneCmd.label;"
                      accesskey="&showFolderPaneCmd.accesskey;" command="cmd_toggleFolderPane"/>
            <menuitem id="menu_showMessage" type="checkbox" label="&showMessageCmd.label;" key="key_toggleMessagePane"
                      accesskey="&showMessageCmd.accesskey;" command="cmd_toggleMessagePane"/>
          </menupopup>
        </menu>
        <menu id="menu_FolderViews" label="&folderView.label;" accesskey="&folderView.accesskey;">
          <menupopup id="menu_FolderViewsPopup"
                     onpopupshowing="InitViewFolderViewsMenu(event)">
            <menuitem id="menu_allFolders" value="all"
                      label="&allFolders.label;"
                      accesskey="&allFolders.accesskey;"
                      type="radio" name="viewmessages"
                      oncommand="gFolderTreeView.toggleMode(this.value);"/>
            <menuitem id="menu_smartFolders" value="smart"
                      label="&unifiedFolders.label;"
                      accesskey="&unifiedFolders.accesskey;"
                      type="radio" name="viewmessages"
                      oncommand="gFolderTreeView.toggleMode(this.value);"/>
            <menuitem id="menu_unreadFolders" value="unread"
                      label="&unreadFolders.label;"
                      accesskey="&unreadFolders.accesskey;"
                      type="radio" name="viewmessages"
                      oncommand="gFolderTreeView.toggleMode(this.value);"/>
            <menuitem id="menu_favoriteFolders" value="favorite"
                      label="&favoriteFolders.label;"
                      accesskey="&favoriteFolders.accesskey;"
                      type="radio" name="viewmessages"
                      oncommand="gFolderTreeView.toggleMode(this.value);"/>
            <menuitem id="menu_recentFolders" value="recent"
                      label="&recentFolders.label;"
                      accesskey="&recentFolders.accesskey;"
                      type="radio" name="viewmessages"
                      oncommand="gFolderTreeView.toggleMode(this.value);"/>
            <menuseparator id="menu_compactViewSeparator"/>
            <menuitem id="menu_compactFolderView"
                      label="&compactVersion.label;"
                      accesskey="&compactVersion.accesskey;"
                      type="checkbox"
                      oncommand="gFolderTreeView.toggleCompact(this.getAttribute('checked') == 'true');"/>
          </menupopup>
        </menu>
        <menuseparator id="viewSortMenuSeparator"/>
        <menu id="viewSortMenu" accesskey="&sortMenu.accesskey;" label="&sortMenu.label;">
          <menupopup id="menu_viewSortPopup" onpopupshowing="InitViewSortByMenu()">
            <menuitem id="sortByDateMenuitem" type="radio" name="sortby" label="&sortByDateCmd.label;" accesskey="&sortByDateCmd.accesskey;" oncommand="MsgSortThreadPane('byDate')"/>
            <menuitem id="sortByReceivedMenuitem" type="radio" name="sortby" label="&sortByReceivedCmd.label;" accesskey="&sortByReceivedCmd.accesskey;" oncommand="MsgSortThreadPane('byReceived')"/>
            <menuitem id="sortByFlagMenuitem" type="radio" name="sortby" label="&sortByStarCmd.label;" accesskey="&sortByStarCmd.accesskey;" oncommand="MsgSortThreadPane('byFlagged')"/>
            <menuitem id="sortByOrderReceivedMenuitem" type="radio" name="sortby" label="&sortByOrderReceivedCmd.label;"  accesskey="&sortByOrderReceivedCmd.accesskey;" oncommand="MsgSortThreadPane('byId')"/>
            <menuitem id="sortByPriorityMenuitem" type="radio" name="sortby" label="&sortByPriorityCmd.label;" accesskey="&sortByPriorityCmd.accesskey;" oncommand="MsgSortThreadPane('byPriority')"/>
            <menuitem id="sortByFromMenuitem" type="radio" name="sortby" label="&sortByFromCmd.label;" accesskey="&sortByFromCmd.accesskey;" oncommand="MsgSortThreadPane('byAuthor')"/>
            <menuitem id="sortByRecipientMenuitem" type="radio" name="sortby" label="&sortByRecipientCmd.label;" accesskey="&sortByRecipientCmd.accesskey;" oncommand="MsgSortThreadPane('byRecipient')"/>
            <menuitem id="sortBySizeMenuitem" type="radio" name="sortby" label="&sortBySizeCmd.label;" accesskey="&sortBySizeCmd.accesskey;" oncommand="MsgSortThreadPane('bySize')"/>
            <menuitem id="sortByStatusMenuitem" type="radio" name="sortby" label="&sortByStatusCmd.label;" accesskey="&sortByStatusCmd.accesskey;" oncommand="MsgSortThreadPane('byStatus')"/>
            <menuitem id="sortBySubjectMenuitem" type="radio" name="sortby" label="&sortBySubjectCmd.label;" accesskey="&sortBySubjectCmd.accesskey;" oncommand="MsgSortThreadPane('bySubject')"/>
            <menuitem id="sortByUnreadMenuitem" type="radio" name="sortby" label="&sortByUnreadCmd.label;"  accesskey="&sortByUnreadCmd.accesskey;" oncommand="MsgSortThreadPane('byUnread')"/>
            <menuitem id="sortByTagsMenuitem" type="radio" name="sortby" label="&sortByTagsCmd.label;" accesskey="&sortByTagsCmd.accesskey;" oncommand="MsgSortThreadPane('byTags')"/>
            <menuitem id="sortByJunkStatusMenuitem" type="radio" name="sortby" label="&sortByJunkStatusCmd.label;" accesskey="&sortByJunkStatusCmd.accesskey;" oncommand="MsgSortThreadPane('byJunkStatus')"/>
            <menuitem id="sortByAttachmentsMenuitem" type="radio" name="sortby" label="&sortByAttachmentsCmd.label;" accesskey="&sortByAttachmentsCmd.accesskey;" oncommand="MsgSortThreadPane('byAttachments')"/>
            <menuseparator id="sortAfterAttachmentSeparator"/>
            <menuitem id="sortAscending" type="radio" name="sortdirection" label="&sortAscending.label;" accesskey="&sortAscending.accesskey;" oncommand="MsgSortAscending()"/>
            <menuitem id="sortDescending" type="radio" name="sortdirection" label="&sortDescending.label;" accesskey="&sortDescending.accesskey;" oncommand="MsgSortDescending()"/>
            <menuseparator id="sortAfterDescendingSeparator"/>
            <menuitem id="sortThreaded" type="radio" name="threaded" label="&sortThreaded.label;" accesskey="&sortThreaded.accesskey;" oncommand="MsgSortThreaded();"/>
            <menuitem id="sortUnthreaded" type="radio" name="threaded" label="&sortUnthreaded.label;" accesskey="&sortUnthreaded.accesskey;" oncommand="MsgSortUnthreaded();"/>
            <menuitem id="groupBySort" type="radio" name="group" label="&groupBySort.label;" accesskey="&groupBySort.accesskey;" oncommand="MsgGroupBySort();"/>
          </menupopup>
        </menu>
        <menu id="viewMessageViewMenu" label="&msgsMenu.label;" accesskey="&msgsMenu.accesskey;"
              command="mailHideMenus" oncommand="ViewChangeByMenuitem(event.target);">
            <menupopup id="viewMessagePopup" onpopupshowing="RefreshViewPopup(this, false);">
              <menuitem id="viewMessageAll"    value="0" type="radio" label="&viewAll.label;" accesskey="&viewAll.accesskey;"/>
              <menuitem id="viewMessageUnread" value="1" type="radio" label="&viewUnread.label;" accesskey="&viewUnread.accesskey;"/>
              <menuitem id="viewMessageNotDeleted" value="3" type="radio" label="&viewNotDeleted.label;" accesskey="&viewNotDeleted.accesskey;"/>
              <menuseparator id="messageViewAfterUnreadSeparator"/>
              <menu id="viewMessageTags" label="&viewTags.label;" accesskey="&viewTags.accesskey;">
                <menupopup id="viewMessageTagsPopup" onpopupshowing="RefreshTagsPopup(this, false);"/>
              </menu>
              <menu id="viewMessageCustomViews" label="&viewCustomViews.label;" accesskey="&viewCustomViews.accesskey;">
                <menupopup id="viewMessageCustomViewsPopup" onpopupshowing="RefreshCustomViewsPopup(this, false);"/>
              </menu>
              <menuseparator id="messageViewAfterCustomSeparator"/>
              <menuitem id="viewMessageVirtualFolder" value="7" label="&viewVirtualFolder.label;" accesskey="&viewVirtualFolder.accesskey;"/>
              <menuitem id="viewMessageCustomize"     value="8" label="&viewCustomizeView.label;" accesskey="&viewCustomizeView.accesskey;"/>
            </menupopup>
          </menu>

          <menu label="&threads.label;" id="viewMessagesMenu" accesskey="&threads.accesskey;">
            <menupopup id="menu_ThreadsPopup" onpopupshowing="InitViewMessagesMenu()">
              <menuitem id="viewAllMessagesMenuItem" type="radio" name="viewmessages" label="&allMsgsCmd.label;" accesskey="&allMsgsCmd.accesskey;" disabled="true" command="cmd_viewAllMsgs"/>
              <menuitem id="viewUnreadMessagesMenuItem" type="radio" name="viewmessages" label="&unreadMsgsCmd.label;" accesskey="&unreadMsgsCmd.accesskey;" disabled="true" command="cmd_viewUnreadMsgs"/>
              <menuitem id="viewThreadsWithUnreadMenuItem" type="radio" name="viewmessages" label="&threadsWithUnreadCmd.label;" accesskey="&threadsWithUnreadCmd.accesskey;" disabled="true" command="cmd_viewThreadsWithUnread"/>
              <menuitem id="viewWatchedThreadsWithUnreadMenuItem" type="radio" name="viewmessages" label="&watchedThreadsWithUnreadCmd.label;" accesskey="&watchedThreadsWithUnreadCmd.accesskey;" disabled="true" command="cmd_viewWatchedThreadsWithUnread"/>
              <menuseparator id="threadsAfterWatchedSeparator"/>
              <menuitem id="viewIgnoredThreadsMenuItem" type="checkbox" label="&ignoredThreadsCmd.label;" disabled="true" command="cmd_viewIgnoredThreads" accesskey="&ignoredThreadsCmd.accesskey;"/>
              <menuseparator id="threadsAfterIgnoredSeparator"/>
              <menuitem id="menu_expandAllThreads" label="&expandAllThreadsCmd.label;" accesskey="&expandAllThreadsCmd.accesskey;" key="key_expandAllThreads" disabled="true" command="cmd_expandAllThreads"/>
              <menuitem id="collapseAllThreads" label="&collapseAllThreadsCmd.label;" accesskey="&collapseAllThreadsCmd.accesskey;" key="key_collapseAllThreads" disabled="true" command="cmd_collapseAllThreads"/>
            </menupopup>
          </menu>
          <menuseparator id="viewAfterThreadsSeparator"/>
          <menu id="viewheadersmenu" label="&headersMenu.label;" accesskey="&headersMenu.accesskey;">
            <menupopup id="menu_HeadersPopup" onpopupshowing="InitViewHeadersMenu();">
              <menuitem id="viewallheaders"
               type="radio"
               name="viewheadergroup"
               label="&headersAllCmd.label;"
               accesskey="&headersAllCmd.accesskey;"
               command="cmd_viewAllHeader"/>
              <menuitem id="viewnormalheaders"
               type="radio"
               name="viewheadergroup"
               label="&headersNormalCmd.label;"
               accesskey="&headersNormalCmd.accesskey;"
               command="cmd_viewNormalHeader"/>
            </menupopup>
          </menu>
          <menu id="viewBodyMenu" accesskey="&bodyMenu.accesskey;" label="&bodyMenu.label;">
            <menupopup id="viewBodyPopMenu" onpopupshowing="InitViewBodyMenu()">
              <menuitem id="bodyAllowHTML" type="radio" name="bodyPlaintextVsHTMLPref" label="&bodyAllowHTML.label;"
                        accesskey="&bodyAllowHTML.accesskey;" oncommand="MsgBodyAllowHTML()"/>
              <menuitem id="bodySanitized" type="radio" name="bodyPlaintextVsHTMLPref" label="&bodySanitized.label;"
                        accesskey="&bodySanitized.accesskey;"
                        oncommand="MsgBodySanitized()"/>
              <menuitem id="bodyAsPlaintext" type="radio" name="bodyPlaintextVsHTMLPref" label="&bodyAsPlaintext.label;"
                        accesskey="&bodyAsPlaintext.accesskey;" oncommand="MsgBodyAsPlaintext()"/>
              <menuitem id="bodyAllParts" type="radio" name="bodyPlaintextVsHTMLPref" label="&bodyAllParts.label;"
                        accesskey="&bodyAllParts.accesskey;" oncommand="MsgBodyAllParts()"/>
            </menupopup>
          </menu>
          <menu id="viewFeedSummary" 
                label="&bodyMenuFeed.label;" 
                accesskey="&bodyMenuFeed.accesskey;">
            <menupopup id="viewFeedSummaryPopupMenu" 
                       onpopupshowing="InitViewBodyMenu()">
              <menuitem id="bodyFeedGlobalWebPage"
                        type="radio"
                        name="viewFeedSummaryGroup"
                        label="&viewFeedWebPage.label;"
                        accesskey="&viewFeedWebPage.accesskey;"
                        oncommand="FeedMessageHandler.onSelectPref = 0"/>
              <menuitem id="bodyFeedGlobalSummary"
                        type="radio"
                        name="viewFeedSummaryGroup"
                        label="&viewFeedSummary.label;"
                        accesskey="&viewFeedSummary.accesskey;"
                        oncommand="FeedMessageHandler.onSelectPref = 1"/>
              <menuitem id="bodyFeedPerFolderPref"
                        type="radio"
                        name="viewFeedSummaryGroup"
                        label="&viewFeedSummaryFeedPropsPref.label;"
                        accesskey="&viewFeedSummaryFeedPropsPref.accesskey;"
                        oncommand="FeedMessageHandler.onSelectPref = 2"/>
              <menuseparator id="viewFeedSummarySeparator"/>
              <menuitem id="bodyFeedSummaryAllowHTML" 
                        type="radio" 
                        name="viewFeedBodyHTMLGroup"
                        label="&bodyAllowHTML.label;" 
                        accesskey="&bodyAllowHTML.accesskey;"
                        oncommand="MsgFeedBodyRenderPrefs(false, 0, 0)"/>
              <menuitem id="bodyFeedSummarySanitized" 
                        type="radio" 
                        name="viewFeedBodyHTMLGroup"
                        label="&bodySanitized.label;" 
                        accesskey="&bodySanitized.accesskey;"
                        oncommand="MsgFeedBodyRenderPrefs(false, 3, gDisallow_classes_no_html)"/>
              <menuitem id="bodyFeedSummaryAsPlaintext" 
                        type="radio" 
                        name="viewFeedBodyHTMLGroup"
                        label="&bodyAsPlaintext.label;" 
                        accesskey="&bodyAsPlaintext.accesskey;"
                        oncommand="MsgFeedBodyRenderPrefs(true, 1, gDisallow_classes_no_html)"/>
            </menupopup>
          </menu>
          <menuitem id="viewAttachmentsInlineMenuitem" label="&viewAttachmentsInlineCmd.label;" accesskey="&viewAttachmentsInlineCmd.accesskey;"
            oncommand="ToggleInlineAttachment(event.target)" type="checkbox" checked="true"/>
          <menuseparator id="viewAfterAttachmentsSeparator"/>
          <menu id="viewFullZoomMenu" label="&fullZoom.label;" accesskey="&fullZoom.accesskey;"
                onpopupshowing="UpdateFullZoomMenu()">
            <menupopup id="viewFullZoomPopupMenu">
              <menuitem id="menu_fullZoomEnlarge" key="key_fullZoomEnlarge"
                        label="&fullZoomEnlargeCmd.label;"
                        accesskey="&fullZoomEnlargeCmd.accesskey;"
                        command="cmd_fullZoomEnlarge"/>
              <menuitem id="menu_fullZoomReduce" key="key_fullZoomReduce"
                        label="&fullZoomReduceCmd.label;"
                        accesskey="&fullZoomReduceCmd.accesskey;"
                        command="cmd_fullZoomReduce"/>
              <menuseparator id="fullZoomAfterReduceSeparator"/>
              <menuitem id="menu_fullZoomReset" key="key_fullZoomReset"
                        label="&fullZoomResetCmd.label;"
                        accesskey="&fullZoomResetCmd.accesskey;"
                        command="cmd_fullZoomReset"/>
              <menuseparator id="fullZoomAfterResetSeparator"/>
              <menuitem id="menu_fullZoomToggle" label="&fullZoomToggleCmd.label;"
                        accesskey="&fullZoomToggleCmd.accesskey;"
                        type="checkbox" command="cmd_fullZoomToggle" checked="false"/>
            </menupopup>
          </menu>
          <menu id="charsetMenu"
                onpopupshowing="UpdateCharsetMenu(msgWindow.mailCharacterSet, this);"
                oncommand="MailSetCharacterSet(event)"/>
          <menuseparator id="viewAfterCharsetSeparator"/>
          <menuitem id="pageSourceMenuItem" label="&pageSourceCmd.label;" key="key_viewPageSource" accesskey="&pageSourceCmd.accesskey;" command="cmd_viewPageSource"/>
        </menupopup>
        </menu>

        <!-- Go -->
        <menu id="menu_Go" label="&goMenu.label;" accesskey="&goMenu.accesskey;">
          <menupopup id="menu_GoPopup" onpopupshowing="InitGoMessagesMenu();">
          <menu id="goNextMenu" label="&nextMenu.label;" accesskey="&nextMenu.accesskey;">
            <menupopup id="menu_GoNextPopup">
              <menuitem id="menu_nextMsg" label="&nextMsgCmd.label;" accesskey="&nextMsgCmd.accesskey;" command="cmd_nextMsg"
                        key="key_nextMsg"/>
              <menuitem id="menu_nextUnreadMsg" label="&nextUnreadMsgCmd.label;" accesskey="&nextUnreadMsgCmd.accesskey;" command="cmd_nextUnreadMsg"
                        key="key_nextUnreadMsg"/>
              <menuitem id="menu_nextFlaggedMsg" label="&nextStarredMsgCmd.label;" accesskey="&nextStarredMsgCmd.accesskey;" command="cmd_nextFlaggedMsg"/>
              <menuseparator id="goNextAfterFlaggedSeparator"/>
              <menuitem id="menu_nextUnreadThread" 
                        label="&nextUnreadThread.label;" 
                        accesskey="&nextUnreadThread.accesskey;" 
                        command="cmd_nextUnreadThread"
                        key="key_nextUnreadThread"/>
            </menupopup>
          </menu>
          <menu id="goPreviousMenu" label="&prevMenu.label;" accesskey="&prevMenu.accesskey;">
            <menupopup id="menu_GoPreviousPopup">
              <menuitem id="menu_prevMsg" label="&prevMsgCmd.label;" accesskey="&prevMsgCmd.accesskey;" command="cmd_previousMsg"
                        key="key_previousMsg"/>
              <menuitem id="menu_prevUnreadMsg" label="&prevUnreadMsgCmd.label;" accesskey="&prevUnreadMsgCmd.accesskey;" command="cmd_previousUnreadMsg"
                        key="key_previousUnreadMsg"/>
              <menuitem id="menu_prevFlaggedMsg" label="&prevStarredMsgCmd.label;" accesskey="&prevStarredMsgCmd.accesskey;" command="cmd_previousFlaggedMsg"/>
            </menupopup>
          </menu>
          <menuitem id="menu_goForward" label="&goForwardCmd.label;"
                    accesskey="&goForwardCmd.accesskey;" command="cmd_goForward"
                    key="key_goForward"/>
          <menuitem id="menu_goBack" label="&goBackCmd.label;"
                    accesskey="&goBackCmd.accesskey;" command="cmd_goBack"
                    key="key_goBack"/>
          <menuseparator id="goNextSeparator"/>
          <menuitem id="menu_goChat" label="&goChatCmd.label;"
                    accesskey="&goChatCmd.accesskey;"
                    command="cmd_chat"
                    key="key_goChat"/>
          <menuseparator id="goChatSeparator"/>
          <menu id="goFolderMenu"
                label="&folderMenu.label;"
                accesskey="&folderMenu.accesskey;"
                oncommand="gFolderTreeView.selectFolder(event.target._folder, true)">
            <menupopup id="menu_GoFolderPopup"
                       type="folder"
                       showFileHereLabel="true"
                       showRecent="true"
                       recentLabel="&contextMoveCopyMsgRecentMenu.label;"
                       recentAccessKey="&contextMoveCopyMsgRecentMenu.accesskey;"/>
          </menu>
          <menuseparator id="goFolderSeparator"/>
          
          <menu id="goRecentlyClosedTabs"
                label="&goRecentlyClosedTabs.label;"
                accesskey="&goRecentlyClosedTabs.accesskey;"
                observes="cmd_undoCloseTab">
            <menupopup id="menu_GoRecentlyClosedTabsPopup"
                       onpopupshowing="return InitRecentlyClosedTabsPopup(this)" />
          </menu>
          <menuseparator id="goRecentlyClosedTabsSeparator"/>
               
          <menuitem id="goStartPage"
                    label="&startPageCmd.label;"
                    accesskey="&startPageCmd.accesskey;"
                    command="cmd_goStartPage"
                    key="key_goStartPage"/>
        </menupopup>
        </menu>

        <!-- Message -->
        <menu id="messageMenu" label="&msgMenu.label;" accesskey="&msgMenu.accesskey;">
          <menupopup id="messageMenuPopup" onpopupshowing="InitMessageMenu();">
            <menuitem id="newMsgCmd" label="&newMsgCmd.label;"
                      accesskey="&newMsgCmd.accesskey;"
                      key="key_newMessage2"
                      command="cmd_newMessage"/>
            <menuitem id="replyMainMenu" label="&replyMsgCmd.label;"
                      accesskey="&replyMsgCmd.accesskey;"
                      key="key_reply"
                      command="cmd_reply"/>
            <menuitem id="replyNewsgroupMainMenu" label="&replyNewsgroupCmd2.label;"
                      accesskey="&replyNewsgroupCmd2.accesskey;"
                      key="key_reply"
                      command="cmd_replyGroup"/>
            <menuitem id="replySenderMainMenu" label="&replySenderCmd.label;"
                      accesskey="&replySenderCmd.accesskey;"
                      command="cmd_replySender"/>
            <menuitem id="menu_replyToAll" label="&replyToAllMsgCmd.label;"
                      accesskey="&replyToAllMsgCmd.accesskey;"
                      key="key_replyall"
                      command="cmd_replyall"/>
            <menuitem id="menu_replyToList" label="&replyToListMsgCmd.label;"
                      accesskey="&replyToListMsgCmd.accesskey;"
                      key="key_replylist"
                      command="cmd_replylist"/>
            <menuitem id="menu_forwardMsg" label="&forwardMsgCmd.label;"
                      accesskey="&forwardMsgCmd.accesskey;"
                      key="key_forward"
                      command="cmd_forward"/>
            <menu id="forwardAsMenu" label="&forwardAsMenu.label;" accesskey="&forwardAsMenu.accesskey;">
              <menupopup id="menu_forwardAsPopup">
                <menuitem id="menu_forwardAsInline"
                          label="&forwardAsInline.label;"
                          accesskey="&forwardAsInline.accesskey;"
                          command="cmd_forwardInline"/>
                <menuitem id="menu_forwardAsAttachment"
                          label="&forwardAsAttachmentCmd.label;"
                          accesskey="&forwardAsAttachmentCmd.accesskey;"
                          command="cmd_forwardAttachment"/>
              </menupopup>
            </menu>
            <menuitem id="menu_editMsgAsNew" label="&editAsNewMsgCmd.label;"
                      accesskey="&editAsNewMsgCmd.accesskey;"
                      key="key_editAsNew"
                      command="cmd_editAsNew"/>
            <menuseparator id="messageMenuAfterCompositionCommandsSeparator"/>
            <menuitem id="openMessageWindowMenuitem" label="&openMessageWindowCmd.label;"
                      command="cmd_openMessage"
                      accesskey="&openMessageWindowCmd.accesskey;"
                      key="key_openMessage"/>
            <menuitem id="openConversationMenuitem" label="&openConversationCmd.label;"
                      command="cmd_openConversation"
                      accesskey="&openConversationCmd.accesskey;"
                      key="key_openConversation"/>
            <menu id="openFeedMessage" 
                  label="&openFeedMessage1.label;"
                  accesskey="&openFeedMessage1.accesskey;">
              <menupopup id="menu_openFeedMessage">
                <menuitem id="menu_openFeedWebPage"
                          type="radio"
                          name="openFeedGroup" 
                          label="&openFeedWebPage.label;"
                          accesskey="&openFeedWebPage.accesskey;"
                          oncommand="FeedMessageHandler.onOpenPref = 0"/>
                <menuitem id="menu_openFeedSummary"
                          type="radio"
                          name="openFeedGroup" 
                          label="&openFeedSummary.label;"
                          accesskey="&openFeedSummary.accesskey;"
                          oncommand="FeedMessageHandler.onOpenPref = 1"/>
                <menuitem id="menu_openFeedWebPageInMessagePane" 
                          type="radio"
                          name="openFeedGroup" 
                          label="&openFeedWebPageInMP.label;"
                          accesskey="&openFeedWebPageInMP.accesskey;"
                          oncommand="FeedMessageHandler.onOpenPref = 2"/>
              </menupopup>
            </menu>
            <menuseparator id="messageAfterOpenMsgSeparator"/>
            <menu id="msgAttachmentMenu"
                  label="&openAttachmentListCmd.label;"
                  accesskey="&openAttachmentListCmd.accesskey;"
                  disabled="true">
              <menupopup id="attachmentMenuList" onpopupshowing="FillAttachmentListPopup(this);"/>
            </menu>
            <menuseparator id="messageAfterAttachmentMenuSeparator"/>
            <menu id="tagMenu" label="&tagMenu.label;" accesskey="&tagMenu.accesskey;" command="cmd_tag">
              <menupopup id="tagMenu-tagpopup"
                         onpopupshowing="InitMessageTags(this);">
                <menuitem id="addNewTag"
                          label="&addNewTag.label;"
                          accesskey="&addNewTag.accesskey;"
                          command="cmd_addTag"/>
                <menuitem id="manageTags"
                          label="&manageTags.label;"
                          accesskey="&manageTags.accesskey;"
                          command="cmd_manageTags"/>
                <menuseparator id="tagMenu-sep-afterTagAddNew"/>
                <menuitem id="tagMenu-tagRemoveAll"
                          command="cmd_removeTags"/>
                <menuseparator id="tagMenuAfterRemoveSeparator"/>
              </menupopup>
            </menu>
            <menu id="markMenu" label="&markMenu.label;" accesskey="&markMenu.accesskey;">
              <menupopup id="menu_MarkPopup" onpopupshowing="InitMessageMark()">
                <menuitem id="markReadMenuItem" label="&markAsReadCmd.label;"
                          accesskey="&markAsReadCmd.accesskey;"
                          command="cmd_markAsRead"/>
                <menuitem id="markUnreadMenuItem" label="&markAsUnreadCmd.label;"
                          accesskey="&markAsUnreadCmd.accesskey;"
                          command="cmd_markAsUnread"/>
                <menuitem id="menu_markThreadAsRead" label="&markThreadAsReadCmd.label;" accesskey="&markThreadAsReadCmd.accesskey;" command="cmd_markThreadAsRead"
                          key="key_markThreadAsRead"/>
                <menuitem id="menu_markReadByDate" label="&markReadByDateCmd.label;" accesskey="&markReadByDateCmd.accesskey;" command="cmd_markReadByDate"
                          key="key_markReadByDate"/>
                <menuitem id="menu_markAllRead" label="&markAllReadCmd.label;" key="key_markAllRead" accesskey="&markAllReadCmd.accesskey;" command="cmd_markAllRead"/>
                <menuseparator id="markMenuAfterAllReadSeparator"/>
                <menuitem id="markFlaggedMenuItem"
                          type="checkbox"
                          label="&markStarredCmd.label;"
                          accesskey="&markStarredCmd.accesskey;"
                          command="cmd_markAsFlagged"
                          key="key_toggleFlagged"/>
                <menuseparator id="markMenuAfterFlaggedSeparator"/>
                <menuitem id="menu_markAsJunk" label="&markAsJunkCmd.label;"
                          accesskey="&markAsJunkCmd.accesskey;"
                          command="cmd_markAsJunk"
                          key="key_markJunk"/>
                <menuitem id="menu_markAsNotJunk" label="&markAsNotJunkCmd.label;"
                          key="key_markNotJunk"
                          accesskey="&markAsNotJunkCmd.accesskey;"
                          command="cmd_markAsNotJunk"/>
                <menuitem id="menu_recalculateJunkScore"
                          label="&recalculateJunkScoreCmd.label;"
                          accesskey="&recalculateJunkScoreCmd.accesskey;"
                          command="cmd_recalculateJunkScore"/>
              </menupopup>
            </menu>
            <menuseparator id="messageMenuAfterMarkSeparator"/>
            <menuitem id="archiveMainMenu" label="&archiveMsgCmd.label;"
                      accesskey="&archiveMsgCmd.accesskey;"
                      key="key_archive"
                      command="cmd_archive"/>
            <menuitem id="menu_cancel" command="cmd_cancel"
                      label="&cancelNewsMsgCmd.label;"
                      accesskey="&cancelNewsMsgCmd.accesskey;"/>
            <menu id="moveMenu"
                  label="&moveMsgToMenu.label;"
                  accesskey="&moveMsgToMenu.accesskey;"
                  oncommand="MsgMoveMessage(event.target._folder)">
              <menupopup type="folder" mode="filing"
                         showFileHereLabel="true"
                         showRecent="true"
                         recentLabel="&moveCopyMsgRecentMenu.label;"
                         recentAccessKey="&moveCopyMsgRecentMenu.accesskey;"/>
            </menu>
            <menu id="copyMenu"
                  label="&copyMsgToMenu.label;"
                  accesskey="&copyMsgToMenu.accesskey;"
                  oncommand="MsgCopyMessage(event.target._folder)">
              <menupopup type="folder" mode="filing"
                         showFileHereLabel="true"
                         showRecent="true"
                         recentLabel="&moveCopyMsgRecentMenu.label;"
                         recentAccessKey="&moveCopyMsgRecentMenu.accesskey;"/>
            </menu>
            <menuitem id="moveToFolderAgain" key="key_moveToFolderAgain" command="cmd_moveToFolderAgain"
                      label="&moveToFolderAgain.label;" accesskey="&moveToFolderAgain.accesskey;"/>
            <menuseparator id="messageMenuAfterMoveCommandsSeparator"/>
            <menuitem id="createFilter" label="&createFilter.label;"
                      accesskey="&createFilter.accesskey;"
                      command="cmd_createFilterFromMenu"/>
        <menuseparator id="threadItemsSeparator"/>
        <menuitem id="killThread"
                  label="&killThreadMenu.label;"
                  accesskey="&killThreadMenu.accesskey;"
                  command="cmd_killThread"
                  type="checkbox"
                  key="key_killThread"/>
        <menuitem id="killSubthread"
                  label="&killSubthreadMenu.label;"
                  accesskey="&killSubthreadMenu.accesskey;"
                  type="checkbox"
                  command="cmd_killSubthread"
                  key="key_killSubthread"/>
        <menuitem id="watchThread"
                  label="&watchThreadMenu.label;"
                  accesskey="&watchThreadMenu.accesskey;"
                  type="checkbox"
                  command="cmd_watchThread"
                  key="key_watchThread"/>
      </menupopup>
    </menu>

    <!-- Tools -->
    <menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;">
      <menupopup id="taskPopup" onpopupshowing="document.commandDispatcher.updateCommands('create-menu-tasks')">
        <menuitem id="menu_openSavedFilesWnd" label="&savedFiles.label;"
                  accesskey="&savedFiles.accesskey;"
                  key="key_savedFiles"
                  oncommand="openSavedFilesWnd();"/>
        <menuitem id="addonsManager" label="&addons.label;" accesskey="&addons.accesskey;"
                  oncommand="openAddonsMgr();"/>
        <menuitem id="activityManager" label="&activitymanager.label;"
                  accesskey="&activitymanager.accesskey;"
                  oncommand="openActivityMgr();"/>
        <menu id="imAccountsStatus" label="&imAccountsStatus.label;"
              accesskey="&imAccountsStatus.accesskey;"
              oncommand="chatHandler.setStatusMenupopupCommand(event);">
          <menupopup id="imStatusMenupopup">
            <menuitem id="imStatusAvailable" status="available" label="&imStatus.available;" class="menuitem-iconic"/>
            <menuitem id="imStatusUnavailable" status="unavailable" label="&imStatus.unavailable;" class="menuitem-iconic"/>
            <menuseparator id="imStatusOfflineSeparator"/>
            <menuitem id="imStatusOffline" status="offline" label="&imStatus.offline;" class="menuitem-iconic"/>
            <menuseparator id="imStatusShowAccountsSeparator"/>
            <menuitem id="imStatusShowAccounts" label="&imStatus.showAccounts;"/>
          </menupopup>
        </menu>
        <menuitem id="joinChatMenuItem"
                  label="&joinChatCmd.label;"
                  accesskey="&joinChatCmd.accesskey;"
                  oncommand="chatHandler.joinChat();"/>

        <menuseparator id="devToolsSeparator"/>
        <menuitem id="filtersCmd" label="&filtersCmd2.label;"
                  accesskey="&filtersCmd2.accesskey;"
                  command="cmd_displayMsgFilters"/>
        <menuitem id="applyFilters"
                  label="&filtersApply.label;"
                  accesskey="&filtersApply.accesskey;"
                  command="cmd_applyFilters"/>
        <menuitem id="applyFiltersToSelection"
                  label="&filtersApplyToMessage.label;"
                  accesskey="&filtersApplyToMessage.accesskey;"
                  command="cmd_applyFiltersToSelection"/>
        <menuseparator id="tasksMenuAfterApplySeparator"/>
        <menuitem id="runJunkControls"
            label="&runJunkControls.label;"
            accesskey="&runJunkControls.accesskey;"
            command="cmd_runJunkControls"/>
        <menuitem id="deleteJunk"
            label="&deleteJunk.label;"
            accesskey="&deleteJunk.accesskey;"
            command="cmd_deleteJunk"/>
        <menuseparator id="tasksMenuAfterDeleteSeparator"/>
        <menuitem id="menu_import" label="&importCmd.label;"
                  accesskey="&importCmd.accesskey;"
                  oncommand="toImport();"/>
        <menuitem id="javascriptConsole" label="&errorConsoleCmd.label;" accesskey="&errorConsoleCmd.accesskey;" key="key_errorConsole" oncommand="toJavaScriptConsole();"/>
        <menuitem id="sanitizeHistory"
                  label="&clearRecentHistory.label;"
                  accesskey="&clearRecentHistory.accesskey;"
                  oncommand="toSanitize();"/>
        <menuseparator id="prefSep"/>
        <menuitem id="menu_accountmgr"
                  label="&accountManagerCmd2.label;"
                  accesskey="&accountManagerCmd2.accesskey;"
                  oncommand="MsgAccountManager(null);"/>
        <menuitem id="menu_preferences"
                  label="&preferencesCmdMac2.label;"
                  key="key_preferencesCmdMac"
                  oncommand="openOptionsDialog()"/>
        <menuitem id="menu_mac_services" label="&servicesMenuMac.label;"/>
        <menuitem id="menu_mac_hide_app" label="&hideThisAppCmdMac.label;" key="key_hideThisAppCmdMac"/>
        <menuitem id="menu_mac_hide_others" label="&hideOtherAppsCmdMac.label;" key="key_hideOtherAppsCmdMac"/>
        <menuitem id="menu_mac_show_all" label="&showAllAppsCmdMac.label;"/>
       </menupopup>
      </menu>

<!-- Mac window menu -->
    <script type="application/javascript" src="chrome://global/content/macWindowMenu.js"/>
    <commandset id="baseMenuCommandSet">
        <command id="minimizeWindow"
                 label="&minimizeWindow.label;"
                 oncommand="window.minimize();" />
        <command id="zoomWindow"
                 label="&zoomWindow.label;"
                 oncommand="zoomWindow();" />
    </commandset>
    <keyset id="baseMenuKeyset">
        <key id="key_minimizeWindow"
             command="minimizeWindow"
             key="&minimizeWindow.key;"
             modifiers="accel"/>
    </keyset>
    <menu id="windowMenu"
          label="&windowMenu.label;"
          datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot"
          onpopupshowing="macWindowMenuDidShow();"
          hidden="false">
        <template>
        <rule>
            <menupopup>
                <menuitem uri="rdf:*"
                          label="rdf:http://home.netscape.com/NC-rdf#Name"
                          type="radio"
                          name="windowList"
                          oncommand="ShowWindowFromResource(event.target)"/>
            </menupopup>
        </rule>
        </template>
        <menupopup id="windowPopup">
            <menuitem command="minimizeWindow" key="key_minimizeWindow"/>
            <menuitem command="zoomWindow"/>
            <!-- decomment when "BringAllToFront" is implemented
                <menuseparator/>
                <menuitem label="&bringAllToFront.label;" disabled="true"/> -->
            <menuseparator id="sep-window-list"/>
        </menupopup>
    </menu>

      <!-- Help -->
      <menu id="helpMenu"/>

      <spacer id="menubar_spacer" flex="100%"/>
      </menubar>
    </toolbaritem>
    <hbox class="titlebar-placeholder" type="caption-buttons" ordinal="1000"/>
  </toolbar>
</toolbox>

<toolbox id="mail-toolbox"
         class="mail-toolbox"
         mode="full"
         defaultmode="full"
         iconsize="small"
         defaulticonsize="small"
         labelalign="end"
         defaultlabelalign="end">

  <toolbarpalette id="MailToolbarPalette">
    <toolbarbutton id="button-getmsg"
                   type="menu-button"
                   class="toolbarbutton-1"
                   label="&getMsgButton1.label;"
                   tooltiptext="&getMsgButton.tooltip;"
                   oncommand="MsgGetMessagesForAccount(event.target._folder)"
                   observes="button_getNewMessages">
      <menupopup id="button-getMsgPopup"
                 onpopupshowing="getMsgToolbarMenu_init();"
                 type="folder"
                 expandFolders="false"
                 mode="getMail">
        <menuitem id="button-getAllNewMsg"
                  label="&getAllNewMsgCmd.label;"
                  accesskey="&getAllNewMsgCmd.accesskey;"
                  command="cmd_getMsgsForAuthAccounts"/>
        <menuseparator id="button-getAllNewMsgSeparator"/>
      </menupopup>
    </toolbarbutton>
    <toolbarbutton id="button-newmsg"
                   class="toolbarbutton-1"
                   label="&newMsgButton.label;"
                   tooltiptext="&newMsgButton.tooltip;"
                   command="cmd_newMessage"/>
    <toolbarbutton id="button-reply"
                   class="toolbarbutton-1"
                   label="&replyButton.label;"
                   tooltiptext="&replyButton.tooltip;"
                   observes="button_reply"
                   command="cmd_reply"/>
    <toolbarbutton id="button-replyall"
                   class="toolbarbutton-1"
                   label="&replyAllButton.label;"
                   tooltiptext="&replyAllButton.tooltip;"
                   observes="button_replyall"
                   command="cmd_replyall"/>
    <toolbarbutton id="button-replylist"
                   class="toolbarbutton-1"
                   label="&replyListButton.label;"
                   tooltiptext="&replyListButton.tooltip;"
                   observes="button_replylist"
                   command="cmd_replylist"/>
    <toolbarbutton id="button-forward"
                   type="menu-button"
                   class="toolbarbutton-1"
                   label="&forwardButton.label;"
                   tooltiptext="&forwardButton.tooltip;"
                   observes="button_forward"
                   command="cmd_forward">
      <menupopup id="button-ForwardPopup">
        <menuitem id="button-ForwardAsInlineMenu"
                  label="&buttonMenuForwardAsInline.label;"
                  tooltiptext="&forwardAsInline.tooltip;"
                  command="cmd_forwardInline"/>
        <menuitem id="button-ForwardAsAttachmentMenu"
                  label="&buttonMenuForwardAsAttachment.label;"
                  tooltiptext="&forwardAsAttachment.tooltip;"
                  command="cmd_forwardAttachment"/>
      </menupopup>
    </toolbarbutton>
    <toolbarbutton id="button-file"
                   type="menu"
                   class="toolbarbutton-1"
                   label="&fileButton.label;"
                   observes="button_file"
                   oncommand="MsgMoveMessage(event.target._folder)">
      <menupopup id="button-filePopup"
                 type="folder"
                 mode="filing"
                 showRecent="true"
                 showFileHereLabel="true"
                 recentLabel="&moveCopyMsgRecentMenu.label;"
                 recentAccessKey="&moveCopyMsgRecentMenu.accesskey;"/>
    </toolbarbutton>
    <toolbarbutton id="button-archive"
                   class="toolbarbutton-1"
                   label="&archiveButton.label;"
                   tooltiptext="&archiveButton.tooltip;"
                   observes="button_archive"
                   oncommand="MsgArchiveSelectedMessages(event)"/>
    <toolbarbutton id="button-goback"
                   class="toolbarbutton-1"
                   type="menu-button"
                   label="&backButton1.label;"
                   oncommand="goDoCommand('cmd_goBack')"
                   tooltiptext="&goBackButton.tooltip;"
                   observes="button_goBack">
      <menupopup id="button-goBackPopup" onpopupshowing="backToolbarMenu_init(this)">
        <menuitem id="button-goBack" label="&goBackCmd.label;" command="cmd_goBack"/>
        <menuseparator id="button-goBackSeparator"/>
      </menupopup>
    </toolbarbutton>
    <toolbarbutton id="button-goforward"
                   class="toolbarbutton-1"
                   type="menu-button"
                   label="&goForwardButton1.label;"
                   oncommand="goDoCommand('cmd_goForward')"
                   tooltiptext="&goForwardButton.tooltip;"
                   observes="button_goForward">
      <menupopup id="button-goForwardPopup" onpopupshowing="forwardToolbarMenu_init(this)">
        <menuitem id="button-goForward"
                  label="&goForwardCmd.label;"
                  command="cmd_goForward"/>
        <menuseparator id="button-goForwardSeparator"/>
      </menupopup>
    </toolbarbutton>
    <toolbaritem id="button-previous"
                 title="&previousButtonToolbarItem.label;"
                 align="center"
                 class="chromeclass-toolbar-additional">
      <toolbarbutton id="button-previousUnread"
                     class="toolbarbutton-1"
                     label="&previousButton.label;"
                     oncommand="goDoCommand('button_previous')"
                     tooltiptext="&previousButton.tooltip;"
                     observes="button_previous"/>
    </toolbaritem>
    <toolbarbutton id="button-previousMsg"
                   class="toolbarbutton-1"
                   label="&previousMsgButton.label;"
                   oncommand="goDoCommand('button_previousMsg')"
                   tooltiptext="&previousMsgButton.tooltip;"
                   observes="button_previousMsg"/>
    <toolbaritem id="button-next"
                 title="&nextButtonToolbarItem.label;"
                 align="center"
                 class="chromeclass-toolbar-additional">
      <toolbarbutton id="button-nextUnread"
                     class="toolbarbutton-1"
                     label="&nextButton.label;"
                     oncommand="goDoCommand('button_next')"
                     tooltiptext="&nextButton.tooltip;"
                     observes="button_next"/>
    </toolbaritem>
    <toolbarbutton id="button-nextMsg"
                   class="toolbarbutton-1"
                   label="&nextMsgButton.label;"
                   oncommand="goDoCommand('button_nextMsg');"
                   tooltiptext="&nextMsgButton.tooltip;"
                   observes="button_nextMsg"/>
    <toolbaritem id="button-junk" title="&junkItem.title;">
      <deck id="junk-deck" observes="button_junk">
        <toolbarbutton id="button-isJunk"
                       class="toolbarbutton-1 junk-button"
                       label="&junkButton.label;"
                       tooltiptext="&junkButton.tooltip;"
                       observes="button_junk"
                       oncommand="goDoCommand('button_junk')"/>
        <toolbarbutton id="button-notJunk"
                       class="toolbarbutton-1 junk-button"
                       label="&notJunkButton.label;"
                       tooltiptext="&notJunkButton.tooltip;"
                       observes="button_junk"
                       oncommand="goDoCommand('button_junk')"/>
      </deck>
    </toolbaritem>
    <toolbaritem id="button-delete" title="&deleteItem.title;">
      <deck id="delete-deck" observes="button_delete">
         <toolbarbutton id="button-mark-deleted"
                        class="toolbarbutton-1 delete-button"
                        label="&deleteButton.label;"
                        tooltiptext="&deleteButton.tooltip;"
                        observes="button_delete"
                        oncommand="goDoCommand(event.shiftKey ? 'button_shiftDelete' : 'button_delete')"/>
         <toolbarbutton id="button-mark-undelete"
                        class="toolbarbutton-1 delete-button"
                        label="&undeleteButton.label;"
                        tooltiptext="&undeleteButton.tooltip;"
                        observes="button_delete"
                        oncommand="goDoCommand('button_delete')"/>
      </deck>
    </toolbaritem>
    <toolbarbutton id="button-print"
                   class="toolbarbutton-1"
                   label="&printButton.label;"
                   observes="button_print"
                   oncommand="goDoCommand('cmd_print')"
                   tooltiptext="&printButton.tooltip;"/>
    <toolbarbutton id="button-mark"
                   type="menu-button"
                   class="toolbarbutton-1"
                   label="&markButton.label;"
                   oncommand="goDoCommand('button_mark')"
                   observes="button_mark"
                   tooltiptext="&markButton.tooltip;">
      <menupopup id="button-markPopup" onpopupshowing="InitMessageMark()">
        <menuitem id="markReadToolbarItem"
                  label="&markAsReadCmd.label;"
                  accesskey="&markAsReadCmd.accesskey;"
                  command="cmd_markAsRead" />
        <menuitem id="markUnreadToolbarItem"
                  label="&markAsUnreadCmd.label;"
                  accesskey="&markAsUnreadCmd.accesskey;"
                  command="cmd_markAsUnread" />
        <menuitem id="button-markThreadAsRead"
                  label="&markThreadAsReadCmd.label;"
                  key="key_markThreadAsRead"
                  accesskey="&markThreadAsReadCmd.accesskey;"
                  command="cmd_markThreadAsRead"/>
        <menuitem id="button-markReadByDate"
                  label="&markReadByDateCmd.label;"
                  key="key_markReadByDate"
                  accesskey="&markReadByDateCmd.accesskey;"
                  command="cmd_markReadByDate"/>
        <menuitem id="button-markAllRead"
                  label="&markAllReadCmd.label;"
                  key="key_markAllRead"
                  accesskey="&markAllReadCmd.accesskey;"
                  command="cmd_markAllRead"/>
        <menuseparator id="button-markAllReadSeparator"/>
        <menuitem id="markFlaggedToolbarItem"
                  type="checkbox"
                  label="&markStarredCmd.label;"
                  accesskey="&markStarredCmd.accesskey;"
                  key="key_toggleFlagged"
                  command="cmd_markAsFlagged"/>
      </menupopup>
    </toolbarbutton>
    <toolbarbutton id="button-tag"
                   type="menu"
                   class="toolbarbutton-1"
                   label="&tagButton.label;"
                   tooltiptext="&tagButton.tooltip;"
                   command="cmd_tag">
      <menupopup id="button-tagpopup"
                 onpopupshowing="InitMessageTags(this);">
        <menuitem id="addNewTag"
                  label="&addNewTag.label;"
                  accesskey="&addNewTag.accesskey;"
                  command="cmd_addTag"/>
        <menuitem id="manageTags"
                  label="&manageTags.label;"
                  accesskey="&manageTags.accesskey;"
                  command="cmd_manageTags"/>
        <menuseparator id="button-tagpopup-sep-afterTagAddNew"/>
        <menuitem id="button-tagRemoveAll"
                  command="cmd_removeTags"/>
        <menuseparator id="button-afterTagRemoveAllSeparator"/>
      </menupopup>
    </toolbarbutton>
    <toolbarbutton id="button-address"
                   class="toolbarbutton-1"
                   label="&addressBookButton.label;"
                   oncommand="toAddressBook();"
                   tooltiptext="&addressBookButton.tooltip;"/>
    <toolbarbutton id="button-chat"
                   class="toolbarbutton-1"
                   label="&chatButton.label;"
                   command="cmd_chat"
                   observes="cmd_chat"
                   tooltiptext="&chatButton.tooltip;"/>
    <toolbaritem id="throbber-box" title="&throbberItem.title;" align="center" pack="center"
                 mousethrough="always">
       <image/>
    </toolbaritem>
    <toolbarbutton id="button-stop"
                   class="toolbarbutton-1"
                   label="&stopButton.label;"
                   tooltiptext="&stopButton.tooltip;"
                   command="cmd_stop"/>
    <toolbarbutton id="button-appmenu"
                   class="toolbarbutton-1 button-appmenu"
                   label="&appmenuButton.label;"
                   tooltiptext="&appmenuButton1.tooltip;"/>
  </toolbarpalette>

  <!-- If changes are made to the default set of toolbar buttons, you may need to rev the id
       of mail-bar in order to force the new default items to show up for users who customized their toolbar
       in earlier versions. Bumping the id means users will have to re-customize their toolbar!
  -->

  <toolbar id="mail-bar3"
           class="inline-toolbar chromeclass-toolbar"
           toolbarname="&showMessengerToolbarCmd.label;"
           accesskey="&showMessengerToolbarCmd.accesskey;"
           fullscreentoolbar="true" mode="full"
           customizable="true"
           context="toolbar-context-menu"
           iconsize="small"
           defaultset="button-getmsg,button-newmsg,button-chat,button-address,spacer,button-tag,qfb-show-filter-bar,spring,gloda-search,button-appmenu">
  </toolbar>

  <toolbarset id="customToolbars" context="toolbar-context-menu"/>
</toolbox>

<statusbar class="chromeclass-status" id="status-bar">
  <hbox insertbefore="unreadMessageCount"  id="statusTextBox" flex="1">
    <statusbarpanel id="offline-status" class="statusbarpanel-iconic" oncommand="MailOfflineMgr.toggleOfflineStatus();"/>
    <statusbarpanel id="statusText" label="&statusText.label;" flex="1"/>
    <statusbarpanel class="statusbarpanel-progress" collapsed="true" id="statusbar-progresspanel">
      <progressmeter class="progressmeter-statusbar" id="statusbar-icon" mode="normal" value="0"/>
    </statusbarpanel>
    <statusbarpanel class="statusbarpanel-progress"
                    id="quotaPanel" hidden="true">
      <stack>
        <progressmeter class="progressmeter-statusbar"
                       id="quotaMeter"
                       mode="normal"
                       value="0" />
        <label id="quotaLabel"
               onclick="gFolderTreeController.editFolder('QuotaTab');" />
      </stack>
    </statusbarpanel>
  </hbox>
</statusbar>

</overlay>
