<?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"
		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_newMessage"/>
	<broadcaster id="cmd_PrintCard" oncommand="AbPrintCard()"/>
 	<broadcaster id="cmd_close" oncommand="AbClose()"/>
 	<broadcaster id="cmd_quit"/>
	<!-- Edit Menu -->
	<broadcaster id="cmd_undo"/>
	<broadcaster id="cmd_redo"/>
	<broadcaster id="cmd_cut"/>
	<broadcaster id="cmd_copy"/>
	<broadcaster id="cmd_paste"/>
	<broadcaster id="cmd_delete"
				 valueAddressBook="&deleteAbCmd.label;"
				 valueCard="&deleteCardCmd.label;"
				 valueCards="&deleteCardsCmd.label;"/>
	<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_newMessage"/>
	<key id="key_PrintCard" xulkey="true" key="&printCardViewCmd.key;" observes="cmd_PrintCard" />
	<key id="key_close"/>
	<key id="key_quit"/>
	<!-- Edit Menu -->
	<key id="key_undo"/>
	<key id="key_redo"/>
	<key id="key_cut"/>
	<key id="key_copy"/>
	<key id="key_paste"/>
	<key id="key_delete"/>
	<key id="key_selectAll"/>
	<key id="key_preferences"/>
</keyset>

<popupset id="aTooltipSet"/>

<toolbox class="toolbox-top">
	<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()"/>
						<menuitem value="&newDirectoryCmd.label;" accesskey="&newDirectoryCmd.accesskey;" disabled="true" oncommand="AbNewDirectoryt()"/>
						<menuseparator/>
						<menuitem id="menu_newNavigator"/>
						<menuitem id="menu_newMessage"/>
						<menuitem id="cmd_newCard"/>
  					<menuitem id="menu_newEditor"/>
					</menupopup>
				</menu>
				<menuseparator/>
				<menuitem id="menu_close"/>
				<menuseparator/>
				<menuitem value="&importCmd.label;" oncommand="toImport()"/>
				<menuitem value="&exportCmd.label;" disabled="true" oncommand="AbExport()"/>
				<menuseparator/>
				<menuitem id="menu_pageSetup"/>
				<menuitem value="&printPreviewCmd.label;" disabled="true" oncommand="AbPrintPreview()"/>
				<menuitem value="&printCardViewCmd.label;" key="key_PrintCard" observes="cmd_PrintCard"/>
				<menuitem value="&printAddressBook.label;" disabled="true" oncommand="AbPrintAddressBook()"/>
				<menuseparator/>
			</menupopup>
		</menu>
		
		<menu id="menu_Edit">
		  <menupopup>
			<menuitem id="menu_undo"/>
			<menuitem id="menu_redo"/>
			<menuseparator/>
			<menuitem id="menu_cut"/>
			<menuitem id="menu_copy"/>
			<menuitem id="menu_paste"/>
			<menuitem id="menu_delete"/>
			<menuseparator/>
			<menuitem id="menu_selectAll"/>
			<menuseparator/>
			<menuitem value="&editCardCmd.label;"
			          accesskey="&editCardCmd.accesskey;"
			          oncommand="AbEditCard();"/>
			<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"/>
						<menuitem id="menu_showTaskbar"/>
					</menupopup>
				</menu>
				<menuitem value="&showCardPane.label;" disabled="true" oncommand="AbShowCardPane()"/>
				<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;">
				    <menupopup>
						<menuitem value="&sortByNameCmd.label;"
								  id="cmd_SortByName"
								  disabled="true"
								  oncommand="top.SortResultPane('NameColumn', 'http://home.netscape.com/NC-rdf#DisplayName')"/>
						<menuitem value="&sortByEmailCmd.label;"
								  id="cmd_SortByEmail"
								  disabled="true"
								  oncommand="top.SortResultPane('EmailColumn', 'http://home.netscape.com/NC-rdf#PrimaryEmail')"/>
						<menuitem value="&sortByWorkPhoneCmd.label;"
								  id="cmd_SortByWorkPhone"
								  disabled="true"
								  oncommand="top.SortResultPane('WorkPhoneColumn', 'http://home.netscape.com/NC-rdf#WorkPhone')"/>
						<menuitem value="&sortByOrganizationCmd.label;"
								  id="cmd_SortByOrganization"
								  disabled="true"
								  oncommand="top.SortResultPane('OrganizationColumn', 'http://home.netscape.com/NC-rdf#Comapny')"/>
						<menuseparator/>
						<menuitem value="&sortAscendingCmd.label;" disabled="true" oncommand="AbSortAscending()"/>
						<menuitem value="&sortDescendingCmd.label;" disabled="true" oncommand="AbSortDescending()"/>
					</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;" onclick="AbNewCard()"/>
				<button class="button-toolbar-2 top" orient="vertical" id="button-newlist" value="&newlistButton.label;" tooltip="aTooltip" tooltiptext="&newlistButton.tooltip;" onclick="AbNewList()"/>
            	<toolbarseparator/>
				<button class="button-toolbar-2 top" orient="vertical" id="button-editcard" value="&editButton.label;" tooltip="aTooltip" tooltiptext="&editButton.tooltip;" onclick="AbEditCard()"/>
				<button class="button-toolbar-2 top" orient="vertical" id="button-newmessage" value="&newmsgButton.label;" tooltip="aTooltip" tooltiptext="&newmsgButton.tooltip;" onclick="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;" onclick="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">
			<splitter class="sidebarheader-main" collapse="after">
				<text style="min-width:1px" value="&addressbook-sidebar-header.label;"/>
			</splitter>
			
			<tree id="dirTree" flex="1"/>
		</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="gray_horizontal_splitter" collapse="after" persist="state"/>
			
			<!-- card view -->
			<box id="CardViewBox" style="height:170px; min-height:1px; min-width:1px"/>
		
      <box id="status-bar">
          <text id="statusText" class="status-bar" align="left" flex="100%" value="&statusText.label;"/>
      </box>		

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

</window>

