<?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/" type="text/css"?> 
<?xml-stylesheet href="chrome://messenger/skin/addressbook/addressbook.css" type="text/css"?> 

<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?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 SYSTEM "chrome://messenger/locale/addressbook/abMainWindow.dtd">

<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"
		align="vertical"
		title="&addressbookWindow.title;"
		windowtype="mail:addressbook"
		persist="width height screenX screenY sizemode"
		onload="OnLoadAddressBook()">

<script language="JavaScript" src="chrome://messenger/content/accountUtils.js"/>
<script language="JavaScript" src="chrome://messenger/content/widgetglue.js"/>
<script language="JavaScript" src="chrome://messenger/content/addressbook/addressbook.js"/>
<script language="JavaScript" src="chrome://messenger/content/addressbook/abCommon.js"/>
<script language="JavaScript" src="chrome://messenger/content/addressbook/abDragDrop.js"/>
<script language="JavaScript" src="chrome://messenger/content/msgPrintEngine.js"/>

<commands id="commands">
	<commandset id="CommandUpdate_AddressBook"
				commandupdater="true"
				events="focus,tree-select"
				oncommandupdate="CommandUpdate_AddressBook()"/>
	
	<commandset id="globalEditMenuItems"/>
</commands>

<broadcasterset id="broadcasterset">
	<!-- File Menu -->
	<broadcaster id="cmd_newNavigator"/>
	<broadcaster id="cmd_newEditor"/>
	<broadcaster id="cmd_PrintCard" oncommand="AbPrintCard()"/>
 	<broadcaster id="cmd_close" oncommand="AbClose()"/>
 	<broadcaster id="cmd_quit"/>
	<!-- Edit Menu -->
	<broadcaster id="cmd_delete"
				 valueAddressBook="&deleteAbCmd.label;"
				 valueCard="&deleteCardCmd.label;"
				 valueCards="&deleteCardsCmd.label;"/>
	<broadcaster id="cmd_CardProperties" oncommand="AbEditCard();"/>
	<broadcaster id='button_delete'/>
	<broadcaster id='cmd_selectAll'/>
	<broadcaster id="cmd_preferences"/>

  <broadcaster id="broadcaster-throbber" busy="false"/>
</broadcasterset>

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

<popupset id="aTooltipSet"/>

<toolbox class="toolbox-top">
	<menubar id="ab-menubar">
		<menu id="menu_File">
			<menupopup id="menu_FilePopup">
				<menuitem value="&newCard.label;" accesskey="&newCard.accesskey;" oncommand="AbNewCard()"/>
				<menu id="menu_New">
					<menupopup id="menu_NewPopup">
						<menuitem value="&newListCmd.label;" accesskey="&newListCmd.accesskey;" oncommand="AbNewList()"/>
						<menuitem value="&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 value="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="toImport()"/>
				<menuseparator/>
				<menuitem value="&printCardViewCmd.label;" accesskey="&printCardViewCmd.accesskey;" key="key_PrintCard" observes="cmd_PrintCard"/>
				<menuseparator/>
			</menupopup>
		</menu>
		
		<menu id="menu_Edit">
		  <menupopup>
			<menuitem id="menu_delete"/>
			<menuseparator/>
			<menuitem id="menu_selectAll"/>
			<menuseparator/>
			<menuitem value="&cardPropertiesCmd.label;"
			          accesskey="&cardPropertiesCmd.accesskey;"
				  key="key_CardProperties"
				  observes="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"
								  value="&showAbToolbarCmd.label;"
								  accesskey="&showAbToolbarCmd.accesskey;"
								  oncommand="goToggleToolbar('abToolbar', 'menu_showAbToolbar')"
								  checked="true" type="checkbox"/>
						<menuitem id="menu_showTaskbar" type="checkbox"/>
					</menupopup>
				</menu>
				<menuseparator/>
				<menu value="&menu_ShowNameAs.label;" accesskey="&menu_ShowNameAs.accesskey;">
					<menupopup>
						<menuitem type="radio" name="shownameas"
								  id="firstLastCmd"
								  value="&firstLastCmd.label;"
								  accesskey="&firstLastCmd.accesskey;"
								  oncommand="SetNameColumn('firstLastCmd')"/>
						<menuitem type="radio" name="shownameas"
								  id="lastFirstCmd"
								  value="&lastFirstCmd.label;"
								  accesskey="&lastFirstCmd.accesskey;"
								  oncommand="SetNameColumn('lastFirstCmd')"/>
						<menuitem type="radio" name="shownameas"
								  id="displayNameCmd"
								  value="&displayNameCmd.label;"
								  accesskey="&displayNameCmd.accesskey;"
								  oncommand="SetNameColumn('displayNameCmd')"/>
					</menupopup>
				</menu>
				<menu value="&sortMenu.label;" accesskey="&sortMenu.accesskey;">
				    <menupopup>
						<menuitem value="&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 value="&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 value="&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 value="&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">
			<box id="toolbar_button_box">
				<button class="button-toolbar-2 top" orient="vertical" id="button-newcard" value="&newcardButton.label;" tooltip="aTooltip" tooltiptext="&newcardButton.tooltip;" oncommand="AbNewCard();"/>
				<button class="button-toolbar-2 top" orient="vertical" id="button-newlist" value="&newlistButton.label;" tooltip="aTooltip" tooltiptext="&newlistButton.tooltip;" oncommand="AbNewList();"/>
            	<toolbarseparator class="toolbarseparator-primary"/>
				<button class="button-toolbar-2 top" orient="vertical" id="button-editcard" value="&editButton.label;" tooltip="aTooltip" tooltiptext="&editButton.tooltip;" oncommand="AbEditCard();"/>
				<button class="button-toolbar-2 top" orient="vertical" id="button-newmessage" value="&newmsgButton.label;" tooltip="aTooltip" tooltiptext="&newmsgButton.tooltip;" oncommand="AbNewMessage();"/>
				<button class="button-toolbar-2 top" orient="vertical" id="button-delete" disabled="true" observes="button_delete" value="&deleteButton.label;" tooltip="aTooltip" tooltiptext="&deleteButton.tooltip;" oncommand="goDoCommand('button_delete');"/>

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

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

      <button class="plain" id="navigator-throbber" oncommand='goClickThrobber("addressbook.throbber.url")'>
        <observes element="broadcaster_throbber" attribute="busy"/>
      </button>
		</toolbar>
	</toolbox>

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

			<!-- results tree -->
			<box id="results_box" flex="1" orient="vertical">
				<tree id="resultsTree" flex="1" style="height:0px"/>
			</box>
			
			<splitter id="results-splitter" collapse="after" persist="state"
              orient="vertical" autostretch="never">
        <grippy/>
      </splitter>
			
			<!-- card view -->
      <box id="CardViewOuterBox" flex="1">
  			<box id="CardViewBox" style="height:170px; min-height:1px; min-width:1px"/>
      </box>
		
      <box id="status-bar">
          <text id="statusText" class="status-bar" align="left" flex="100%" value="&statusText.label;"/>
      </box>		

		</box>
		
	</box>
	
	<box id="taskbar" class="toolbox-bottom"/>

</window>
