<?xml version="1.0"?> 
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://global/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://messengercompose/content/addressingWidgetOverlay.xul"?>
<?xul-overlay href="chrome://editor/content/editorOverlay.xul"?>

<?xml-stylesheet href="chrome://editor/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://messengercompose/skin/" type="text/css"?> 

<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/

Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.

The Original Code is Mozilla Communicator client code, released
March 31, 1998.

The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->

<!DOCTYPE window SYSTEM "chrome://messengercompose/locale/messengercompose.dtd">

<window xmlns:html="http://www.w3.org/TR/REC-html40"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
		onunload="ComposeUnload()"
		onload="ComposeLoad()"
		width="640" height="480"
		title="&msgComposeWindow.title;"
		align="vertical"> 
  

<html:script language="JavaScript" src="chrome://editor/content/EditorCommands.js"/>
<html:script language="JavaScript" src="chrome://global/content/strres.js"/>
<html:script language="JavaScript" src="chrome://messengercompose/content/MsgComposeCommands.js"/>
<html:script language="JavaScript" src="chrome://messengercompose/content/addressAutoComplete.js"/>


<broadcasterset id="broadcasterset">
	<!-- File Menu -->
	<broadcaster id="cmd_newNavigator"/>
	<broadcaster id="cmd_newMessage"/>
	<broadcaster id="cmd_close" oncommand="CloseWindow()"/>
 	<broadcaster id="cmd_quit"/>
	<!-- Edit Menu -->
	<broadcaster id="cmd_undo"/>
	<broadcaster id="cmd_redo"/>
	<broadcaster id="cmd_cut"/>
	<broadcaster id="cmd_copy"/>
	<broadcaster id="cmd_paste"/>
	<broadcaster id="cmd_delete"/>
	<broadcaster id="cmd_selectAll"/>
	<broadcaster id="cmd_preferences"/>

	<broadcaster id="broadcaster_throbber" busy="false"/>
</broadcasterset>

<broadcaster id="args" value="editorType=default"/>

<!-- Interim hack to transition from nsIXULWindowCallbacks/ShowWindowWithArgs -->
<broadcaster id="dialog.start" ready="false"/>
<observes element="dialog.start" attribute="ready" onbroadcast="ComposeStartup()"/>

<keyset id="keyset">
	<!-- File Menu -->
	<key id="key_newNavigator"/>
	<key id="key_newMessage"/>
	<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"/>
	<key id="key_selectAll"/>
	<key id="key_preferences"/>
</keyset>

<!--- REMOVE KEYSET UNTIL IT WORKS CORRECTLY ON MAC!
ACTUALLY, EVERY TIME YOU TYPE ANY OF THE KEY DEFINED HERE AFTER WITHOUT ANY OF THE MODIFIERS PRESSED, THE COMMAND IS EXECUTED.

<keyset id="defaultKeySet">
	<key id="acmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="a" onkeypress="EditorSelectAll()" />
	<key id="bcmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="b" onkeypress="EditorApplyStyle('b')"/>
	<key id="ccmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="c" onkeypress="EditorCopy()" />
	<key id="fcmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="f" onkeypress="EditorFind()" />
	<key id="gcmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="g" onkeypress="EditorFindNext()" />
	<key id="icmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="i" onkeypress="EditorApplyStyle('i')"/>
	<key id="kcmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="k" onkeypress="CheckSpelling()" />
	<key id="ucmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="u" onkeypress="EditorApplyStyle('u')"/>
	<key id="vcmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="v" onkeypress="EditorPaste()" />
	<key id="xcmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="x" onkeypress="EditorCut()" />
	<key id="ycmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="y" onkeypress="EditorRedo()" />
	<key id="zcmdkey" disabled="false" shift="false" xulkey="true" alt="false" key="z" onkeypress="EditorUndo()" />
</keyset>

-->

<popupset>
  <popup id="TextColorPicker"/>
  <popup id="BackColorPicker"/>
</popupset>

<!-- box id="toolbar" align="vertical" style="width:100%;height:100%" -->
  <menubar>
	<menu id="menu_File">
      <menupopup id="menu_FilePopup">
        <menuitem value="&newMessage.label;" accessKey="&newMessage.accesskey;" key="key_newMessage" observes="cmd_newMessage"/>
        <menu id="menu_New">
          <menupopup>
            <menuitem id="menu_newNavigator"/>
            <menuitem id="menu_newMessage"/>
            <menuitem id="cmd_newCard"/>
          </menupopup>
        </menu>
		<menuseparator/>
		<menuitem id="menu_close"/>
		<menuitem value="&saveCmd.label;" cmd="nsCmd:ComposeSave"/>
		<menuitem value="&saveAsCmd.label;" oncommand="SaveAsDraft()"/>
		<menuitem value="&saveAsTemplateCmd.label;" oncommand="SaveAsTemplate()"/>
			<menu value="&attachMenu.label;">
			<menupopup>
			<menuitem value="&attachFileCmd.label;" oncommand="AttachFile()"/>
			<menuitem value="&attachPageCmd.label;" oncommand="AttachPage()"/>
			<menuitem value="&removeLastAttachmentCmd.label;" oncommand="RemoveSelectedAttachment()"/>
			<menuseparator/>
			<menuitem value="&attachVCardCmd.label;" oncommand="AttachVCard()"/>
			</menupopup>
		</menu>
		<menuseparator/>
		<menuitem value="&sendNowCmd.label;" oncommand="SendMessage()"/>
		<menuitem value="&sendLaterCmd.label;" oncommand="SendMessageLater()"/>
		<menuitem value="&quoteOrigCmd.label;" cmd="nsCmd:ComposeQuote"/>
		<menuitem value="&selectAddressCmd.label;" oncommand="SelectAddress()"/>
		<menuseparator/>
		<menuitem id="menu_pageSetup"/>
		<menuitem value="&printPreviewCmd.label;" cmd="nsCmd:BrowserPrintPreview"/>
		<menuitem value="&printCmd.label;" cmd="nsCmd:BrowserPrint"/>
		<menuseparator/>
		</menupopup>
	</menu>
	<menu id="menu_Edit">
		<menupopup>
			<menuitem id="menu_undo"/>
			<menuitem id="menu_redo"/>
			<menuseparator/>
			<menuitem id="menu_cut"/>
			<menuitem id="menu_copy"/>
			<menuitem id="menu_paste"/>
			<menuitem value="&pasteAsQuotCmd.label;" cmd="nsCmd:ComposeNYI"/>
			<menuseparator/>
			<menuitem id="menu_delete"/>
			<menuseparator/>
			<menuitem id="menu_selectAll"/>
			<menuseparator/>
			<menuitem value="&findCmd.label;" cmd="nsCmd:ComposeNYI"/>
			<menuitem value="&findAgainCmd.label;" cmd="nsCmd:ComposeNYI"/>
			<menuseparator/>
			<menuitem value="&doNotCompleteAddrCmd.label;" cmd="nsCmd:ComposeNYI"/>
			<menuitem value="&showMatchingAddrCmd.label;" cmd="nsCmd:ComposeNYI"/>
			<menuseparator/>
			<menuitem id="menu_preferences" oncommand="goPreferences('messengercompose.xul', 'chrome://messengercompose/content/pref-messages.xul')"/>
		</menupopup>
	</menu>
	<menu id="menu_View">
		<menupopup>
			<menu id="menu_Toolbars">
				<menupopup>
		            <menuitem id="menu_showComposeToolbar"
		                      value="&showComposeToolbarCmd.label;"
		                      accesskey="&showComposeToolbarCmd.accesskey;"
		                      oncommand="goToggleToolbar('composeToolbar', 'menu_showComposeToolbar')"
		                      checked="true"/>
					<menuitem id="menu_showTaskbar"/>
				</menupopup>
			</menu>
			<menuseparator/>
			<menuitem value="&addressCmd.label;" cmd="nsCmd:ComposeNYI"/>
			<menuitem value="&attachmentsCmd.label;" cmd="nsCmd:ComposeNYI"/>
			<menuseparator/>
			<menuitem value="&wrapCmd.label;" cmd="nsCmd:ComposeNYI"/>
			<menuseparator/>
			<menu value="&dcharMenu.label;">
			<menupopup>
			<menuitem value="&dcharIso1Cmd.label;" oncommand="SetDocumentCharacterSet('ISO-8859-1');"/>
			<menuitem value="&dcharIso2Cmd.label;" oncommand="SetDocumentCharacterSet('ISO-8859-2');"/>
			<menuitem value="&dcharIso3Cmd.label;" oncommand="SetDocumentCharacterSet('ISO-8859-3');"/>
			<menuitem value="&dcharIso4Cmd.label;" oncommand="SetDocumentCharacterSet('ISO-8859-4');"/>
			<menuitem value="&dcharIso9Cmd.label;" oncommand="SetDocumentCharacterSet('ISO-8859-9');"/>
			<menuitem value="&dcharIso10Cmd.label;" oncommand="SetDocumentCharacterSet('ISO-8859-10');"/>
			<menuitem value="&dcharIso14Cmd.label;" oncommand="SetDocumentCharacterSet('ISO-8859-14');"/>
			<menuitem value="&dcharIso15Cmd.label;" oncommand="SetDocumentCharacterSet('ISO-8859-15');"/>
			 <menuseparator />
			<menuitem value="&dcharJapanCmd.label;" oncommand="SetDocumentCharacterSet('ISO-2022-JP');"/>
			 <menuseparator />
			<menuitem value="&dcharTradChiBigCmd.label;" oncommand="SetDocumentCharacterSet('Big5');"/>
			<menuitem value="&dcharSimpChiGbCmd.label;" oncommand="SetDocumentCharacterSet('GB2312');"/>
			 <menuseparator />
			<menuitem value="&dcharKoreanCmd.label;" oncommand="SetDocumentCharacterSet('EUC-KR');"/>
			 <menuseparator />
			<menuitem value="&dcharUtf8Cmd.label;" oncommand="SetDocumentCharacterSet('UTF-8');"/>
			 <menuseparator />
			<menuitem value="&dcharRusCmd.label; " oncommand="SetDocumentCharacterSet('KOI8-R');"/>
			<menuitem value="&dcharUkrCmd.label;" oncommand="SetDocumentCharacterSet('KOI8-U');"/>
			 <menuseparator />
			<menuitem value="&dcharIsoGreekCmd.label;" oncommand="SetDocumentCharacterSet('ISO-8859-7');"/>
			 <menuseparator />
			<menuitem value="&dcharVietViCmd.label;" oncommand="SetDocumentCharacterSet('VISCII');"/>
			 <menuseparator />
			<menuitem value="&dcharThaiCmd.label;" oncommand="SetDocumentCharacterSet('TIS-620');"/>
			 <menuseparator />
			<menuitem value="&dcharArmCmd.label;" oncommand="SetDocumentCharacterSet('ARMSCII-8');"/>
			</menupopup>
		</menu>
	</menupopup>
    </menu>

	<!-- entire menus come from editorOverlay -->
	<menu id="insertMenu"/>
  <menu id="formatMenu" value="&formatMenu.label;" accesskey="&formatmenu.accesskey;">
    <menupopup id="formatMenuPopup"/>
  </menu>
  <menu id="tableMenu"/>

	<menu value="&messageMenu.label;">
		<menupopup>
		<menu value="&priorityMenu.label;" oncommand="PriorityMenuSelect(event.target);">
    		<menupopup>
			<menuitem value="&lowestPriorityCmd.label;" id="lowest"/>
    		<menuitem value="&lowPriorityCmd.label;" id="low"/>
    		<menuitem value="&normalPriorityCmd.label;" id="normal"/>
    		<menuitem value="&highPriorityCmd.label;" id="high"/>
    		<menuitem value="&highestPriorityCmd.label;" id="highest"/>
			</menupopup>
	   	</menu>
    	<menuitem value="&returnReceiptCmd.label;" oncommand="ReturnReceiptMenuSelect();"/>
	   	<menuitem value="&uuEncodeCmd.label;" oncommand="UUEncodeMenuSelect();"/>
	   	<menu value="&outputFormatMenu.label;" oncommand="OutputFormatMenuSelect(event.target);">
    		<menupopup>
			<menuitem value="&askmeFormatCmd.label;" id="1"/>
    		<menuitem value="&plainTextFormatCmd.label;" id="2"/>
    		<menuitem value="&htmlFormatCmd.label;" id="3"/>
    		<menuitem value="&bothFormatCmd.label;" id="4"/>
			</menupopup>
	   	</menu>
    	<menuseparator/>
		<menu value="&fileCarbonCopyCmd.label;" datasources="rdf:mailnewsfolders rdf:msgaccountmanager" ref="msgaccounts:/" rdf:ignore="http://home.netscape.com/NC-rdf#MessageChild" 
			oncommand="MessageFcc(event.target)">
			<menupopup/>
                  <template>
                    <rule iscontainer="true" isempty="false">
                      <menupopup>
					  <menu uri="..." value="rdf:http://home.netscape.com/NC-rdf#Name"/>
					  </menupopup>
                    </rule>
                    <rule>
                      <menupopup>
					  <menuitem uri="..." value="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgCopyMessage(event.target)" />
					  </menupopup>
                    </rule>
                  </template>
		</menu>
	  </menupopup>
    </menu>
    <menu id="debugMenu"/>
	<menu id="tasksMenu"/>
	<menu id="menu_Help"/>
	<spring flex="100%"/>
  </menubar>
  <toolbox>
    <toolbar id="composeToolbar" class="standard" persist="collapsed">
		<box id="toolbar_button_box">
	 		<titledbutton id="button_send" class="button28" align="top" value="&sendButton.label;" onclick="SendMessage()"/>
	 		<titledbutton id="button_address" class="other28" align="top" value="&addressButton.label;" onclick="SelectAddress()"/>
	 		<titledbutton id="button_attach" class="other28" align="top" value="&attachButton.label;" onclick="AttachFile()"/>
	 		<titledbutton id="button_quote" class="other28" align="top" value="&quoteButton.label;" onclick="QuoteMessage()"/>
	 		<titledbutton id="button_spelling" class="other28" align="top" value="&spellingButton.label;" onclick="Spelling()"/>
	 		<titledbutton id="button_save" class="other28" align="top" value="&saveButton.label;" onclick="SaveAsDraft()"/>
	 		<titledbutton id="button_stop" class="other28" align="top" value="&stopButton.label;" onclick="Stop()"/>
	    	<spring flex="100%"/>
		</box>

		<box id="toolbar_throbber_box" align="vertical">
			<titledbutton id="Throbber" onclick="window.open('&throbber.url;');">
				<observes element="broadcaster_throbber" attribute="busy"/>
			</titledbutton>
		</box>
	</toolbar>

	<toolbar id="MsgHeadersToolbar" persist="collapsed">
		<box align="horizontal" flex="100%">
			<spring style="width:0.5em"/>
			<box align="vertical" flex="60%">
				<spring style="height:0.5em"/>
				<box align="horizontal">
					<html:div>&fromAddr.label;</html:div>
					<spring style="width:0.5em"/>
					<html:select id="msgIdentity" flex="100%"
						onkeyup="if (event.which == 9) ShouldITabIntoBody(2);"
						onfocus="ShouldITabIntoBody(1);"/>
				</box>
				<spring style="height:0.5em"/>

				<!-- addressing widget -->
				<box id="addressingWidget"/>
				<spring style="height:0.5em"/>
				
				<box align="horizontal">
					<html:div>&subject.label;</html:div>
					<spring style="width:0.5em"/>
				    <html:input id="msgSubject" type="text" flex="100%"
						onkeyup="SetComposeWindowTitle(event.which);"
						onblur="ShouldITabIntoBody(0);"/>
				</box>
				<spring style="height:0.5em"/>
			</box>
			
			<spring style="width:0.5em"/>
			<box align="vertical" flex="40%">
				<spring style="height:0.5em"/>
				<box align="vertical" style="height:1em">
					<html:div flex="100%">&attachments.label;</html:div>
				</box>
				<spring style="height:0.5em"/>
				<box align="vertical" style="height:8.5em; background-color:white; border-top:solid black 1px">
					<tree id="attachmentBucket" flex="100%" onkeypress="if (event.which == 8) RemoveSelectedAttachment();">
						<treecol style="width:100%"/>

						<treechildren id="bucketBody">
						</treechildren>
					</tree>
				</box>
				<spring style="height:0.5em"/>
			</box>
			<spring style="width:0.5em"/>
		</box>
	</toolbar>

    <!-- These toolbar items get filled out from the editorOverlay -->
    <toolbar id="FormatToolbar" persist="collapsed">
      <html:div>
        <!-- items are filled out from editorOverlay -->
        <html:select id="ParagraphSelect"/>
        <html:select id="FontFaceSelect"/>
      </html:div>

      <html:div id="ColorButtons"/>
      
      <titledbutton id="DecreaseFontSizeButton"/>
      <titledbutton id="IncreaseFontSizeButton"/>
      <titledbutton id="boldButton"/>
      <titledbutton id="italicButton"/>
      <titledbutton id="underlineButton"/>
      <titledbutton id="ulButton"/>
      <titledbutton id="olButton"/>
      <titledbutton id="outdentButton"/>
      <titledbutton id="indentButton"/>

      <menu>
        <titledbutton id="AlignPopupButton"/>
        <menupopup id="AlignmentPopup"/>
      </menu>

      <menu>
        <titledbutton id="InsertPopupButton"/>
	    <menupopup id="InsertPopup"/>
      </menu>
      <spring flex="100%"/>
    </toolbar>
</toolbox>

    <!-- The main mail three pane frame -->
    <html:iframe type="content-primary" id="content-frame" src="about:blank" name="browser.message.body" flex="100%"/>

    <box id="status-bar">
		<box align="vertical" style="width:100px">
			<spring flex="100%"/>
			<progressmeter mode="normal" value="0">
			</progressmeter>
			<spring flex="100%"/>
		</box>
		<titledbutton id="statusText" align="right" flex="100%" value="Document: Done"/>
    </box>

<!-- /box -->
	<toolbar id="taskbar"/>
</window>

