<?xml version="1.0"?>
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css" type="text/css"?>

<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/pref-addressing.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/addressbook/pref-addressing.xul');"
        class="color-dialog"
        orient="vertical">

  <script type="application/x-javascript">
  <![CDATA[
    var _elementIDs = ["emailCollection", "emailCollectionIncoming",
                       "emailCollectionOutgoing", "emailCollectionNewsgroup",
                       "addressingAutocomplete", "enableCABsizeLimit",
                       "CABsizeLimit"];

  function Startup(){
    doEnabling();
  }

  function doEnabling()
  {
    var emailCollection = document.getElementById("emailCollection");
    var emailCollectionIncoming = document.getElementById("emailCollectionIncoming");
    var emailCollectionOutgoing = document.getElementById("emailCollectionOutgoing");
    var emailCollectionNewsgroup = document.getElementById("emailCollectionNewsgroup");
    var emailCollectionTypeText = document.getElementById("emailCollectionTypeText");
    var enableCABsizeLimit = document.getElementById("enableCABsizeLimit");
    var CABsizeLimit = document.getElementById("CABsizeLimit");
    var useCABSizelimitPart2 = document.getElementById("useCABSizelimitPart2");
    
    if( emailCollection.checked && !emailCollection.disabled ){
      emailCollectionIncoming.removeAttribute("disabled");
      emailCollectionOutgoing.removeAttribute("disabled");
      emailCollectionNewsgroup.removeAttribute("disabled");
      emailCollectionTypeText.removeAttribute("disabled");
      enableCABsizeLimit.removeAttribute("disabled");
      CABsizeLimit.removeAttribute("disabled");
      useCABSizelimitPart2.removeAttribute("disabled");
    } else {
      emailCollectionIncoming.setAttribute("disabled", "true");
      emailCollectionOutgoing.setAttribute("disabled", "true");
      emailCollectionNewsgroup.setAttribute("disabled", "true");
      emailCollectionTypeText.setAttribute("disabled", "true");
      enableCABsizeLimit.setAttribute("disabled", "true");
      CABsizeLimit.setAttribute("disabled", "true");
      useCABSizelimitPart2.setAttribute("disabled", "true");
    }

  }
  ]]>
  </script>  
    
  <box class="box-smallheader" title="&pane.title;"/>

  <titledbox orient="vertical">
    <label value="&emailCollectiontitle.label;"/>
  <html>&emailCollectiontext.label;</html>
            <vbox autostretch="never">
                <checkbox id="emailCollection" label="&emailCollectionEnable.label;"
                          pref="true" preftype="bool" prefstring="mail.collect_email_address"
                          prefattribute="checked" oncommand="doEnabling();"/>
            </vbox>
    <box orient="vertical" autostretch="never" class="indent">
    <text class="label" value="&emailCollectionTypeText.label;" id="emailCollectionTypeText"/>
    <checkbox id="emailCollectionIncoming" label="&emailCollectionIncomingEnable.label;"
              pref="true" preftype="bool" prefstring="mail.collect_email_address_incoming"
              prefattribute="checked"/>
    <checkbox id="emailCollectionOutgoing" label="&emailCollectionOutgoingEnable.label;"
              pref="true" preftype="bool" prefstring="mail.collect_email_address_outgoing"
              prefattribute="checked"/>
    <checkbox id="emailCollectionNewsgroup" label="&emailCollectionNewsgroupEnable.label;"
              pref="true" preftype="bool" prefstring="mail.collect_email_address_newsgroup"
              prefattribute="checked"/>
		<box autostretch="never">
      <checkbox id="enableCABsizeLimit" label="&useCABSizelimitPart1.label;"
				pref="true" preftype="bool" prefstring="mail.collect_email_address_enable_size_limit"
				prefattribute="checked"/>
			<textbox id="CABsizeLimit" size="6" pref="true" preftype="int"
					prefstring="mail.collect_email_address_size_limit" prefattribute="value"/>
			<text id="useCABSizelimitPart2" class="label" value="&useCABSizelimitPart2.label;"/>
		</box> 
	</box>
	</titledbox>
	
    <titledbox orient="vertical">
      <label value="&addressingTitle.label;"/>
      <html>&addressingText.label;</html>
      <box autostretch="never">
        <checkbox id="addressingAutocomplete" label="&addressingEnable.label;"
          pref="true" preftype="bool" prefstring="mail.enable_autocomplete"
          prefattribute="checked"/>
      </box>
    </titledbox>

</window>
