<?xml version="1.0"?> 
<!--
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 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.
--> 

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

<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/sidebar/sidebarOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/addressbook/abDirTreeOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/addressbook/abResultsTreeOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/addressbook/abCardViewOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/communicatorOverlay.xul"?>

<!DOCTYPE window [
<!ENTITY % abMainWindowDTD SYSTEM "chrome://messenger/locale/addressbook/abMainWindow.dtd" >
%abMainWindowDTD;
<!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
%messengerDTD;
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
]>

<window xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    id="addressbookWindow"
    height="450"
    width="750"
    orient="vertical"
    title="&addressbookWindow.title;"
    windowtype="mail:addressbook"
    persist="width height screenX screenY sizemode"
    onload="OnLoadAddressBook()"
    onunload="OnUnloadAddressBook()">

  <stringbundleset id="stringbundleset">
    <stringbundle id="bundle_addressBook" src="chrome://messenger/locale/addressbook/addressBook.properties"/>
    <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
  </stringbundleset>
  
<resourcebundle id="resource_bundle_addressbook" />

  
<script type="application/x-javascript" src="chrome://messenger/content/accountUtils.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
<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" src="chrome://communicator/content/contentAreaClick.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgPrintEngine.js"/>

<commandset id="tasksCommands">
  <commandset id="CommandUpdate_AddressBook"
        commandupdater="true"
        events="focus,tree-select"
        oncommandupdate="CommandUpdate_AddressBook()"/>
  
  <commandset id="globalEditMenuItems"/>
    <command id="cmd_newNavigator"/>
    <command id="cmd_newEditor"/>
    <command id="cmd_PrintCard" oncommand="AbPrintCard()"/>
    <command id="cmd_quit"/>
    <command id="cmd_close" oncommand="AbClose()"/>
    <command id="cmd_CardProperties" oncommand="AbEditCard();"/>
    <command id='cmd_selectAll'/>
    <command id="toggleSidebar"/>
</commandset>

<broadcasterset id="abBroadcasters">
  <!-- File Menu -->

  <!-- Edit Menu -->
  <broadcaster id="cmd_delete"
         valueAddressBook="&deleteAbCmd.label;"
         valueCard="&deleteCardCmd.label;"
         valueCards="&deleteCardsCmd.label;"/>
  <broadcaster id="broadcaster-throbber" busy="false"/>
  <broadcaster id="button_delete" disabled="true"/>
  <broadcaster id="Communicator:WorkMode"/>
</broadcasterset>

<keyset id="tasksKeys">
  <!-- File Menu -->
  <key id="key_newNavigator"/>
  <key id="key_PrintCard"  key="&printCardViewCmd.key;" command="cmd_PrintCard"  modifiers="accel"/>
  <key id="key_close"/>
  <key id="key_quit"/>
  <!-- Edit Menu -->
  <key id="key_delete"/>
  <key id="key_selectAll"/>
  <key id="showHideSidebar"/>
  <key id="key_CardProperties" key="&cardPropertiesCmd.key;" command="cmd_CardProperties" modifiers="accel"/>
</keyset>

<popupset id="aTooltipSet">
  <popup id="sidebarPopup"/>
</popupset>

<toolbox class="toolbox-top">
	<menubar id="ab-menubar">
		<menu id="menu_File">
			<menupopup id="menu_FilePopup">
        <menuitem label="&newCard.label;" accesskey="&newCard.accesskey;" oncommand="AbNewCard()"/>
				<menu id="menu_New">
					<menupopup id="menu_NewPopup">
            <menuitem label="&newListCmd.label;" accesskey="&newListCmd.accesskey;" oncommand="AbNewList()"/>
            <menuitem label="&newAddressBookCmd.label;" accesskey="&newAddressBookCmd.accesskey;" oncommand="AbNewAddressBook()"/>
						<menuseparator/>
						<menuitem id="menu_newNavigator"/>
  					<menuitem id="menu_newEditor"/>
					</menupopup>
				</menu>
				<menuseparator/>
				<menuitem id="menu_close"/>
				<menuseparator/>
        <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="toImport()"/>
				<menuseparator/>
        <menuitem id="printMenuItem" label="&printCardViewCmd.label;" accesskey="&printCardViewCmd.accesskey;" key="key_PrintCard" command="cmd_PrintCard"/>
				<menuseparator/>
			</menupopup>
		</menu>
		
		<menu id="menu_Edit">
		  <menupopup>
			<menuitem id="menu_delete" observes="button_delete"/>
			<menuseparator/>
			<menuitem id="menu_selectAll"/>
			<menuseparator/>
      <menuitem label="&cardPropertiesCmd.label;"
			          accesskey="&cardPropertiesCmd.accesskey;"
				  key="key_CardProperties"
          command="cmd_CardProperties"/>
			<menuseparator/>
			<menuitem id="menu_preferences" oncommand="goPreferences('addressbook.xul', 'chrome://messenger/content/addressbook/pref-addressing.xul')"/>
		  </menupopup>
		</menu>
	    
		<menu id="menu_View">
		    <menupopup id="menu_View_Popup">
				<menu id="menu_Toolbars">
					<menupopup>
						<menuitem id="menu_showAbToolbar"
                  label="&showAbToolbarCmd.label;"
								  accesskey="&showAbToolbarCmd.accesskey;"
								  oncommand="goToggleToolbar('abToolbar', 'menu_showAbToolbar')"
								  checked="true" type="checkbox"/>
						<menuitem id="menu_showTaskbar" type="checkbox"/>
					</menupopup>
				</menu>
				<menuseparator/>
				<menu label="&menu_ShowNameAs.label;" accesskey="&menu_ShowNameAs.accesskey;">
					<menupopup>
						<menuitem type="radio" name="shownameas"
								  id="firstLastCmd"
                  label="&firstLastCmd.label;"
								  accesskey="&firstLastCmd.accesskey;"
								  oncommand="SetNameColumn('firstLastCmd')"/>
						<menuitem type="radio" name="shownameas"
								  id="lastFirstCmd"
                  label="&lastFirstCmd.label;"
								  accesskey="&lastFirstCmd.accesskey;"
								  oncommand="SetNameColumn('lastFirstCmd')"/>
						<menuitem type="radio" name="shownameas"
								  id="displayNameCmd"
                  label="&displayNameCmd.label;"
								  accesskey="&displayNameCmd.accesskey;"
								  oncommand="SetNameColumn('displayNameCmd')"/>
					</menupopup>
				</menu>
        <menu label="&sortMenu.label;" accesskey="&sortMenu.accesskey;">
				    <menupopup>
            <menuitem label="&sortByNameCmd.label;"
								  id="cmd_SortByName"
								  disabled="true"
								  accesskey="&SortByName.accesskey;"
								  oncommand="top.SortResultPane('NameColumn', 'http://home.netscape.com/NC-rdf#DisplayName')" name="sortas" type="radio" checked="true"/>
            <menuitem label="&sortByEmailCmd.label;"
								  id="cmd_SortByEmail"
								  disabled="true"
								  accesskey="&SortByEmail.accesskey;"
								  oncommand="top.SortResultPane('EmailColumn', 'http://home.netscape.com/NC-rdf#PrimaryEmail')" name="sortas" type="radio"/>
            <menuitem label="&sortByWorkPhoneCmd.label;"
								  id="cmd_SortByWorkPhone"
								  disabled="true"
								  accesskey="&SortByWorkPhone.accesskey;"
								  oncommand="top.SortResultPane('WorkPhoneColumn', 'http://home.netscape.com/NC-rdf#WorkPhone')" name="sortas" type="radio"/>
						<menuitem label="&sortByOrganizationCmd.label;"
								  id="cmd_SortByOrganization"
								  disabled="true"
								  accesskey="&SortByOrganization.accesskey;"
								  oncommand="top.SortResultPane('OrganizationColumn', 'http://home.netscape.com/NC-rdf#Company')" name="sortas" type="radio"/>
					</menupopup>
				</menu>
			</menupopup>
		</menu>
	    
		<menu id="tasksMenu"/>
		<menu id="menu_Help"/>
		<spring flex="100%"/>
	</menubar>
	
	<!-- toolbar -->
		<toolbar class="toolbar-primary" id="abToolbar" persist="collapsed">
			<hbox id="toolbar_button_box">
        <button class="button-toolbar-2 top" orient="vertical" id="button-newcard" label="&newcardButton.label;" tooltip="aTooltip" tooltiptext="&newcardButton.tooltip;" oncommand="AbNewCard();"/>
        <button class="button-toolbar-2 top" orient="vertical" id="button-newlist" label="&newlistButton.label;" tooltip="aTooltip" tooltiptext="&newlistButton.tooltip;" oncommand="AbNewList();"/>
            	<toolbarseparator class="toolbarseparator-primary"/>
        <button class="button-toolbar-2 top" orient="vertical" id="button-editcard" label="&editButton.label;" tooltip="aTooltip" tooltiptext="&editButton.tooltip;" oncommand="AbEditCard();"/>
        <button class="button-toolbar-2 top" orient="vertical" id="button-newmessage" label="&newmsgButton.label;" tooltip="aTooltip" tooltiptext="&newmsgButton.tooltip;" oncommand="AbNewMessage();"/>
        <button class="button-toolbar-2 top" orient="vertical" id="button-delete" observes="button_delete" label="&deleteButton.label;" tooltip="aTooltip" tooltiptext="&deleteButton.tooltip;" oncommand="goDoCommand('button_delete');"/>

        <vbox flex="100%">
          <spring flex="1"/> 
          <!--html id="searchlabel">&showNames.label;</html>
          <textbox id="searchtext" type="text" align="bottom"/> 
          <spring flex="1"/--> 
        </vbox>

        <!--button id="button_stop" class="other28" align="top" label="&stopButton.label;" tooltip="aTooltip" tooltiptext="&stopButton.tooltip;" disabled="true" oncommand="AbStop()"/>
        <button id="button_search" class="other28" align="top" label="&searchButton.label;" disabled="true" tooltip="aTooltip" tooltiptext="&searchButton.tooltip;" oncommand="AbSearch()"/-->
     </hbox>

     <hbox id="throbber-box" autostretch="never">
      <button id="navigator-throbber" oncommand='goClickThrobber("addressbook.throbber.url")' tooltip="aTooltip" tooltiptext="&throbber.tooltip;">
        <observes element="broadcaster_throbber" attribute="busy"/>
      </button>
     </hbox>
    </toolbar>
  </toolbox>

  <!-- The main address book three pane -->
  <hbox  flex="1" style="min-width:150px">
    <!-- sidebar with dir tree -->
    <vbox id="sidebar-box">
        <sidebarheader type="box" class="sidebarheader-main" label="&addressbook-sidebar-header.label;"/>
      
      <tree id="dirTree" flex="1000"/>
    </vbox>
    <splitter id="sidebar-splitter" collapse="before" persist="state"/>
    
    <vbox flex="100%" style="min-width:100px">

      <!-- results tree -->
      <vbox id="results_box" flex="1">
        <tree id="resultsTree" flex="1" style="height:0px"/>
      </vbox>
      
      <splitter id="results-splitter" collapse="after" persist="state"
              orient="vertical" autostretch="never">
        <grippy/>
      </splitter>
      
      <!-- card view -->
      <hbox id="CardViewOuterBox" flex="1">
        <vbox id="CardViewBox" style="height:170px; min-height:1px; min-width:1px"/>
      </hbox>
    
      

    </vbox>
    
 
  </hbox>
  
  <statusbar id="status-bar" >
    <hbox id="component-bar"/>
    <statusbarpanel id="statusText" class="status-bar" flex="1" value="&statusText.label;"/>  
    <statusbarpanel id="offline-status" class="statusbarpanel-icononly"/>           
  </statusbar>  
</window>
