<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

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

<?xul-overlay href="chrome://communicator/content/charsetOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/sidebar/sidebarOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/contentAreaContextOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/messengercompose/msgComposeContextOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/messengercompose/addressingWidgetOverlay.xul"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://editor/content/editorOverlay.xul"?>
<?xul-overlay href="chrome://editor/content/editorSmileyOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/messengercompose/mailComposeOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/messengercompose/mailComposeExtrasOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/platformMailnewsOverlay.xul"?>

<!DOCTYPE window [
<!ENTITY % messengercomposeDTD SYSTEM "chrome://messenger/locale/messengercompose/messengercompose.dtd" >
%messengercomposeDTD;
<!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
%messengerDTD;
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
%brandDTD;
<!ENTITY % utilityDTD SYSTEM "chrome://communicator/locale/utilityOverlay.dtd">
%utilityDTD;
<!ENTITY % platformCommunicatorDTD SYSTEM
  "chrome://communicator-platform/locale/platformCommunicatorOverlay.dtd">
%platformCommunicatorDTD;
]>

<window id="msgcomposeWindow"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        xmlns:nc="http://home.netscape.com/NC-rdf#"
        onunload="ComposeUnload()"
        onload="ComposeLoad()"
        onclose="return DoCommandClose()"
        onfocus="EditorOnFocus()"
        title="&msgComposeWindow.title;"
        toggletoolbar="true"
        lightweightthemes="true"
        lightweightthemesfooter="status-bar"
        windowtype="msgcompose"
        macanimationtype="document"
        drawtitle="true"
        width="640" height="480"
        persist="screenX screenY width height sizemode">

<stringbundleset id="stringbundleset">
  <stringbundle id="bundle_composeMsgs" src="chrome://messenger/locale/messengercompose/composeMsgs.properties"/>
  <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
  <stringbundle id="bundle_offlinePrompts" src="chrome://messenger/locale/offline.properties"/>
  <stringbundle id="languageBundle" src="chrome://global/locale/languageNames.properties"/>
  <stringbundle id="brandBundle" src="chrome://branding/locale/brand.properties"/>
</stringbundleset>

<script type="application/javascript" src="chrome://communicator/content/contentAreaClick.js"/>
<script type="application/javascript" src="chrome://global/content/printUtils.js"/>
<script type="application/javascript" src="chrome://messenger/content/accountUtils.js"/>
<script type="application/javascript" src="chrome://messenger/content/widgetglue.js"/>
<script type="application/javascript" src="chrome://messenger/content/mail-offline.js"/>
<script type="application/javascript" src="chrome://editor/content/editor.js"/>
<script type="application/javascript" src="chrome://messenger/content/messengercompose/MsgComposeCommands.js"/>

<!-- drag and drop -->
<script type="application/javascript" src="chrome://global/content/nsDragAndDrop.js"/>

<commandset id="composeCommands">
  <commandset id="msgComposeCommandUpdate"
    commandupdater="true"
    events="focus"
    oncommandupdate="CommandUpdate_MsgCompose()"/>

  <commandset id="editorCommands"/>
  <commandset id="commonEditorMenuItems"/>
  <commandset id="composerMenuItems"/>
  <commandset id="composerEditMenuItems"/>
  <commandset id="composerStyleMenuItems"/>
  <commandset id="composerTableMenuItems"/>
  <commandset id="composerListMenuItems"/>
  <commandset id="tasksCommands"/>
  <!-- File Menu -->
  <command id="cmd_attachFile" oncommand="goDoCommand('cmd_attachFile')"/>
  <command id="cmd_attachPage" oncommand="goDoCommand('cmd_attachPage')"/>
  <command id="cmd_attachVCard" checked="false" oncommand="ToggleAttachVCard(event.target)"/>
  <command id="cmd_save" oncommand="goDoCommand('cmd_save')"/>
  <command id="cmd_saveAsFile" oncommand="goDoCommand('cmd_saveAsFile')"/>
  <command id="cmd_saveAsDraft" oncommand="goDoCommand('cmd_saveAsDraft')"/>
  <command id="cmd_saveAsTemplate" oncommand="goDoCommand('cmd_saveAsTemplate')"/>
  <command id="cmd_sendButton" oncommand="goDoCommand('cmd_sendButton')"/>
  <command id="cmd_sendNow" oncommand="goDoCommand('cmd_sendNow')"/>
  <command id="cmd_sendWithCheck" oncommand="goDoCommand('cmd_sendWithCheck')"/>
  <command id="cmd_sendLater" oncommand="goDoCommand('cmd_sendLater')"/>

  <!-- Edit Menu -->
  <!--command id="cmd_pasteQuote"/  DO NOT INCLUDE THOSE COMMANDS ELSE THE EDIT MENU WILL BE BROKEN! -->
  <!--command id="cmd_find"/-->
  <!--command id="cmd_findNext"/-->
  <!--command id="cmd_findReplace"/-->
  <command id="cmd_rewrap"
           label="&editRewrapCmd.label;"
           accesskey="&editRewrapCmd.accesskey;"
           oncommand="goDoCommand('cmd_rewrap');"/>
  <command id="cmd_renameAttachment" oncommand="goDoCommand('cmd_renameAttachment')" disabled="true"/>
  <command id="cmd_openAttachment" oncommand="goDoCommand('cmd_openAttachment')"/>
  <command id="cmd_account"
           label="&accountManagerCmd.label;"
           accesskey="&accountManagerCmd.accesskey;"
           oncommand="goDoCommand('cmd_account');"/>

  <!-- Options Menu -->
  <command id="cmd_selectAddress" oncommand="goDoCommand('cmd_selectAddress')"/>
  <command id="cmd_outputFormat" oncommand="OutputFormatMenuSelect(event.target)"/>
  <command id="cmd_quoteMessage" oncommand="goDoCommand('cmd_quoteMessage')"/>
</commandset>

<broadcasterset id="composeBroadcasters">
  <broadcaster id="Communicator:WorkMode"/>
  <broadcaster id="args" value="editorType=default"/>
</broadcasterset>

<broadcasterset id="mainBroadcasterSet"/>

<keyset id="tasksKeys">
  <!-- File Menu -->
  <key id="key_send" keycode="&sendCmd.keycode;" observes="cmd_sendWithCheck" modifiers="accel"/>
  <key id="key_sendLater" keycode="&sendLaterCmd.keycode;" observes="cmd_sendLater" modifiers="accel, shift"/>

  <!-- Edit Menu -->
  <key id="key_rewrap" key="&editRewrapCmd.key;" command="cmd_rewrap" modifiers="accel"/>

  <!-- Options Menu -->
  <!-- key id="key_selectAddresses" key="&selectAddressCmd.key;" command="cmd_selectAddress"/ -->

  <key id="showHideSidebar"/>
  <!-- Tab/F6 Keys -->
  <key keycode="VK_TAB" oncommand="SwitchElementFocus(event);" modifiers="control"/>
  <key keycode="VK_TAB" oncommand="SwitchElementFocus(event);" modifiers="control,shift"/>
  <key keycode="VK_F6" oncommand="SwitchElementFocus(event);" modifiers="control"/>
  <key keycode="VK_F6" oncommand="SwitchElementFocus(event);" modifiers="control,shift"/>
  <key keycode="VK_F6" oncommand="SwitchElementFocus(event);" modifiers="shift"/>
  <key keycode="VK_F6" oncommand="SwitchElementFocus(event);"/>
</keyset>
<keyset id="editorKeys"/>
<keyset id="composeKeys">
  <key id="key_renameAttachment"/>
</keyset>

  <popupset id="contentAreaContextSet"/>

  <popupset id="msgComposePopupSet">
    <menupopup id="sidebarPopup"/>
    <menupopup id="popupNotificationMenu"/>
    <menupopup id="toolbar-context-menu"/>
    <panel id="customizeToolbarSheetPopup"/>

    <menupopup id="msgComposeAttachmentContext"
               onpopupshowing="updateEditItems();">
      <menuitem label="&openAttachment.label;"
                accesskey="&openAttachment.accesskey;"
                command="cmd_openAttachment"/>
      <menuitem accesskey="&deleteAttachment.accesskey;"
                command="cmd_delete"/>
      <menuitem label="&renameAttachment.label;"
                accesskey="&renameAttachment.accesskey;"
                command="cmd_renameAttachment"/>
      <menuitem label="&selectAllCmd.label;"
                accesskey="&selectAllAttachments.accesskey;"
                command="cmd_selectAll"/>
      <menuseparator/>
      <menuitem label="&attachFile.label;"
                accesskey="&attachFile.accesskey;"
                command="cmd_attachFile"/>
      <menuitem label="&attachPage.label;"
                accesskey="&attachPage.accesskey;"
                command="cmd_attachPage"/>
    </menupopup>
  </popupset>

  <vbox id="titlebar"/>

  <toolbox id="compose-toolbox"
           class="toolbox-top"
           mode="full"
           defaultmode="full">
    <toolbar id="compose-toolbar-menubar2"
             type="menubar"
             class="chromeclass-menubar"
             persist="collapsed"
             grippytooltiptext="&menuBar.tooltip;"
             customizable="true"
             defaultset="menubar-items"
             mode="icons"
             iconsize="small"
             defaultmode="icons"
             defaulticonsize="small"
             context="toolbar-context-menu">
      <toolbaritem id="menubar-items"
                   class="menubar-items"
                   align="center">
        <menubar id="mail-menubar">
          <menu id="menu_File">
            <menupopup id="menu_FilePopup">
              <menu id="menu_New">
                <menupopup id="menu_NewPopup">
                  <menuitem id="menu_newMessage"/>
                  <menuseparator id="menuNewPopupSeparator"/>
                  <menuitem id="menu_newCard"/>
                  <menuitem id="menu_newNavigator"/>
                  <menuitem id="menu_newPrivateWindow"/>
                  <menuitem id="menu_newEditor"/>
                </menupopup>
              </menu>
              <menu id="menu_Attach"
                    label="&attachMenu.label;"
                    accesskey="&attachMenu.accesskey;">
                <menupopup id="menu_AttachPopup">
                  <menuitem id="menu_AttachFile"
                            label="&attachFileCmd.label;"
                            accesskey="&attachFileCmd.accesskey;"
                            command="cmd_attachFile"/>
                  <menuitem id="menu_AttachPage"
                            label="&attachPageCmd.label;"
                            accesskey="&attachPageCmd.accesskey;"
                            command="cmd_attachPage"/>
                  <menuseparator id="menuAttachPageSeparator"/>
                  <menuitem id="menu_AttachPageVCard"
                            type="checkbox"
                            label="&attachVCardCmd.label;"
                            accesskey="&attachVCardCmd.accesskey;"
                            command="cmd_attachVCard"/>
                </menupopup>
              </menu>
              <menuitem id="menu_close"/>
              <menuseparator id="menuFileAfterCloseSeparator"/>
              <menuitem id="menu_SaveCmd"
                        label="&saveCmd.label;"
                        accesskey="&saveCmd.accesskey;"
                        key="key_save"
                        command="cmd_save"/>
              <menu id="menu_SaveAsCmd"
                    label="&saveAsCmd.label;"
                    accesskey="&saveAsCmd.accesskey;">
                <menupopup id="menu_SaveAsCmdPopup">
                  <menuitem id="menu_SaveAsFileCmd"
                            label="&saveAsFileCmd.label;"
                            accesskey="&saveAsFileCmd.accesskey;"
                            command="cmd_saveAsFile"/>
                  <menuseparator id="menuSaveAfterSaveAsSeparator"/>
                  <menuitem id="menu_SaveAsDraftCmd"
                            label="&saveAsDraftCmd.label;"
                            accesskey="&saveAsDraftCmd.accesskey;"
                            command="cmd_saveAsDraft"/>
                  <menuitem id="menu_SaveAsTemplateCmd"
                            label="&saveAsTemplateCmd.label;"
                            accesskey="&saveAsTemplateCmd.accesskey;"
                            command="cmd_saveAsTemplate"/>
                </menupopup>
              </menu>
              <menuseparator id="menuFileAfterSaveAsSeparator"/>
              <menuitem id="menu_sendNow"
                        label="&sendNowCmd.label;"
                        accesskey="&sendNowCmd.accesskey;"
                        key="key_send" command="cmd_sendNow"/>
              <menuitem id="menu_sendLater"
                        label="&sendLaterCmd.label;"
                        accesskey="&sendLaterCmd.accesskey;"
                        key="key_sendLater"
                        command="cmd_sendLater"/>
              <menuseparator id="menuFileAfterSendLaterSeparator"/>
              <menuitem id="menu_printSetup"/>
              <menuitem id="menu_printPreview"/>
              <menuitem id="menu_print"/>
            </menupopup>
          </menu>
          <menu id="menu_Edit"/>
          <menu id="menu_View">
            <menupopup id="menu_View_Popup">
              <menu id="menu_Toolbars">
                <menupopup id="view_toolbars_popup"
                           onpopupshowing="onViewToolbarsPopupShowing(event)"
                           oncommand="onViewToolbarCommand(event);">
                  <menuitem id="menu_showFormatToolbar"
                            type="checkbox"
                            label="&showFormatToolbarCmd.label;"
                            accesskey="&showFormatToolbarCmd.accesskey;"
                            command="cmd_viewFormatToolbar"/>
                  <menuitem id="menu_showTaskbar"/>
                </menupopup>
              </menu>
            </menupopup>
          </menu>

          <menu id="insertMenu"
                command="cmd_renderedHTMLEnabler"/>

          <menu id="formatMenu"
                label="&formatMenu.label;"
                accesskey="&formatMenu.accesskey;"
                command="cmd_renderedHTMLEnabler">
            <menupopup id="formatMenuPopup">
              <menu id="tableMenu"/>
              <menuseparator id="menuFormatAfterTableSeparator"/>
              <menuitem id="objectProperties"/>
              <menuitem id="colorsAndBackground"/>
            </menupopup>
          </menu>

          <menu id="optionsMenu"
                label="&optionsMenu.label;"
                accesskey="&optionsMenu.accesskey;">
            <menupopup id="optionsMenuPopup">
              <menuitem id="menu_selectAddress"
                        label="&selectAddressCmd.label;"
                        accesskey="&selectAddressCmd.accesskey;"
                        command="cmd_selectAddress"/>
              <menuitem id="menu_quoteMessage"
                        label="&quoteCmd.label;"
                        accesskey="&quoteCmd.accesskey;"
                        command="cmd_quoteMessage"/>
              <menuseparator id="menuOptionsAfterQuoteSeparator"/>
              <menuitem id="returnReceiptMenu"
                        type="checkbox"
                        label="&returnReceiptMenu.label;"
                        accesskey="&returnReceiptMenu.accesskey;"
                        checked="false"
                        oncommand="ToggleReturnReceipt(event.target)"/>
              <menuitem id="dsnMenu"
                        type="checkbox"
                        label="&dsnMenu.label;"
                        accesskey="&dsnMenu.accesskey;"
                        checked="false"
                        oncommand="ToggleDSN(event.target);"/>
              <menu id="outputFormatMenu"
                    label="&outputFormatMenu.label;"
                    accesskey="&outputFormatMenu.accesskey;"
                    command="cmd_outputFormat">
                <menupopup id="outputFormatMenuPopup">
                  <menuitem id="format_auto"  type="radio" name="output_format" label="&autoFormatCmd.label;"      accesskey="&autoFormatCmd.accesskey;" checked="true"/>
                  <menuitem id="format_plain" type="radio" name="output_format" label="&plainTextFormatCmd.label;" accesskey="&plainTextFormatCmd.accesskey;"/>
                  <menuitem id="format_html"  type="radio" name="output_format" label="&htmlFormatCmd.label;"      accesskey="&htmlFormatCmd.accesskey;"/>
                  <menuitem id="format_both"  type="radio" name="output_format" label="&bothFormatCmd.label;"      accesskey="&bothFormatCmd.accesskey;"/>
                </menupopup>
              </menu>
              <menu id="priorityMenu"
                    label="&priorityMenu.label;"
                    accesskey="&priorityMenu.accesskey;"
                    oncommand="PriorityMenuSelect(event.target);">
                <menupopup id="priorityMenuPopup"
                           onpopupshowing="updatePriorityMenu(this);">
                  <menuitem id="priority_highest" type="radio" name="priority" label="&highestPriorityCmd.label;" accesskey="&highestPriorityCmd.accesskey;" value="Highest"/>
                  <menuitem id="priority_high"    type="radio" name="priority" label="&highPriorityCmd.label;"    accesskey="&highPriorityCmd.accesskey;"    value="High"/>
                  <menuitem id="priority_normal"  type="radio" name="priority" label="&normalPriorityCmd.label;"  accesskey="&normalPriorityCmd.accesskey;"  value="Normal"/>
                  <menuitem id="priority_low"     type="radio" name="priority" label="&lowPriorityCmd.label;"     accesskey="&lowPriorityCmd.accesskey;"     value="Low"/>
                  <menuitem id="priority_lowest"  type="radio" name="priority" label="&lowestPriorityCmd.label;"  accesskey="&lowestPriorityCmd.accesskey;"  value="Lowest"/>
                </menupopup>
              </menu>
              <menu id="charsetMenu"
                    onpopupshowing="UpdateCharsetMenu(gMsgCompose.compFields.characterSet, this);"
                    oncommand="ComposeSetCharacterSet(event);">
                <menupopup id="charsetPopup" detectors="false"/>
              </menu>
              <menu id="fccMenu"
                    label="&fileCarbonCopyCmd.label;"
                    accesskey="&fileCarbonCopyCmd.accesskey;"
                    sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
                    sortDirection="ascending"
                    datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
                    ref="msgaccounts:/"
                    oncommand="MessageFcc(event.target);">
                <menupopup id="fccMenuPopup"/>
                <template>
                  <rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
                    <menupopup>
                      <!--menuitem label="[current selection]" disabled="true"/>
                      <menuseparator/-->
                      <menu uri="..."
                            class="folderMenuItem menu-iconic"
                            label="rdf:http://home.netscape.com/NC-rdf#Name"
                            SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
                            BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
                            IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
                            IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
                            ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
                        <menupopup>
                          <menuitem label="&fileHereMenu.label;"
                                    fccUri="rdf:*"/>
                          <menuseparator/>
                        </menupopup>
                      </menu>
                    </menupopup>
                  </rule>
                  <rule nc:CanFileMessagesOnServer="false"/>
                  <rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
                    <menupopup>
                      <menu uri="..."
                            class="folderMenuItem menu-iconic"
                            label="rdf:http://home.netscape.com/NC-rdf#Name"
                            SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
                            BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
                            IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
                            IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
                            ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
                        <menupopup/>
                      </menu>
                    </menupopup>
                  </rule>
                  <rule nc:CanFileMessages="true">
                    <menupopup>
                      <menuitem uri="..."
                                class="folderMenuItem menuitem-iconic"
                                label="rdf:http://home.netscape.com/NC-rdf#Name"
                                SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
                                BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
                                IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
                                IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
                                ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
                                fccUri="rdf:*"/>
                    </menupopup>
                  </rule>
                </template>
              </menu>

            </menupopup>
          </menu>
          <menu id="tasksMenu"/>
          <menu id="windowMenu"/>
          <menu id="menu_Help"/>
        </menubar>
      </toolbaritem>
    </toolbar>

    <toolbar id="composeToolbar"
             class="toolbar-primary chromeclass-toolbar"
             persist="collapsed"
             grippytooltiptext="&mailToolbar.tooltip;"
             toolbarname="&showComposeToolbarCmd.label;"
             accesskey="&showComposeToolbarCmd.accesskey;"
             customizable="true"
             defaultset="button-send,separator,button-address,button-attach,spellingButton,button-security,separator,button-save,spring,throbber-box"
             context="toolbar-context-menu">
      <toolbarbutton id="button-send"
                     class="toolbarbutton-1"
                     label="&sendButton.label;"
                     tooltiptext="&sendButton.tooltip;"
                     now_label="&sendButton.label;"
                     now_tooltiptext="&sendButton.tooltip;"
                     later_label="&sendLaterCmd.label;"
                     later_tooltiptext="&sendlaterButton.tooltip;"
                     removable="true"
                     command="cmd_sendButton">
       <observes element="Communicator:WorkMode"
                 attribute="offline"/>
      </toolbarbutton>

      <toolbarbutton id="button-address"
                     class="toolbarbutton-1"
                     label="&addressButton.label;"
                     tooltiptext="&addressButton.tooltip;"
                     removable="true"
                     command="cmd_selectAddress"/>

      <toolbarbutton id="button-attach"
                     type="menu-button"
                     class="toolbarbutton-1"
                     label="&attachButton.label;"
                     tooltiptext="&attachButton.tooltip;"
                     removable="true"
                     command="cmd_attachFile">
        <menupopup id="button-attachPopup">
          <menuitem id="button-attachFile"
                    label="&attachFileCmd.label;"
                    accesskey="&attachFileCmd.accesskey;"
                    command="cmd_attachFile"/>
          <menuitem id="button-attachPage"
                    label="&attachPageCmd.label;"
                    accesskey="&attachPageCmd.accesskey;"
                    command="cmd_attachPage"/>
          <menuseparator id="buttonAttachAfterPageSeparator"/>
          <menuitem id="button-attachVCard"
                    type="checkbox"
                    label="&attachVCardCmd.label;"
                    accesskey="&attachVCardCmd.accesskey;"
                    command="cmd_attachVCard"/>
        </menupopup>
      </toolbarbutton>

      <toolbarbutton id="spellingButton"
                     type="menu-button"
                     class="toolbarbutton-1"
                     label="&spellingButton.label;"
                     removable="true"
                     command="cmd_spelling">
        <!-- this popup gets dynamically generated -->
        <menupopup id="languageMenuList"
                   oncommand="ChangeLanguage(event);"
                   onpopupshowing="OnShowDictionaryMenu(event.target);"/>
      </toolbarbutton>

      <toolbarbutton id="button-save"
                     type="menu-button"
                     class="toolbarbutton-1"
                     label="&saveButton.label;"
                     tooltiptext="&saveButton.tooltip;"
                     removable="true"
                     command="cmd_save">
        <menupopup id="button-savePopup">
          <menuitem id="button-saveAsFile"
                    label="&saveAsFileCmd.label;"
                    accesskey="&saveAsFileCmd.accesskey;"
                    command="cmd_saveAsFile"/>
          <menuseparator id="buttonSaveAfterFileSeparator"/>
          <menuitem id="button-saveAsDraft"
                    label="&saveAsDraftCmd.label;"
                    accesskey="&saveAsDraftCmd.accesskey;"
                    command="cmd_saveAsDraft"/>
          <menuitem id="button-saveAsTemplate"
                    label="&saveAsTemplateCmd.label;"
                    accesskey="&saveAsTemplateCmd.accesskey;"
                    command="cmd_saveAsTemplate"/>
        </menupopup>
      </toolbarbutton>

      <toolbaritem id="throbber-box"
                   class="toolbaritem-noline"
                   removable="true"
                   align="center">
          <button id="navigator-throbber"
                  oncommand="goClickThrobber('compose.throbber.url', event)"
                  onclick="checkForMiddleClick(this, event);"
                  tooltiptext="&throbber.tooltip;"/>
      </toolbaritem>
    </toolbar>

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

    <toolbar id="MsgHeadersToolbar"
             persist="collapsed"
             flex="1"
             grippytooltiptext="&addressBar.tooltip;"
             nowindowdrag="true">
      <hbox id="msgheaderstoolbar-box" flex="1">
        <vbox id="addresses-box" flex="1">
          <hbox align="center">
            <label value="&fromAddr.label;" accesskey="&fromAddr.accesskey;" control="msgIdentity"/>
            <menulist id="msgIdentity"
                      editable="true"
                      disableautoselect="true"
                      flex="1"
                      oncommand="LoadIdentity(false);">
              <menupopup id="msgIdentityPopup"/>
            </menulist>
          </hbox>
          <listbox id="addressingWidget" flex="1"/>
          <hbox align="center">
            <label value="&subject.label;" accesskey="&subject.accesskey;" control="msgSubject"/>
            <textbox id="msgSubject" flex="1" class="toolbar" disableonsend="true"
                     oninput="gContentChanged=true;SetComposeWindowTitle();"
                     onkeypress="subjectKeyPress(event);" />
          </hbox>
        </vbox>
        <splitter id="attachmentbucket-sizer" collapse="after"/>
        <vbox id="attachments-box">
          <label id="attachmentBucketText" value="&attachments.label;" crop="right"
                 accesskey="&attachments.accesskey;" control="attachmentBucket"/>
          <listbox id="attachmentBucket"
                   seltype="multiple"
                   flex="1"
                   rows="4"
                   tabindex="-1"
                   context="msgComposeAttachmentContext"
                   disableoncustomize="true"
                   onkeypress="if (event.keyCode == 8 || event.keyCode == 46) RemoveSelectedAttachment();"
                   onclick="AttachmentBucketClicked(event);"
                   ondragover="nsDragAndDrop.dragOver(event, attachmentBucketObserver);"
                   ondrop="nsDragAndDrop.drop(event, attachmentBucketObserver);"
                   ondragexit="nsDragAndDrop.dragExit(event, attachmentBucketObserver);"/>
        </vbox>
      </hbox>
    </toolbar>

    <!-- These toolbar items get filled out from the editorOverlay -->
    <toolbar id="FormatToolbar"
             class="chromeclass-toolbar"
             persist="collapsed"
             grippytooltiptext="&formatToolbar.tooltip;"
             nowindowdrag="true">
      <toolbaritem id="paragraph-select-container"/>
      <toolbaritem id="font-face-select-container"/>
      <toolbaritem id="color-buttons-container"
                   disableoncustomize="true"/>
      <toolbarbutton id="DecreaseFontSizeButton"/>
      <toolbarbutton id="IncreaseFontSizeButton"/>
      <toolbarseparator class="toolbarseparator-standard"/>
      <toolbarbutton id="boldButton"/>
      <toolbarbutton id="italicButton"/>
      <toolbarbutton id="underlineButton"/>
      <toolbarseparator class="toolbarseparator-standard"/>
      <toolbarbutton id="ulButton"/>
      <toolbarbutton id="olButton"/>
      <toolbarbutton id="outdentButton"/>
      <toolbarbutton id="indentButton"/>
      <toolbarseparator class="toolbarseparator-standard"/>
      <toolbarbutton id="AlignPopupButton"/>
      <toolbarbutton id="InsertPopupButton"/>
      <toolbarbutton id="smileButtonMenu"/>
      <spacer flex="1"/>
    </toolbar>

    <toolbarpalette id="MsgComposeToolbarPalette">
      <toolbarbutton id="print-button"/>
    </toolbarpalette>

  </toolbox>

  <splitter id="compose-toolbar-sizer"
            resizeafter="grow"
            onmousedown="awSizerListen();"
            oncommand="awSizerResized(this);">
    <observes element="MsgHeadersToolbar" attribute="collapsed"/>
  </splitter>

<!-- sidebar/toolbar/content/status -->
<hbox id="sidebar-parent" flex="1">
  <!-- From sidebarOverlay.xul -->
  <vbox id="sidebar-box" class="chromeclass-extrachrome" hidden="true"/>
  <splitter id="sidebar-splitter" class="chromeclass-extrachrome" hidden="true"/>

  <!-- The mail message body frame -->
  <vbox id="appcontent" flex="1">
    <findbar id="FindToolbar" browserid="content-frame"/>
    <editor id="content-frame"
            type="content-primary"
            src="about:blank"
            name="browser.message.body"
            minheight="100"
            flex="1"
            ondblclick="EditorDblClick(event);"
            context="contentAreaContextMenu"/>
  </vbox>
</hbox>

  <statusbar id="status-bar" class="chromeclass-status">
    <statusbarpanel id="component-bar"/>
    <statusbarpanel id="statusText" flex="1"/>
    <statusbarpanel class="statusbarpanel-progress" id="statusbar-progresspanel" collapsed="true">
      <progressmeter id="compose-progressmeter" class="progressmeter-statusbar" mode="normal" value="0"/>
    </statusbarpanel>
    <statusbarpanel checkfunc="MailCheckBeforeOfflineChange()" id="offline-status" class="statusbarpanel-iconic"/>
  </statusbar>

</window>
