<?xml version="1.0"?>
<!-- -*- Mode: xml; indent-tabs-mode: nil; -*-
   - The contents of this file are subject to the Mozilla 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/MPL/
  
   - 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.
 
   Contributor(s): 
     - Blake Ross <blakeross@telocity.com> (Original Author)
-->

<?xml-stylesheet href="chrome://messenger/skin/addressbook/sidebarPanel.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/addressbook/addressPanes.css" type="text/css"?>

<?xul-overlay href="chrome://messenger/content/addressbook/abDirTreeOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/abResultsTreeOverlay.dtd" >
<window id="addressbook-panel"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="InitCommonJS(); abPanelStartup();"
        xmlns:nc="http://home.netscape.com/NC-rdf#"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

  <script type="application/x-javascript" src="chrome://messenger/content/addressbook/addressbook.js"/>
  <script type="application/x-javascript" src="chrome://messenger/content/addressbook/abCommon.js"/>
  <script type="application/x-javascript">
    <![CDATA[
      function abPanelStartup() {
        var abList = document.getElementById('addressbookList');
        if (!abList.selectedIndex)
          abList.selectedIndex = 1;
        ChangeDirectoryByDOMNode(abList.selectedItem);
      }
    ]]>
  </script>
  <popup id="composeMail">
    <menuitem label="&composeEmail.label;" accesskey="&composeEmail.accesskey;" oncommand="AbNewMessage();" default="true"/>
  </popup>
  <vbox id="results_box" flex="1">
    <hbox id="panel-bar" class="toolbar">
      <menulist id="addressbookList" oncommand="ChangeDirectoryByDOMNode(event.target);" flex="1">
        <menupopup id="addressbookPopup" datasources="rdf:addressdirectory" ref="moz-abdirectory://">
          <template>
            <rule nc:IsMailList="false">
              <menuitem label="rdf:http://home.netscape.com/NC-rdf#DirName" persist="selected" uri="..."/>
            </rule>
          </template>
        </menupopup>
      </menulist>
    </hbox>
    <tree id="resultsTree" flex="1" datasources="rdf:addressdirectory rdf:addresscard"
          style="height:0px" ondblclick="if (event.button == 0) AbNewMessage();" class="abResults"
          containment="http://home.netscape.com/NC-rdf#CardChild"
          allownegativeassertions="false" context="composeMail"
          coalesceduplicatearcs="false"
          onselect="window.updateCommands('tree-select'); window.updateCommands('select');">
      <template>
        <rule>
          <treechildren flex="1">
            <treeitem uri="...">
              <treerow id="AbRows">
                  <treecell class="treecell-iconic cardicon" label="rdf:http://home.netscape.com/NC-rdf#Name"/>
              </treerow>
            </treeitem>
          </treechildren>
        </rule>
      </template>
      <treecolgroup id="theColumns">
        <treecol persist="hidden width" flex="2" id="NameColumn" resource="http://home.netscape.com/NC-rdf#Name"/>
      </treecolgroup>
      <treehead>
        <treerow id="headRow">
          <treecell id="NameColumnHeader" label="&nameColumn.label;" class="sortDirectionIndicator treecell-header treecell-inset-header" onclick="return SortResultPane('NameColumn', 'http://home.netscape.com/NC-rdf#Name');"/>
       </treerow>
      </treehead>
    </tree>
  </vbox>
</window>
