<?xml version="1.0"?> 
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?> 
<?xml-stylesheet href="chrome://editor/skin/" type="text/css"?> 

<!DOCTYPE window
[

<!-- These entity declarations will go into a separate, locale file at some point -->
<!-- Window title -->
<!ENTITY textEditorWindow.title "Text Editor">

<!-- Menu items:  the . means that the menu item isn't implemented yet -->

<!-- File menu items -->
<!ENTITY fileMenu.label "File">
<!ENTITY newCmd.label "New">
<!ENTITY openCmd.label "Open...">
<!ENTITY closeCmd.label "Close">
<!ENTITY saveCmd.label "Save">
<!ENTITY saveAsCmd.label "Save As...">
<!ENTITY printSetupCmd.label ".Print Setup...">
<!ENTITY printPreviewCmd.label "Print Preview">
<!ENTITY printCmd.label "Print...">
<!ENTITY quitCmd.label "Quit">

<!-- Edit menu items -->
<!ENTITY editMenu.label "Edit">
<!ENTITY undoCmd.label "Undo">
<!ENTITY redoCmd.label "Redo">
<!ENTITY cutCmd.label "Cut">
<!ENTITY copyCmd.label "Copy">
<!ENTITY pasteCmd.label "Paste">
<!ENTITY pasteAsQuotationCmd.label "Paste">
<!ENTITY clearCmd.label ".Clear">
<!ENTITY selectAllCmd.label "Select All">
<!ENTITY findCmd.label "Find...">
<!ENTITY findAgainCmd.label "Find Again">

<!-- View menu items -->
<!ENTITY viewMenu.label "View">
<!ENTITY hideCompositionToolbarCmd.label ".Hide Composition Toolbar">
<!ENTITY showCompositionToolbarCmd.label ".Show Composition Toolbar">
<!ENTITY hideFormattingToolbarCmd.label ".Hide Format Toolbar">
<!ENTITY showFormattingToolbarCmd.label ".Show Format Toolbar">

<!-- Insert menu items -->
<!ENTITY insertMenu.label "Insert">
<!ENTITY insertLinkCmd.label "Link...">
<!ENTITY insertTargetCmd.label ".Target...">
<!ENTITY insertImageCmd.label "Image...">
<!ENTITY insertHLineCmd.label "Horizontal Line">
<!ENTITY insertTableCmd.label "Table...">
<!ENTITY insertHTMLSourceCmd.label ".HTML Source...">
<!ENTITY insertLineBreakCmd.label ".Line Break">
<!ENTITY insertBreakBelowImagesCmd.label ".Break Below Image(s)">

<!-- Format menu items -->
<!ENTITY formatMenu.label "Format">

<!ENTITY fontfaceMenu.label "Font Face">
<!ENTITY defaultVariableWidthCmd.label "Default Variable Width">
<!ENTITY defaultFixedWidthCmd.label "Default Fixed Width">
<!ENTITY arialHelveticaFont.label "Arial, Helvetica">
<!ENTITY timesFont.label "Times">
<!ENTITY courierFont.label "Courier">

<!ENTITY fontsizeMenu.label "Size">
<!ENTITY sizeMinusTwoCmd.label " -2">
<!ENTITY sizeMinusOneCmd.label " -1 (smaller)">
<!ENTITY sizeNormalCmd.label " Normal">
<!ENTITY sizePlusOneCmd.label " +1 (bigger)">
<!ENTITY sizePlusTwoCmd.label " +2">
<!ENTITY sizePlusThreeCmd.label " +3">
<!ENTITY sizePlusFourCmd.label " +4">

<!ENTITY fontStyleMenu.label "Style">
<!ENTITY styleBoldCmd.label "Bold">
<!ENTITY styleItalicCmd.label "Italic">
<!ENTITY styleUnderlineCmd.label "Underline">
<!ENTITY styleStrikeThruCmd.label "Strikethrough">
<!ENTITY styleSuperscriptCmd.label "Superscript">
<!ENTITY styleSubscriptCmd.label "Subscript">
<!ENTITY styleBlinkCmd.label "Blink">
<!ENTITY styleNonbreakingCmd.label "Nonbreaking">

<!ENTITY fontColorMenu.label "Text Color">
<!ENTITY colorBlackCmd.label "Black">
<!ENTITY colorGrayCmd.label "Gray">
<!ENTITY colorSilverCmd.label "Silver">
<!ENTITY colorWhiteCmd.label "White">
<!ENTITY colorRedCmd.label "Red">
<!ENTITY colorBlueCmd.label "Blue">
<!ENTITY colorGreenCmd.label "Green">
<!ENTITY colorCyanCmd.label "Cyan">
<!ENTITY colorYellowCmd.label "Yellow">
<!ENTITY colorMagentaCmd.label "Magenta">

<!ENTITY backgroundColorMenu.label "Background Color">

<!ENTITY paragraphHeadingMenu.label "Paragraph / Heading">
<!ENTITY paragraphNormalCmd.label "Normal">
<!ENTITY headingOneCmd.label "Heading 1">
<!ENTITY headingTwoCmd.label "Heading 2">
<!ENTITY headingThreeCmd.label "Heading 3">
<!ENTITY headingFourCmd.label "Heading 4">
<!ENTITY headingFiveCmd.label "Heading 5">
<!ENTITY headingSixCmd.label "Heading 6">
<!ENTITY paragraphBlockquoteCmd.label "Blockquote">
<!ENTITY paragraphAddressCmd.label "Address">
<!ENTITY paragraphPreformatCmd.label "Preformat">
<!ENTITY paragraphListCmd.label "List item">
<!ENTITY paragraphDfnTermCmd.label "Definition term">
<!ENTITY paragraphDfnDescCmd.label "Definition description">

<!ENTITY removeAllStylesCmd.label "Remove All Style(s)">

<!ENTITY toolsMenu.label "Tools">
<!ENTITY newBrowserCmd.label "New Browser Window">
<!ENTITY newPlaintextEditorCmd.label "New Plaintext Editor">
<!ENTITY checkSpellingCmd.label "Check Spelling...">
<!ENTITY setFocusCmd.label "Set Focus">

<!ENTITY debugMenu.label "Debug">
<!ENTITY outputTextCmd.label "Output Text">
<!ENTITY outputHTMLCmd.label "Output HTML">
<!ENTITY insertTextCmd.label "Insert Text">
<!ENTITY testSelectionCmd.label "Test Selection">
<!ENTITY testDocumentCmd.label "Test Document">
<!ENTITY runUnitTestsCmd.label "Run Unit Tests">

<!ENTITY helpMenu.label "Help">
<!ENTITY aboutCmd.label ".About">

<!-- formatting toolbar -->
<!ENTITY paragraphToolbarMenu.label "Paragraph">
<!ENTITY fontToolbarMenu.label "Font">
<!ENTITY sizeToolbarMenu.label "Size">
<!ENTITY formatToolbar.boldChar "B">
<!ENTITY formatToolbar.italicChar "I">
<!ENTITY formatToolbar.underlineChar "U">
<!ENTITY bulletListIcon.url "chrome://editor/skin/images/ED_Bullets.gif">
<!ENTITY numberListIcon.url "chrome://editor/skin/images/ED_Numbers.gif">
<!ENTITY outdentIcon.url "chrome://editor/skin/images/ED_Outdent.gif">
<!ENTITY indentIcon.url "chrome://editor/skin/images/ED_Indent.gif">
<!ENTITY alignpopupIcon.url "chrome://editor/skin/images/ED_Align.gif">
<!ENTITY alignLeft.label "Left">
<!ENTITY alignCenter.label "Center">
<!ENTITY alignRight.label "Right">
<!ENTITY alignJustify.label "Justify">
<!ENTITY linkIcon.url "chrome://editor/skin/images/ED_Link.gif">
<!ENTITY imageIcon.url "chrome://editor/skin/images/ED_Image.gif">
<!ENTITY spellingIcon.url "chrome://editor/skin/images/ED_Spell.gif">
<!ENTITY linkToolbarCmd.label "Link">
<!ENTITY imageToolbarCmd.label "Image">
<!ENTITY spellToolbarCmd.label "Spell">

<!ENTITY tempNotification.label "[Notification Component]">
<!ENTITY tempDoneLoading.label "Document: Done">

]> 

<window id="main-window" xmlns:html="http://www.w3.org/TR/REC-html40"
			  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
			  onunload="EditorShutdown()" title="&textEditorWindow.title;" align="vertical">

  <html:script language="JavaScript" src="chrome://editor/content/EditorCommands.js">
  </html:script>

  <keyset id="defaultKeySet">
    <key id="acmdkey" disabled="false" shift="false" command="true" alt="false" key="a" onkeypress="EditorSelectAll()" />
    <key id="bcmdkey" disabled="false" shift="false" command="true" alt="false" key="b" onkeypress="EditorApplyStyle('b')"/>
    <key id="ccmdkey" disabled="false" shift="false" command="true" alt="false" key="c" onkeypress="EditorCopy()" />
    <key id="fcmdkey" disabled="false" shift="false" command="true" alt="false" key="f" onkeypress="EditorFind()" />
    <key id="gcmdkey" disabled="false" shift="false" command="true" alt="false" key="g" onkeypress="EditorFindNext()" />
    <key id="icmdkey" disabled="false" shift="false" command="true" alt="false" key="i" onkeypress="EditorApplyStyle('i')"/>
    <key id="kcmdkey" disabled="false" shift="false" command="true" alt="false" key="k" onkeypress="CheckSpelling()" />
    <key id="ncmdkey" disabled="false" shift="false" command="true" alt="false" key="n" onkeypress="EditorNew()" />
    <key id="ocmdkey" disabled="false" shift="false" command="true" alt="false" key="o" onkeypress="EditorOpen()" />
    <key id="pcmdkey" disabled="false" shift="false" command="true" alt="false" key="p" onkeypress="EditorPrint()" />
    <key id="qcmdkey" disabled="false" shift="false" command="true" alt="false" key="q" onkeypress="EditorExit()" />
    <key id="ucmdkey" disabled="false" shift="false" command="true" alt="false" key="u" onkeypress="EditorApplyStyle('u')"/>
    <key id="vcmdkey" disabled="false" shift="false" command="true" alt="false" key="v" onkeypress="EditorPaste()" />
    <key id="wcmdkey" disabled="false" shift="false" command="true" alt="false" key="w" onkeypress="EditorClose()" />
    <key id="xcmdkey" disabled="false" shift="false" command="true" alt="false" key="x" onkeypress="EditorCut()" />
    <key id="ycmdkey" disabled="false" shift="false" command="true" alt="false" key="y" onkeypress="EditorRedo()" />
    <key id="zcmdkey" disabled="false" shift="false" command="true" alt="false" key="z" onkeypress="EditorUndo()" />

<!-- how to handle return, enter, tab, function keys, arrow keys, others? -->
  </keyset>

  <broadcaster id="args" value="chrome://editor/content/EditorInitPagePlain.html"/>
  <broadcaster id="canPrint"/>
  
  <!-- Interim hack to transition from nsIXULWindowCallbacks/ShowWindowWithArgs -->
  <broadcaster id="dialog.start" ready="false"/>
  <observes element="dialog.start" attribute="ready" onchange="EditorStartup('text')"/>
    
  <menubar>
    <menu name="&fileMenu.label;">
      <menuitem name="&newCmd.label;" onclick="EditorNew()"/>
      <menuitem name="&openCmd.label;" onclick="EditorOpen()"/>
      <menuitem name="&closeCmd.label;" onclick="EditorClose()"/>
      <separator />
      <menuitem name="&saveCmd.label;" onclick="EditorSave()"/>
      <menuitem name="&saveAsCmd.label;" onclick="EditorSaveAs()"/>
      <separator />
      <menuitem name="&printSetupCmd.label;" onclick=""/>
      <menuitem name="&printPreviewCmd.label;" onclick="EditorPrintPreview()"/>
      <menuitem name="&printCmd.label;" onclick="EditorPrint()"/>
      <separator />
      <menuitem name="&quitCmd.label;" onclick="EditorExit()"/>
    </menu>

    <menu name="&editMenu.label;">
      <menuitem name="&undoCmd.label;" onclick="EditorUndo()"/>
      <menuitem name="&redoCmd.label;" onclick="EditorRedo()"/>
      <separator />
      <menuitem name="&cutCmd.label;" onclick="EditorCut()"/>
      <menuitem name="&copyCmd.label;" onclick="EditorCopy()"/>
      <menuitem name="&pasteCmd.label;" onclick="EditorPaste()"/>
      <menuitem name="&pasteAsQuotationCmd.label;" onclick="EditorPasteAsQuotation()"/>
      <menuitem name="&clearCmd.label;" onclick=""/>
      <separator />
      <menuitem name="&selectAllCmd.label;" onclick="EditorSelectAll()"/>
      <separator />
      <menuitem name="&findCmd.label;" onclick="EditorFind()"/>
      <menuitem name="&findAgainCmd.label;" onclick="EditorFindNext()"/>
    </menu>

    <menu name="&viewMenu.label;">
      <menuitem name="&hideCompositionToolbarCmd.label;" onclick=""/>
      <menuitem name="&hideFormattingToolbarCmd.label;" onclick="" />
    </menu>
 
    <menu name="&insertMenu.label;">
      <menuitem name="&insertLinkCmd.label;" onclick="EditorInsertLink()"/>
      <menuitem name="&insertTargetCmd.label;" onclick=""/>
      <menuitem name="&insertImageCmd.label;" onclick="EditorInsertImage()"/>
      <menuitem name="&insertHLineCmd.label;" onclick="EditorInsertHLine()"/>
      <menuitem name="&insertTableCmd.label;" onclick="EditorInsertTable()"/>
      <menuitem name="&insertHTMLSourceCmd.label;" onclick="EditorInsertHTML()"/>
      <separator />
      <menuitem name="&insertLineBreakCmd.label;" onclick=""/>
      <menuitem name="&insertBreakBelowImagesCmd.label;" onclick=""/>
    </menu>
    <menu name="&formatMenu.label;">
      <menu name="&fontfaceMenu.label;">
        <menuitem name="&defaultVariableWidthCmd.label;" onclick="EditorSetFontFace('')"/>
        <menuitem name="&defaultFixedWidthCmd.label;" onclick="EditorSetFontFace('tt')"/>
        <separator/>
        <menuitem name="&arialHelveticaFont.label;" onclick="EditorSetFontFace('Arial, Helvetica, sans-serif')"/>
        <menuitem name="&timesFont.label;" onclick="EditorSetFontFace('Times New Roman, Times, serif')"/>
        <menuitem name="&courierFont.label;" onclick="EditorSetFontFace('Courier New, Courier, mono')"/>
      </menu>
      <menu name="&fontsizeMenu.label;">
        <menuitem name="&sizeMinusTwoCmd.label;" onclick="EditorSetFontSize('-2')"/>
        <menuitem name="&sizeMinusOneCmd.label;" onclick="EditorSetFontSize('-1')"/>
        <menuitem name="&sizeNormalCmd.label;" onclick="EditorSetFontSize('0')"/>
        <menuitem name="&sizePlusOneCmd.label;" onclick="EditorSetFontSize('+1')"/>
        <menuitem name="&sizePlusTwoCmd.label;" onclick="EditorSetFontSize('+2')"/>
        <menuitem name="&sizePlusThreeCmd.label;" onclick="EditorSetFontSize('+3')"/>
        <menuitem name="&sizePlusFourCmd.label;" onclick="EditorSetFontSize('+4')"/>
      </menu>
      <menu name="&fontStyleMenu.label;">
        <menuitem name="&styleBoldCmd.label;" onclick="EditorApplyStyle('b')"/>
        <menuitem name="&styleItalicCmd.label;" onclick="EditorApplyStyle('i')"/>
        <menuitem name="&styleUnderlineCmd.label;" onclick="EditorApplyStyle('u')"/>
        <menuitem name="&styleStrikeThruCmd.label;" onclick="EditorApplyStyle('strike')"/>
        <menuitem name="&styleSuperscriptCmd.label;" onclick="EditorApplyStyle('sup')"/>
        <menuitem name="&styleSubscriptCmd.label;" onclick="EditorApplyStyle('sub')"/>
        <menuitem name="&styleBlinkCmd.label;" onclick="EditorApplyStyle('blink')"/>
        <menuitem name="&styleNonbreakingCmd.label;" onclick="EditorApplyStyle('nobr')"/>
      </menu>
      <menuitem name="&fontColorMenu.label;" onclick=""/>
      <menuitem name="&removeAllStylesCmd.label;" onclick="EditorRemoveStyle('all')"/>
      <separator />
      <menu name="&paragraphHeadingMenu.label;">
        <menuitem name="&paragraphNormalCmd.label;"    onclick="EditorSetParagraphFormat('normal')"/>
        <menuitem name="&headingOneCmd.label;"         onclick="EditorSetParagraphFormat('h1')"/>
        <menuitem name="&headingTwoCmd.label;"         onclick="EditorSetParagraphFormat('h2')"/>
        <menuitem name="&headingThreeCmd.label;"       onclick="EditorSetParagraphFormat('h3')"/>
        <menuitem name="&headingFourCmd.label;"        onclick="EditorSetParagraphFormat('h4')"/>
        <menuitem name="&headingFiveCmd.label;"        onclick="EditorSetParagraphFormat('h5')"/>
        <menuitem name="&headingSixCmd.label;"         onclick="EditorSetParagraphFormat('h6')"/>
        <menuitem name="&paragraphAddressCmd.label;"   onclick="EditorSetParagraphFormat('address')"/>
        <menuitem name="&paragraphPreformatCmd.label;" onclick="EditorSetParagraphFormat('pre')"/>
        <menuitem name="&paragraphListCmd.label;"      onclick="EditorSetParagraphFormat('li')"/>
        <menuitem name="&paragraphDfnTermCmd.label;"   onclick="EditorSetParagraphFormat('dt')"/>
        <menuitem name="&paragraphDfnDescCmd.label;"   onclick="EditorSetParagraphFormat('dd')"/>
      </menu>
    </menu>
    <menu name="&toolsMenu.label;">
      <menuitem name="&newBrowserCmd.label;" onclick="EditorNewBrowser()"/>
      <menuitem name="&newPlaintextEditorCmd.label;" onclick="EditorNewPlaintext()"/>
      <separator />
      <menuitem name="&checkSpellingCmd.label;" onclick="CheckSpelling()"/>
      <menuitem name="&setFocusCmd.label;" onclick="window.focus()"/>
    </menu>
    <menu name="&debugMenu.label;">
      <menuitem name="&outputTextCmd.label;" onclick="EditorGetText()"/>
      <menuitem name="&outputHTMLCmd.label;" onclick="EditorGetHTML()"/>
      <separator />
      <menuitem name="&insertTextCmd.label;" onclick="EditorInsertText('All good things come to those who wait. ')"/>
      <separator />
      <menuitem name="&testSelectionCmd.label;" onclick="EditorTestSelection()"/>
      <menuitem name="&testDocumentCmd.label;" onclick="EditorTestDocument()"/>
      <menuitem name="&runUnitTestsCmd.label;" onclick="EditorUnitTests()"/>
    </menu>
    <menu name="&helpMenu.label;">
      <menuitem name="&aboutCmd.label;" onclick=""/>
    </menu>
  </menubar>
  
  <broadcaster id="Editor:Style:IsBold" bold="false"/>
  <broadcaster id="Editor:Style:IsItalic"/>
  <broadcaster id="Editor:Style:IsUnderline"/>

    <toolbox>
      <toolbar>
		    <titledbutton id="ParagraphPopup" value="&paragraphToolbarMenu.label;" class="popup" align="left" popup="ParagraphMenu" popupanchor="bottomleft"/>
		    <titledbutton id="FontFacePopup" value="&fontToolbarMenu.label;" class="popup" align="left" popup="FontFaceMenu" popupanchor="bottomleft"/>
		    <titledbutton id="FontSizePopup" value="&sizeToolbarMenu.label;" class="popup" align="left" popup="FontSizeMenu" popupanchor="bottomleft"/>
		    <titledbutton id="TextColorPopup" src="chrome://editor/skin/images/ED_TextColor.gif" class="popup" popup="TextColorMenu" popupanchor="bottomleft"/>
		    <titledbutton id="BackColorPopup" src="chrome://editor/skin/images/ED_BackColor.gif" class="popup" popup="BackColorMenu" popupanchor="bottomleft"/>
        <titledbutton id="BoldButton" value="&formatToolbar.boldChar;" onclick="EditorApplyStyle('b')">
		      <observes element="Editor:Style:IsBold" attribute="bold" onchange="onBoldChange()"/>
        </titledbutton>
	      <titledbutton id="ItalicButton" value="&formatToolbar.italicChar;" onclick="EditorApplyStyle('i')"/>
	      <titledbutton id="UnderlineButton" value="&formatToolbar.underlineChar;" onclick="EditorApplyStyle('u')"/>
<!--
        <titledbutton id="BoldButton" src="chrome://editor/skin/images/ED_Bold.gif" align="bottom" onclick="EditorApplyStyle('b')">
		      <observes element="Editor:Style:IsBold" attribute="bold" onchange="onBoldChange()"/>
        </titledbutton>
	      <titledbutton id="ItalicButton" src="chrome://editor/skin/images/ED_Italic.gif" align="bottom" onclick="EditorApplyStyle('i')"/>
	      <titledbutton id="UnderlineButton" src="chrome://editor/skin/images/ED_Underline.gif" align="bottom" onclick="EditorApplyStyle('u')"/>
-->
	      <titledbutton src="&bulletListIcon.url;" align="bottom" onclick="EditorInsertList('ul')"/>
	      <titledbutton src="&numberListIcon.url;" align="bottom" onclick="EditorInsertList('ol')"/>
	      <titledbutton src="&outdentIcon.url;" align="bottom" onclick="EditorIndent('outdent')"/>
	      <titledbutton src="&indentIcon.url;" align="bottom" onclick="EditorIndent('indent')"/>
	      <titledbutton src="&alignpopupIcon.url;" align="bottom" class="popup" popup="AlignmentWindow" popupanchor="bottomleft"/>
	      <titledbutton src="&linkIcon.url;" align="bottom" value="&linkToolbarCmd.label;" onclick="EditorInsertLink()"/>
	      <titledbutton src="&imageIcon.url;" align="bottom" value="&imageToolbarCmd.label;" onclick="EditorInsertImage()"/>
	      <titledbutton src="&spellingIcon.url;" align="bottom" value="&spellToolbarCmd.label;" onclick="CheckSpelling()"/>
      </toolbar>
    </toolbox>

    <html:iframe type="content-primary" id="content-frame" src="about:blank" flex="100%"/>

    <!-- Ripped off from navigator.xul; this should be a XUL fragment! -->
    <box align="horizontal" id="status-bar">
      <titledbutton value="&tempNotification.label;" onclick="doTests()"/>
	    <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="&tempDoneLoading.label;" style="font-family:sans-serif;font-size:2.5mm">
	    </titledbutton>
    </box>

<!-- Popup Menus and Windows - Not displayed in primary chrome -->
<popup id="ParagraphMenu">
  <menu>
    <menuitem name="&paragraphNormalCmd.label;"  onclick="EditorSetParagraphFormat('normal')"/>
    <menuitem name="&headingOneCmd.label;" onclick="EditorSetParagraphFormat('h1')"/>
    <menuitem name="&headingTwoCmd.label;" onclick="EditorSetParagraphFormat('h2')"/>
    <menuitem name="&headingThreeCmd.label;" onclick="EditorSetParagraphFormat('h3')"/>
    <menuitem name="&headingFourCmd.label;" onclick="EditorSetParagraphFormat('h4')"/>
    <menuitem name="&headingFiveCmd.label;" onclick="EditorSetParagraphFormat('h5')"/>
    <menuitem name="&headingSixCmd.label;" onclick="EditorSetParagraphFormat('h6')"/>
    <menuitem name="&paragraphAddressCmd.label;"   onclick="EditorSetParagraphFormat('address')"/>
    <menuitem name="&paragraphPreformatCmd.label;" onclick="EditorSetParagraphFormat('pre')"/>
    <menuitem name="&paragraphListCmd.label;" onclick="EditorSetParagraphFormat('li')"/>
    <menuitem name="&paragraphDfnTermCmd.label;" onclick="EditorSetParagraphFormat('dt')"/>
    <menuitem name="&paragraphDfnDescCmd.label;" onclick="EditorSetParagraphFormat('dd')"/>
  </menu>
</popup>

<popup id="FontFaceMenu">
  <menu>
    <menuitem name="&defaultVariableWidthCmd.label;" onclick="EditorSetFontFace('')"/>
    <menuitem name="&defaultFixedWidthCmd.label;" onclick="EditorSetFontFace('tt')"/>
    <separator/>
    <menuitem name="&arialHelveticaFont.label;" onclick="EditorSetFontFace('Arial, Helvetica, sans-serif')"/>
    <menuitem name="&timesFont.label;" onclick="EditorSetFontFace('Times New Roman, Times, serif')"/>
    <menuitem name="&courierFont.label;" onclick="EditorSetFontFace('Courier New, Courier, mono')"/>
  </menu>
</popup>

<popup id="FontSizeMenu">
  <menu>
    <menuitem name="&sizeMinusTwoCmd.label;" onclick="EditorSetFontSize('-2')"/>
    <menuitem name="&sizeMinusOneCmd.label;" onclick="EditorSetFontSize('-1')"/>
    <menuitem name="&sizeNormalCmd.label;" onclick="EditorSetFontSize('0')"/>
    <menuitem name="&sizePlusOneCmd.label;" onclick="EditorSetFontSize('+1')"/>
    <menuitem name="&sizePlusTwoCmd.label;" onclick="EditorSetFontSize('+2')"/>
    <menuitem name="&sizePlusThreeCmd.label;" onclick="EditorSetFontSize('+3')"/>
    <menuitem name="&sizePlusFourCmd.label;" onclick="EditorSetFontSize('+4')"/>
  </menu>
</popup>

<popup id="BackColorMenu">
  <menu>
    <menuitem name="&colorBlackCmd.label;" onclick="EditorSetBackgroundColor('black')"/>
    <menuitem name="&colorGrayCmd.label;" onclick="EditorSetBackgroundColor('gray')"/>
    <menuitem name="&colorSilverCmd.label;" onclick="EditorSetBackgroundColor('silver')"/>
    <menuitem name="&colorWhiteCmd.label;" onclick="EditorSetBackgroundColor('white')"/>
    <menuitem name="&colorRedCmd.label;" onclick="EditorSetBackgroundColor('red')"/>
    <menuitem name="&colorBlueCmd.label;" onclick="EditorSetBackgroundColor('blue')"/>
    <menuitem name="&colorGreenCmd.label;" onclick="EditorSetBackgroundColor('green')"/>
    <menuitem name="&colorCyanCmd.label;" onclick="EditorSetBackgroundColor('cyan')"/>
    <menuitem name="&colorYellowCmd.label;" onclick="EditorSetBackgroundColor('yellow')"/>
    <menuitem name="&colorMagentaCmd.label;" onclick="EditorSetBackgroundColor('magenta')"/>
  </menu>
</popup>

<popup id="TextColorMenu">
  <menu>
    <menuitem name="&colorBlackCmd.label;" onclick="EditorSetFontColor('black')"/>
    <menuitem name="&colorGrayCmd.label;" onclick="EditorSetFontColor('gray')"/>
    <menuitem name="&colorSilverCmd.label;" onclick="EditorSetFontColor('silver')"/>
    <menuitem name="&colorWhiteCmd.label;" onclick="EditorSetFontColor('white')"/>
    <menuitem name="&colorRedCmd.label;" onclick="EditorSetFontColor('red')"/>
    <menuitem name="&colorBlueCmd.label;" onclick="EditorSetFontColor('blue')"/>
    <menuitem name="&colorGreenCmd.label;" onclick="EditorSetFontColor('green')"/>
    <menuitem name="&colorCyanCmd.label;" onclick="EditorSetFontColor('cyan')"/>
    <menuitem name="&colorYellowCmd.label;" onclick="EditorSetFontColor('yellow')"/>
    <menuitem name="&colorMagentaCmd.label;" onclick="EditorSetFontColor('magenta')"/>
  </menu>
</popup>

<popup id="AlignmentWindow" oncreate="OnCreateAlignmentPopup()">
   <window class="popup" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" align="vertical" flex="100%" 
    width="70" height="110">
     <html:div flex="100%">
     <html:button class="PopupButton" onclick="window.close();">
       <html:img align="middle" src="chrome://editor/skin/images/ED_Left.gif"/>
       <html:span>&alignLeft.label;</html:span>
     </html:button>
     <html:button class="PopupButton" onclick="window.close();">
       <html:img align="middle" src="chrome://editor/skin/images/ED_Center.gif"/>
       <html:span>&alignCenter.label;</html:span>
     </html:button>
     <html:button class="PopupButton" onclick="window.close();">
       <html:img align="middle" src="chrome://editor/skin/images/ED_Right.gif"/>
       <html:span>&alignRight.label;</html:span>
     </html:button>
     <html:button class="PopupButton" onclick="window.close();">
       <html:img align="middle" src="chrome://editor/skin/images/ED_Justify.gif"/>
       <html:span>&alignJustify.label;</html:span>
     </html:button>
     </html:div>
<!--  Trying to use autosizing and boxes
    <titledbutton class="PopupButton" value="&alignLeft.label;"   style="min-width: 40px" onclick="opener.EditorAlign('left'); window.close();"/>
    <titledbutton class="PopupButton" value="&alignCenter.label;" style="min-width: 40px" onclick="opener.EditorAlign('center'); window.close();"/>
    <titledbutton class="PopupButton" value="&alignRight.label;"  style="min-width: 40px" onclick="opener.EditorAlign('right'); window.close();"/>
 -->
   </window>
</popup>

<popup id="FontFaceWindow">
   <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="40" height="40">
     <titledbutton value="&defaultVariableWidthCmd.label;" onclick="opener.EditorSetFontFace(''); window.close();"/>
     <titledbutton value="&defaultFixedWidthCmd.label;"    onclick="opener.EditorSetFontFace('tt'); window.close();"/>
     <titledbutton value="&arialHelveticaFont.label;"      onclick="opener.EditorSetFontFace('Arial, Helvetica, sans-serif'); window.close();"/>
     <titledbutton value="&timesFont.label;"               onclick="opener.EditorSetFontFace('Times New Roman, Times, serif'); window.close();"/>
     <titledbutton value="&courierFont.label;"             onclick="opener.EditorSetFontFace('Courier New, Courier, mono'); window.close();"/>
   </window>
</popup>

</window>
