<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
<!--

  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.org code.
 
  The Initial Developer of the Original Code is Netscape
  Communications Corporation.  Portions created by Netscape are
  Copyright (C) 1998 Netscape Communications Corporation. All
  Rights Reserved.
 
  Contributor(s): 
	Blake Ross <blakeross@telocity.com>
-->

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

<!DOCTYPE window SYSTEM "chrome://communicator/locale/search/search-panel.dtd" >
<window id="searchPanel" class="color-dialog"
        xmlns:html="http://www.w3.org/1999/xhtml"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        orient="vertical" onload="SearchPanelStartup();"
        onunload="SearchPanelShutdown();">

  <script type="application/x-javascript" src="chrome://global/content/nsUserSettings.js"/>
  <script type="application/x-javascript" src="chrome://global/content/nsJSComponentManager.js"/>
  <script type="application/x-javascript" src="chrome://global/content/strres.js"/>
  <script type="application/x-javascript" src="chrome://communicator/content/search/search-panel.js"/>
  <script type="application/x-javascript" src="chrome://communicator/content/search/shared.js"/>

  <stringbundle id="searchBundle" src="chrome://communicator/locale/search/search-panel.properties"/>
  <stringbundle id="regionalBundle" src="chrome://navigator-region/locale/region.properties"/>
  
  <popupset>
    <popup id="contextual" oncreate="return fillContextMenu('contextual', 'Tree');" >
    	<menu />
    </popup>
  </popupset>
 
  <vbox flex="1" context="">
    <vbox class="box-padded">
      <box autostretch="never">
        <textfield id="sidebar-search-text" flex="1"
                   onkeypress="if (event.keyCode == 13) doSearch();"
                   oninput="doEnabling();" />
        <button id="searchButton" value="&search.button.label;"
                disabled="true" oncommand="doSearch();"/>
      </box>
      <vbox autostretch="never">
        <vbox id="categoryBox" autostretch="never">
          <box>	  
            <text class="label" value="&within.label;" />
            <menulist id="categoryList" ref="NC:SearchCategoryRoot"
                      datasources="rdf:null" oncommand="switchTab(1);" >
              <template>
                <menupopup>
                  <menuitem id="chooseCat" uri="rdf:*" oncommand="chooseCategory(this);" 
                            data="rdf:http://home.netscape.com/NC-rdf#category"
                            value="rdf:http://home.netscape.com/NC-rdf#title"/>
                </menupopup>
              </template>
        
              <menupopup id="categoryPopup">
                <menuitem data="NC:SearchEngineRoot" value="&allengines.label;"
                          oncommand="chooseCategory(this);"/>
                <menuseparator />
                <menuitem value="&customize.menuitem.label;" data="NC:SearchEngineRoot"
                          oncommand="chooseCategory(this); doCustomize();"/>
                <menuseparator />
              </menupopup>
            </menulist>
          </box>
          <separator class="thin"/>
          <html flex="1">&choose.label;</html>
        </vbox>
      </vbox>
    </vbox>
    <deck class="outset-right" id="advancedDeck" flex="1">
      <vbox class="searchpanel-outerbox" flex="1">

        <tree id="Tree" ref="NC:LastSearchRoot"
              resource="http://home.netscape.com/NC-rdf#PageRank"
              resource2="http://home.netscape.com/NC-rdf#Name"
              sortDirection="ascending" sortActive="true"
              flex="1" datasources="rdf:internetsearch"
              onclick="if (event.button == 0 &amp;&amp; event.target.localName == 'treecell')
                         sidebarOpenURL(event.target.parentNode.parentNode);"
              style="-moz-user-focus:ignore !important;">

          <template>

            <rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
              <treechildren flex="1">
                <treeitem uri="...">
                  <treerow>
                    <treecell>
                      <separator class="groove"/>
                    </treecell>
                  </treerow>
                </treeitem>
              </treechildren>
            </rule>

            <rule>
              <treechildren flex="1" context="contextual">
                <treeitem uri="..." persist="open" class="searchresult-item"
                          loading="rdf:http://home.netscape.com/NC-rdf#loading"
                          searchtype="rdf:http://home.netscape.com/NC-rdf#SearchType"
                          type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
                  <treerow class="searchresult">
                    <treecell class="treecell-iconic searchresult-cell" 
                              src="rdf:http://home.netscape.com/NC-rdf#Icon"
                              value="rdf:http://home.netscape.com/NC-rdf#Name"/>
                  </treerow>
                </treeitem>
              </treechildren>
            </rule>

          </template>

          <treehead>
            <treerow>
              <treecell class="treecell-header sortDirectionIndicator" 
                        observes="SortNameColumn" value="&results.label;" 
                        resource="http://home.netscape.com/NC-rdf#Name" 
                        onclick="return doSort('SortNameColumn', 'http://home.netscape.com/NC-rdf#PageRank');" 
                        sortActive="true" sortDirection="ascending" flex="1"/>
            </treerow>
          </treehead>
      
          <treecolgroup>
            <treecol flex="1" id="SortNameColumn" resource="http://home.netscape.com/NC-rdf#Name"
                     resource2="http://home.netscape.com/NC-rdf#PageRank"/>
          </treecolgroup>

        </tree>
      
        <box>
          <spring flex="1" />
          <button class="button-slimline" id="saveQueryButton"
                  value="&savesearch.button.label;" oncommand="return saveSearch();"/>
          <spring flex="1" />
        </box>
      </vbox>
    
      <vbox class="searchpanel-outerbox" flex="1">

        <tree id="searchengines" datasources="rdf:internetsearch" flex="1">

          <template>

            <rule>
              <treechildren>
                <treeitem uri="...">
                  <treerow>
                    <treecell autostretch="never" flex="1">
                      <checkbox oncommand="saveEngines();" allowevents="true"
                                loading="rdf:http://home.netscape.com/NC-rdf#loading"
                                src="rdf:http://home.netscape.com/NC-rdf#Icon"
                                value="rdf:http://home.netscape.com/NC-rdf#Name" flex="1"/>
                    </treecell>
                  </treerow>
                </treeitem>
              </treechildren>
            </rule>

          </template>
        
          <treecolgroup>
            <treecol id="EngineColumn" resource="http://home.netscape.com/NC-rdf#Name" flex="1" />
          </treecolgroup>
        
          <treehead>
            <treerow>
              <treecell class="treecell-header sortDirectionIndicator" 
                        observes="EngineColumn" value="&engine.column.label;"
                        resource="http://home.netscape.com/NC-rdf#Name"
                        sortActive="true" sortDirection="ascending"
                        onclick="return doSort('EngineColumn', null);"/>
            </treerow>
          </treehead>
                
          <treechildren flex="1" id="engineKids"/>

        </tree>             
      </vbox>
    </deck>
  </vbox>
</window>
