<?xml version="1.0"?>
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>

<!DOCTYPE window SYSTEM "chrome://messenger/locale/messengercompose/pref-composing_messages.dtd">

<window xmlns:html="http://www.w3.org/1999/xhtml"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="parent.initPanel('chrome://messenger/content/messengercompose/pref-composing_messages.xul');"
        orient="vertical"
        class="color-dialog">

  <popupset id="aTooltipSet"/>
    
  <script type="application/x-javascript">
  <![CDATA[
    var _elementIDs = ["forwardMessageMode", "autoQuote", "replyOnTop", "spellCheckBeforeSend", "strictlyMime", "wrapLength", "sendDefaultCharsetList"];

    function Startup()
    {
      doEnabling();
    }
    
    function doEnabling()
    {
      var quotebox = document.getElementById("thenBox");
      var quotecheck = document.getElementById("autoQuote");
      if( quotecheck.checked && !quotecheck.disabled ) {
        quotebox.firstChild.removeAttribute("disabled");
        quotebox.lastChild.removeAttribute("disabled");
      }
      else {
        quotebox.firstChild.setAttribute("disabled","true");
        quotebox.lastChild.setAttribute("disabled","true");
      }
      
      var spellChecker;
      try {
        spellChecker = Components.classes["@mozilla.org/spellchecker;1"];
        //switch to this when nsISpellChecker becomes scriptable
        //spellChecker = Components.classes["@mozilla.org/spellchecker;1"].createInstance(Components.interfaces.nsISpellChecker);
      }
      catch (ex) {
        spellChecker = null;
      }

      if (!spellChecker) {
        var spellCheckerCheckbox = document.getElementById("spellCheckBeforeSend");
        spellCheckerCheckbox.setAttribute("disabled","true");
      }
    }
  ]]>
  </script>  
    
  <hbox class="box-smallheader" title="&pane.title;"/>

  <groupbox orient="vertical">
    <label value="&forwardReply.label;"/>
    
    <hbox autostretch="never">
      <text class="label" value="&forwardMsg.label;" accesskey="&forwardMsg.accesskey;"/>
      <menulist id="forwardMessageMode" 
                pref="true" preftype="int" prefstring="mail.forward_message_mode"
                prefattribute="value">
        <menupopup>
          <menuitem value="2" label="&inline.label;" accesskey="&inline.accesskey;"/>
          <menuitem value="0" label="&asAttachment.label;" accesskey="&asAttachment.accesskey;"/>
        </menupopup>
      </menulist>
    </hbox>
    <hbox autostretch="never">
      <checkbox id="autoQuote" label="&autoQuote.label;" 
                pref="true" preftype="bool" prefstring="mail.auto_quote"
                prefattribute="checked" oncommand="doEnabling();"/>
    </hbox>
    <hbox class="indent" autostretch="never" id="thenBox">
      <text class="label" value="&then.label;" accesskey="&then.accesskey;" for="replyOnTop"/>
      <menulist id="replyOnTop" pref="true" preftype="int" prefstring="mailnews.reply_on_top"
                prefattribute="value">
        <menupopup>
          <menuitem value="1" label="&aboveQuote.label;" accesskey="&aboveQuote.accesskey;"/>
          <menuitem value="0" label="&belowQuote.label;" accesskey="&belowQuote.accesskey;"/>
          <menuitem value="2" label="&selectAndQuote.label;" accesskey="&selectAndQuote.accesskey;"/>
        </menupopup>
      </menulist>        
    </hbox>
  </groupbox>

  <!-- Composing Mail -->
  <groupbox orient="vertical" autostretch="never">
    <label value="&sendingMessagesHeader.label;"/>
        
    <checkbox id="spellCheckBeforeSend" label="&spellCheck.label;"
              pref="true" preftype="bool" prefstring="mail.SpellCheckBeforeSend"
              prefattribute="checked"/>
  
  <checkbox id="strictlyMime" label="&useMIME.label;"
                pref="true" preftype="bool" prefstring="mail.strictly_mime"
                prefattribute="checked"/>
    
	<hbox autostretch="never">
	<text class="label" value="&wrapOutMsg.label;" accesskey="&wrapOutMsg.accesskey;" for="wrapLength"/>
    <textbox id="wrapLength" size="3" pref="true" preftype="int"
               prefstring="mailnews.wraplength" prefattribute="value"/>
    <text class="label" value="&char.label;"/>
  </hbox>

   <hbox autostretch="never">
    <text class="label" value="&sendDefaultCharset.label;" accesskey="&sendDefaultCharset.accesskey;" for="sendDefaultCharsetList"/>
    <menulist id="sendDefaultCharsetList" ref="NC:MaileditCharsetMenuRoot" datasources="rdf:charset-menu"
              pref="true" preftype="string" prefstring="mailnews.send_default_charset"
              prefattribute="value">
      <template>
        <menupopup>
          <menuitem label="rdf:http://home.netscape.com/NC-rdf#Name" value="..." uri="..."/>
        </menupopup>
      </template>
    </menulist>       
    </hbox> 
  </groupbox>
  
<!--
  <groupbox orient="vertical" autostretch="never">
  <label value="&languages.label;"/>

   <hbox autostretch="never">
    <text class="label" value="&sendDefaultCharset.label;" for="sendDefaultCharsetList"/>
    <menulist id="sendDefaultCharsetList" ref="NC:MaileditCharsetMenuRoot" datasources="rdf:charset-menu"
              pref="true" preftype="string" prefstring="mailnews.send_default_charset"
              prefattribute="value">
      <template>
        <menupopup>
          <menuitem label="rdf:http://home.netscape.com/NC-rdf#Name" value="..." uri="..."/>
        </menupopup>
      </template>
    </menulist>       
    </hbox> 
  </groupbox>
-->
              
      

    
</window>
