<?xml version="1.0"?>

<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?> 
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/findBar.css" type="text/css"?>

<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>

<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
%brandDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
%browserDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % globalRegionDTD SYSTEM "chrome://global-region/locale/region.dtd">
%globalRegionDTD;
<!ENTITY % charsetDTD SYSTEM "chrome://global/locale/charsetOverlay.dtd" >
%charsetDTD;
<!ENTITY % findBarDTD SYSTEM "chrome://global/locale/findbar.dtd" >
%findBarDTD;
]>

 
<window id="main-window"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="BrowserStartup()" onunload="BrowserShutdown()" onclose="return WindowIsClosing();"
        contenttitlesetting="true"
        title="&mainWindow.title;"
        titlemodifier="&mainWindow.title;"
        titlemenuseparator="&mainWindow.titlemodifiermenuseparator;"
        windowtype="navigator:browser"
        screenX="4" screenY="4"
        persist="screenX screenY width height sizemode"> 


<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/x-javascript" src="chrome://global/content/findBar.js"/>
<script type="application/x-javascript" src="chrome://global/content/printUtils.js"/>
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarks.js"/>
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarksMenu.js"/>
<script type="application/x-javascript" src="chrome://global/content/viewZoomOverlay.js"/>
<script type="application/x-javascript" src="chrome://browser/content/browser.js"/>

<script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"/>



  <stringbundleset id="stringbundleset"> 
    <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
    <stringbundle id="bundle_shell" src="chrome://browser/locale/shellservice.properties"/>
    <stringbundle id="bundle_findBar" src="chrome://global/locale/findbar.properties"/>
    <stringbundle id="bundle_preferences" src="chrome://browser/locale/preferences/preferences.properties"/>
  </stringbundleset>

  <commandset id="globalEditCommandSet"
              commandupdater="true"
              events="focus"
              oncommandupdate="goUpdateGlobalEditMenuItems()"/>
  <commandset id="selectEditCommandSet"
              commandupdater="true"
              events="select"
              oncommandupdate="goUpdateSelectEditMenuItems()"/>
  <commandset id="undoEditCommandSet"
              commandupdater="true"
              events="undo"
              oncommandupdate="goUpdateUndoEditMenuItems()"/>
  <commandset id="pasteCommandSet"
              commandupdater="true"
              events="clipboard"
              oncommandupdate="goUpdatePasteMenuItems()"/>
  
  <commandset id="mainCommandSet">
    <command id="cmd_newNavigator"                 oncommand="OpenBrowserWindow()"/>
    <command id="cmd_bm_open"                      oncommand="goDoCommand('cmd_bm_open');"/>
    <command id="cmd_bm_openinnewwindow"           oncommand="goDoCommand('cmd_bm_openinnewwindow');"/>
    <command id="cmd_bm_openinnewtab"              oncommand="goDoCommand('cmd_bm_openinnewtab');"/>
    <command id="cmd_bm_openfolder"                oncommand="goDoCommand('cmd_bm_openfolder');"/>
    <command id="cmd_bm_managefolder"              oncommand="goDoCommand('cmd_bm_managefolder');"/>
    <command id="cmd_bm_newfolder"                 oncommand="goDoCommand('cmd_bm_newfolder');"/>
    <command id="cmd_bm_newbookmark"               oncommand="goDoCommand('cmd_bm_newbookmark');"/>
    <command id="cmd_bm_newseparator"              oncommand="goDoCommand('cmd_bm_newseparator');"/>
    <command id="cmd_bm_properties"                oncommand="goDoCommand('cmd_bm_properties');"/>
    <command id="cmd_bm_refreshlivemark"           oncommand="goDoCommand('cmd_bm_refreshlivemark');"/>
    <command id="cmd_bm_rename"                    oncommand="goDoCommand('cmd_bm_rename');"/>
    <command id="cmd_bm_moveBookmark"              oncommand="goDoCommand('cmd_bm_moveBookmark');"/>
    <command id="cmd_bm_sortbyname"                oncommand="goDoCommand('cmd_bm_sortbyname');"/>

    <command id="cmd_handleBackspace"  oncommand="BrowserHandleBackspace();" />

    <command id="cmd_newNavigatorTab" oncommand="BrowserOpenTab();"/>
    <command id="Browser:OpenFile"  oncommand="BrowserOpenFileWindow();"/>
    <command id="Browser:SavePage" oncommand="saveDocument(window.content.document);"/>

    <command id="Browser:SendLink" oncommand="MailIntegration.sendLinkForContent();"/>
    <command id="Browser:NewMessage" oncommand="MailIntegration.sendMessage('', '');"/>
    <command id="Browser:ReadMail" oncommand="MailIntegration.readMail();" label="&mailButton.readMail.label;"/>
    <command id="Browser:ReadNews" oncommand="MailIntegration.readNews();"/>

    <command id="cmd_pageSetup" oncommand="PrintUtils.showPageSetup();"/>
    <command id="cmd_print" oncommand="PrintUtils.print();"/>
    <command id="cmd_close" oncommand="BrowserCloseTabOrWindow()"/>
    <command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()"/>
    <command id="cmd_toggleTaskbar" oncommand="goToggleToolbar('status-bar','toggle_taskbar');"/>
    <command id="cmd_CustomizeToolbars" oncommand="BrowserCustomizeToolbar()"/>
  
    <command id="cmd_copyLink"
             oncommand="goDoCommand('cmd_copyLink')"
             disabled="false"/>
    <command id="cmd_copyImageLocation"
             oncommand="goDoCommand('cmd_copyImageLocation')"
             disabled="false"/>
    <command id="cmd_copyImageContents"
             oncommand="goDoCommand('cmd_copyImageContents')"
             disabled="false"/>
    <command id="cmd_undo" 
             oncommand="goDoCommand('cmd_undo')"
             disabled="true"/>
    <command id="cmd_redo" 
             oncommand="goDoCommand('cmd_redo')"
             disabled="true"/>
    <command id="cmd_cut" 
             oncommand="goDoCommand('cmd_cut')"
             disabled="true"/>
    <command id="cmd_copy" 
             oncommand="goDoCommand('cmd_copy')"
             disabled="true"/>
    <command id="cmd_paste" 
             oncommand="goDoCommand('cmd_paste')"
             disabled="true"/>
    <command id="cmd_delete"
             oncommand="goDoCommand('cmd_delete')"
             valueDefault="&deleteCmd.label;"
             disabled="true"/>
    <command id="cmd_selectAll"
             oncommand="goDoCommand('cmd_selectAll')"
             disabled="true"/>
    <command id="cmd_switchTextDirection"
             oncommand="goDoCommand('cmd_switchTextDirection');"
             disabled="true"/>

    <command id="View:PageSource" oncommand="BrowserViewSourceOfDocument(content.document);"/>
    <command id="View:PageInfo" oncommand="BrowserPageInfo();"/>
    <command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
    <command id="cmd_find" oncommand="onFindCmd();"/>
    <command id="cmd_findAgain" oncommand="onFindAgainCmd();"/>
    <command id="cmd_findPrevious" oncommand="onFindPreviousCmd();"/>    
    <command id="Browser:AddBookmarkAs" oncommand="addBookmarkAs(document.getElementById('content'), false);"/>
    <command id="Browser:BookmarkAllTabs" oncommand="addBookmarkAs(document.getElementById('content'), true);"/>
    <command id="Browser:Home"    oncommand="BrowserHome();"/>
    <command id="Browser:Back"    oncommand="BrowserBack();" disabled="true"/>
    <command id="Browser:Forward" oncommand="BrowserForward();" disabled="true"/>
    <command id="Browser:Stop"    oncommand="BrowserStop();" disabled="true"/>
    <command id="Browser:Reload"  oncommand="if (event.shiftKey) BrowserReloadSkipCache(); else BrowserReload()" disabled="true"/>
    <command id="Browser:ReloadSkipCache"  oncommand="BrowserReloadSkipCache()" disabled="true"/>
    <command id="cmd_textZoomReduce"  oncommand="ZoomManager.prototype.getInstance().reduce();"/>
    <command id="cmd_textZoomEnlarge" oncommand="ZoomManager.prototype.getInstance().enlarge();"/>
    <command id="cmd_textZoomReset" oncommand="ZoomManager.prototype.getInstance().reset();"/>
    <command id="Browser:OpenLocation" oncommand="openLocation();"/>

    <command id="Tools:Search" oncommand="WebSearch();"/>    
    <command id="Tools:Downloads" oncommand="toOpenWindowByType('Download:Manager', 
                                                                'chrome://mozapps/content/downloads/downloads.xul',
                                                                'chrome,dialog=no,resizable');"/>
    <command id="Tools:Extensions" oncommand="BrowserOpenExtensions('extensions');"/>
    <command id="Tools:Themes" oncommand="BrowserOpenExtensions('themes');"/>
    <command id="Tools:Sanitize" oncommand="gBrowserGlue.sanitize(window || null);"/>
  </commandset>

  <broadcasterset id="mainBroadcasterSet">
    <broadcaster id="viewBookmarksSidebar" autoCheck="false" label="&bookmarksButton.label;"
                 type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/bookmarks/bookmarksPanel.xul"
                 oncommand="toggleSidebar('viewBookmarksSidebar');"/>

    <broadcaster id="viewHistorySidebar" autoCheck="false" label="&historyButton.label;"
                 type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/history/history-panel.xul"
                 oncommand="toggleSidebar('viewHistorySidebar');"/>
                 
    <broadcaster id="viewWebPanelsSidebar" autoCheck="false" 
                 type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/web-panels.xul"
                 oncommand="toggleSidebar('viewWebPanelsSidebar');"/>

    <!-- popup blocking menu items -->
    <broadcaster id="blockedPopupAllowSite" 
                 accesskey="&allowPopups.accesskey;" 
                 oncommand="gPopupBlockerObserver.toggleAllowPopupsForSite(event);"/>
    <broadcaster id="blockedPopupEditSettings" 
                 label="&editPopupSettings.label;"
                 accesskey="&editPopupSettings.accesskey;" 
                 oncommand="gPopupBlockerObserver.editPopupSettings();"/>
    <broadcaster id="blockedPopupDontShowMessage" 
                 accesskey="&dontShowMessage.accesskey;" 
                 type="checkbox"
                 oncommand="gPopupBlockerObserver.dontShowMessage();"/>
    <broadcaster id="blockedPopupsSeparator"/>

  </broadcasterset>

  <keyset id="mainKeyset">
    <key id="key_newNavigator"
         key="&newNavigatorCmd.key;"
         command="cmd_newNavigator"
         modifiers="accel"/>
    <key id="key_newNavigatorTab" key="&tabCmd.commandkey;" modifiers="accel" command="cmd_newNavigatorTab"/>
    <key id="focusURLBar" key="&openCmd.commandkey;" command="Browser:OpenLocation"
         modifiers="accel"/>
    <key id="focusURLBar2" key="&urlbar.accesskey;" command="Browser:OpenLocation"
         modifiers="alt"/>

    <key id="key_search" key="&searchFocus.commandkey;" command="Tools:Search" modifiers="accel"/>
    <key id="key_search2" key="&searchFocus.commandkey2;" command="Tools:Search" modifiers="accel"/>
    <key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
    <key id="openFileKb" key="&openFileCmd.commandkey;" command="Browser:OpenFile"  modifiers="accel"/>
    <key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
    <key id="printKb" key="&printCmd.commandkey;" command="cmd_print"  modifiers="accel"/>
    <key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel"/>
    <key id="key_closeWindow" key="&closeCmd.key;" command="cmd_closeWindow" modifiers="accel,shift"/>
    <key id="key_undo"
         key="&undoCmd.key;"
         modifiers="accel"/>
    <key id="key_redo" key="&redoCmd.key;" modifiers="accel"/>
    <key id="key_cut"
         key="&cutCmd.key;"
         modifiers="accel"/>
    <key id="key_copy"
         key="&copyCmd.key;"
         modifiers="accel"/>
    <key id="key_paste"
         key="&pasteCmd.key;"
         modifiers="accel"/>
    <key id="key_delete" keycode="VK_DELETE" command="cmd_delete"/>
    <key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel"/>

    <key keycode="VK_BACK" command="cmd_handleBackspace"/>
    <key keycode="VK_BACK" command="Browser:Forward" modifiers="shift"/>
    <key id="goBackKb"  keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/>
    <key id="goForwardKb"  keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/>
    <key id="goHome" keycode="VK_HOME" command="Browser:Home" modifiers="alt"/>
    <key keycode="VK_F5" command="Browser:Reload"/>
    <key keycode="VK_F5" command="Browser:ReloadSkipCache" modifiers="accel"/>
    <key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/>
    <key key="&reloadCmd.commandkey;" command="Browser:Reload" modifiers="accel" id="key_reload"/>
    <key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift"/>
    <key id="key_viewSource" key="&pageSourceCmd.commandkey;" command="View:PageSource" modifiers="accel"/>
    <key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
    <key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
    <key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
    <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
    <key keycode="&findAgainCmd.commandkey2;"  command="cmd_findPrevious" modifiers="shift"/>

    <key id="addBookmarkAsKb" key="&addCurPageAsCmd.commandkey;" command="Browser:AddBookmarkAs" modifiers="accel"/>
    <key id="bookmarkAllTabsKb" key="&addCurPageAsCmd.commandkey;" command="Browser:BookmarkAllTabs" modifiers="accel,shift"/>
    <key id="viewBookmarksSidebarKb" key="&bookmarksSidebarCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
    <key id="viewBookmarksSidebarWinKb" key="&bookmarksSidebarWinCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>

    <key id="key_stop" keycode="VK_ESCAPE" oncommand="BrowserStop();"/>
    <key id="key_gotoHistory"  key="&historySidebarCmd.commandKey;"  command="viewHistorySidebar" modifiers="accel"/>

    <key id="key_newMessage"
         key="&sendMessage.commandkey;"
         command="Browser:NewMessage"
         modifiers="accel"/>
    <key id="key_textZoomReduce"  key="&textZoomReduceCmd.commandkey;"   command="cmd_textZoomReduce"  modifiers="accel"/>
    <key id="key_textZoomEnlarge" key="&textZoomEnlargeCmd.commandkey;"  command="cmd_textZoomEnlarge" modifiers="accel"/>
    <key                          key="&textZoomEnlargeCmd.commandkey2;" command="cmd_textZoomEnlarge" modifiers="accel"/>
    <key id="key_textZoomReset"   key="&textZoomResetCmd.commandkey;"    command="cmd_textZoomReset"   modifiers="accel"/>
    
    <key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />

    <key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
  </keyset>

  <keyset id="baseMenuKeyset" />

  <popupset id="mainPopupSet">
    <popup id="backMenu" 
           position="after_start" 
           onpopupshowing="return BrowserBackMenu(event);"
           oncommand="gotoHistoryIndex(event);"
           onclick="checkForMiddleClick(this, event);"/>
    <popup id="forwardMenu"
           position="after_start"
           onpopupshowing="return BrowserForwardMenu(event);"
           oncommand="gotoHistoryIndex(event);"
           onclick="checkForMiddleClick(this, event);"/>
    <tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>

    <popup type="autocomplete" id="PopupAutoComplete"/>

    <popup id="toolbar-context-menu"
           onpopupshowing="updateToolbarStates(this); onViewToolbarsPopupShowing(event);">
      <menuseparator/>
      <menuitem command="cmd_CustomizeToolbars"
                label="&viewCustomizeToolbar.label;"
                accesskey="&viewCustomizeToolbar.accesskey;"/>
    </popup>

    <popup id="blockedPopupOptions" 
           onpopupshowing="gPopupBlockerObserver.fillPopupList(event);">
      <menuitem observes="blockedPopupAllowSite"/>
      <menuitem observes="blockedPopupEditSettings"/>
      <menuitem observes="blockedPopupDontShowMessage"/>
      <menuseparator observes="blockedPopupsSeparator"/>
    </popup>


    <popup id="contentAreaContextMenu"
           onpopupshowing="if (event.target != this) return true; gContextMenu = new nsContextMenu( this ); return gContextMenu.shouldDisplay;"
           onpopuphiding="if (event.target == this) gContextMenu = null;">
      <menuitem id="context-openlink"
                label="&openLinkCmd.label;"
                accesskey="&openLinkCmd.accesskey;"
                oncommand="gContextMenu.openLink();"/>
      <menuitem id="context-openlinkintab"
                label="&openLinkCmdInTab.label;"
                accesskey="&openLinkCmdInTab.accesskey;"
                oncommand="gContextMenu.openLinkInTab();"/>
      <menuseparator id="context-sep-open"/>
      <menuitem id="context-bookmarklink"
                label="&bookmarkLinkCmd.label;"
                accesskey="&bookmarkLinkCmd.accesskey;"
                oncommand="BookmarksUtils.addBookmark(gContextMenu.linkURL,
                                                      gContextMenu.linkText());"/>
      <menuitem id="context-savelink"
                label="&saveLinkCmd.label;"
                accesskey="&saveLinkCmd.accesskey;"
                oncommand="gContextMenu.saveLink();"/>
      <menuitem id="context-sendlink"
                label="&sendLinkCmd.label;"
                accesskey="&sendLinkCmd.accesskey;"
                oncommand="gContextMenu.sendLink();"/>
      <menuitem id="context-copyemail"
                label="&copyEmailCmd.label;"
                accesskey="&copyEmailCmd.accesskey;"
                oncommand="gContextMenu.copyEmail();"/>
      <menuitem id="context-copylink"
                label="&copyLinkCmd.label;"
                accesskey="&copyLinkCmd.accesskey;"
                command="cmd_copyLink"/>
      <menuseparator id="context-sep-copylink"/>
      <menuitem id="context-viewimage"
                label="&viewImageCmd.label;"
                accesskey="&viewImageCmd.accesskey;"
                oncommand="gContextMenu.viewImage(event);"
                onclick="checkForMiddleClick(this, event);"/>
      <menuitem id="context-copyimage-contents"
                label="&copyImageContentsCmd.label;"
                accesskey="&copyImageContentsCmd.accesskey;"
                command="cmd_copyImageContents"/>
      <menuitem id="context-copyimage"
                label="&copyImageCmd.label;"
                accesskey="&copyImageCmd.accesskey;"
                command="cmd_copyImageLocation"/>
      <menuseparator id="context-sep-copyimage"/>
      <menuitem id="context-saveimage"
                label="&saveImageCmd.label;"
                accesskey="&saveImageCmd.accesskey;"
                oncommand="gContextMenu.saveImage();"/>
      <menuitem id="context-sendimage"  
                label="&sendImageCmd.label;" 
                accesskey="&sendImageCmd.accesskey;" 
                oncommand="gContextMenu.sendImage();"/>
      <menuitem id="context-setDesktopBackground"
                label="&setDesktopBackgroundCmd.label;"
                accesskey="&setDesktopBackgroundCmd.accesskey;"
                oncommand="gContextMenu.setDesktopBackground();"/>

<!--XXXBlake XUL sucks! We need autocheck for menuitems. -->
      <menuitem id="context-blockimage" class="menuitem-iconic"
                accesskey="&blockImageCmd.accesskey;"
                oncommand="gContextMenu.toggleImageBlocking(this.getAttribute('checked') != 'true');"/>
      <menuitem id="context-back"
                label="&backCmd.label;"
                accesskey="&backCmd.accesskey;"
                command="Browser:Back"/>
      <menuitem id="context-forward"
                label="&forwardCmd.label;"
                accesskey="&forwardCmd.accesskey;"
                command="Browser:Forward"/>
      <menuitem id="context-reload"
                label="&reloadCmd.label;"
                accesskey="&reloadCmd.accesskey;"
                command="Browser:Reload"/>
      <menuitem id="context-stop"
                label="&stopCmd.label;"
                accesskey="&stopCmd.accesskey;"
                command="Browser:Stop"/>
      <menuseparator id="context-sep-stop"/>
      <menuitem id="context-bookmarkpage"
                label="&bookmarkPageCmd.label;"
                accesskey="&bookmarkPageCmd.accesskey;"
                oncommand="addBookmarkAs(document.getElementById('content'));"/>
      <menuitem id="context-savepage"
                label="&savePageCmd.label;"
                accesskey="&savePageCmd.accesskey;"
                oncommand="saveDocument(window.content.document);"/>
      <menuitem id="context-sendpage"  
                label="&sendPageCmd.label;" 
                accesskey="&sendPageCmd.accesskey;" 
                command="Browser:SendLink"/>
      <menuseparator id="context-sep-viewbgimage"/>  
      <menuitem id="context-viewbgimage"
                label="&viewBGImageCmd.label;"
                accesskey="&viewBGImageCmd.accesskey;"
                oncommand="gContextMenu.viewBGImage(event);"
                onclick="checkForMiddleClick(this, event);"/>
      <menuitem id="context-undo"
                label="&undoCmd.label;"
                accesskey="&undoCmd.accesskey;"
                command="cmd_undo"/>
      <menuseparator id="context-sep-undo"/>
      <menuitem id="context-cut"
                label="&cutCmd.label;"
                accesskey="&cutCmd.accesskey;"
                command="cmd_cut"/>
      <menuitem id="context-copy"
                label="&copyCmd.label;"
                accesskey="&copyCmd.accesskey;"
                command="cmd_copy"/>
      <menuitem id="context-paste"
                label="&pasteCmd.label;"
                accesskey="&pasteCmd.accesskey;"
                command="cmd_paste"/>
      <menuitem id="context-delete"
                label="&deleteCmd.label;"
                accesskey="&deleteCmd.accesskey;"
                command="cmd_delete"/>
      <menuseparator id="context-sep-paste"/>
      <menuitem id="context-selectall"
                label="&selectAllCmd.label;"
                accesskey="&selectAllCmd.accesskey;"
                command="cmd_selectAll"/>      
      <menuseparator id="context-sep-selectall"/>
      <menuitem id="context-keywordfield"
                label="&keywordfield.label;"
                accesskey="&keywordfield.accesskey;"
                oncommand="AddKeywordForSearchField();"/>
      <menuitem id="context-searchselect"
                accesskey="&search.accesskey;"
                oncommand="OpenSearch('internet', gContextMenu.searchSelected(), true);"/>
      <menuseparator id="frame-sep"/>
      <menu id="frame" label="&thisFrameMenu.label;" accesskey="&thisFrameMenu.accesskey;">
        <menupopup>
          <menuitem label="&showOnlyThisFrameCmd.label;"
                    accesskey="&showOnlyThisFrameCmd.accesskey;"
                    oncommand="gContextMenu.showOnlyThisFrame();"/>
          <menuitem label="&openFrameCmd.label;"
                    accesskey="&openFrameCmd.accesskey;"
                    oncommand="gContextMenu.openFrame();"/>
          <menuitem label="&openFrameCmdInTab.label;"
                    accesskey="&openFrameCmdInTab.accesskey;"
                    oncommand="gContextMenu.openFrameInTab();"/>
          <menuseparator/>
          <menuitem label="&reloadFrameCmd.label;"
                    accesskey="&reloadFrameCmd.accesskey;"
                    oncommand="gContextMenu.reloadFrame();"/>
          <menuseparator/>
          <menuitem label="&bookmarkFrameCmd.label;"
                    accesskey="&bookmarkFrameCmd.accesskey;"
                    oncommand="gContextMenu.addBookmarkForFrame();"/>
          <menuitem label="&saveFrameCmd.label;"
                    accesskey="&saveFrameCmd.accesskey;"
                    oncommand="saveDocument(gContextMenu.target.ownerDocument);"/>
          <menuseparator/>
          <menuitem label="&viewFrameSourceCmd.label;"
                    accesskey="&viewFrameSourceCmd.accesskey;"
                    oncommand="gContextMenu.viewFrameSource();"/>
          <menuitem label="&viewFrameInfoCmd.label;"
                    accesskey="&viewFrameInfoCmd.accesskey;"
                    oncommand="gContextMenu.viewFrameInfo();"/>        
        </menupopup>
      </menu>
      <menuseparator id="context-sep-properties"/>
      <menuitem id="context-viewpartialsource-selection"
                label="&viewPartialSourceForSelectionCmd.label;"
                accesskey="&viewPartialSourceCmd.accesskey;"
                oncommand="gContextMenu.viewPartialSource('selection');"/>
      <menuitem id="context-viewpartialsource-mathml"
                label="&viewPartialSourceForMathMLCmd.label;"
                accesskey="&viewPartialSourceCmd.accesskey;"
                oncommand="gContextMenu.viewPartialSource('mathml');"/>
      <menuitem id="context-viewsource"
                label="&viewPageSourceCmd.label;"
                accesskey="&viewPageSourceCmd.accesskey;"
                oncommand="BrowserViewSourceOfDocument(content.document);"/>
      <menuitem id="context-viewinfo"
                label="&viewPageInfoCmd.label;"
                accesskey="&viewPageInfoCmd.accesskey;"
                oncommand="gContextMenu.viewInfo();"/>
      <menuitem id="context-metadata"
                label="&metadataCmd.label;"
                accesskey="&metadataCmd.accesskey;"
                oncommand="gContextMenu.showMetadata();"/>
      <menuseparator hidden="true" id="context-sep-bidi"/>
      <menuitem hidden="true" id="context-bidi-text-direction-toggle"
                label="&bidiSwitchTextDirectionItem.label;"
                accesskey="&bidiSwitchTextDirectionItem.accesskey;"
                command="cmd_switchTextDirection"/>
      <menuitem hidden="true" id="context-bidi-page-direction-toggle"
                label="&bidiSwitchPageDirectionItem.label;"
                accesskey="&bidiSwitchPageDirectionItem.accesskey;"
                oncommand="SwitchDocumentDirection(window.content);"/>
    </popup>


  </popupset>

  <!-- Total hack. Used by the Go menu to build up items. -->
  <tree id="hiddenHistoryTree" hidden="true" collapsed="true" datasources="rdf:null"
        flags="dont-build-content"
        hidecolumnpicker="true">
    <template>
      <rule>
        <treechildren>
          <treeitem uri="rdf:*" rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
            <treerow>
              <treecell label="rdf:http://home.netscape.com/NC-rdf#Name"/>
              <treecell label="rdf:http://home.netscape.com/NC-rdf#Date" hidden="true"/>
            </treerow>
          </treeitem>
        </treechildren>
      </rule>
    </template>
    <treecols id="hiddenHistoryTreeCols">
      <treecol flex="1" id="Name"
               hideheader="true" primary="true"/>
      <treecol id="Date" hidden="true" hideheader="true"
               sort="rdf:http://home.netscape.com/NC-rdf#Date" sortActive="true" sortDirection="descending"/>
    </treecols>
  </tree>

  <!-- bookmarks context menu -->
  <popupset>
    <menupopup id="bookmarks-context-menu" 
               onpopupshowing="return BookmarksMenu.createContextMenu(event);"
               onpopuphidden ="BookmarksMenu.destroyContextMenu(event);"/>
  </popupset>

  <!-- bookmarks toolbar tooltip -->
  <tooltip id="btTooltip" noautohide="true" 
           onpopupshowing="return BookmarksToolbar.fillInBTTooltip(document.tooltipNode)">
    <vbox id="btTooltipTextBox" flex="1">  
      <label id="btTitleText" />
      <label id="btUrlText" />
    </vbox>
  </tooltip>

  <toolbox id="navigator-toolbox" class="toolbox-top" mode="icons">


    <!-- Menu -->




    <toolbar type="menubar" id="toolbar-menubar" class="chromeclass-menubar" customizable="true"
             defaultset="menubar-items,spring,throbber-box"
             mode="icons" context="toolbar-context-menu">

    </toolbar>

    <toolbarpalette id="BrowserToolbarPalette">
      <toolbarbutton id="back-button" type="menu-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                     chromedir="&locale.dir;"
                     label="&backCmd.label;"
                     oncommand="BrowserBack(event)"
                     onclick="checkForMiddleClick(this, event);"
                     context="backMenu"
                     tooltiptext="&backButton.tooltip;">
        <observes element="Browser:Back" attribute="disabled"/>
        <menupopup context=""
                   onpopupshowing="BrowserBackMenu(event);"
                   oncommand="gotoHistoryIndex(event); event.preventBubble();"
                   onclick="checkForMiddleClick(this, event);"/>
      </toolbarbutton>
    
      <toolbarbutton id="forward-button" type="menu-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                     chromedir="&locale.dir;"
                     label="&forwardCmd.label;"
                     oncommand="BrowserForward(event)"
                     onclick="checkForMiddleClick(this, event);"
                     context="forwardMenu"
                     tooltiptext="&forwardButton.tooltip;">
        <observes element="Browser:Forward" attribute="disabled"/>
        <menupopup context=""
                   onpopupshowing="BrowserForwardMenu(event);"
                   oncommand="gotoHistoryIndex(event); event.preventBubble()"
                   onclick="checkForMiddleClick(this, event);"/>
      </toolbarbutton>
    
      <toolbarbutton id="reload-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                     label="&reloadCmd.label;"
                     command="Browser:Reload"
                     tooltiptext="&reloadButton.tooltip;"/>
                    
      <toolbarbutton id="stop-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                     label="&stopCmd.label;"
                     command="Browser:Stop"
                     tooltiptext="&stopButton.tooltip;"/>

      <toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                     label="&homeButton.label;"
                     ondragover="nsDragAndDrop.dragOver(event, homeButtonObserver);"
                     ondragdrop="nsDragAndDrop.drop(event, homeButtonObserver);"
                     ondragexit="nsDragAndDrop.dragExit(event, homeButtonObserver);"
                     onclick="BrowserHomeClick(event);"/>




      <toolbaritem id="menubar-items" align="center">

       <menubar id="main-menubar" statusbar="statusbar-display"
                style="border:0px;padding:0px;margin:0px;-moz-appearance:none">
            <menu id="file-menu" label="&fileMenu.label;"
                  accesskey="&fileMenu.accesskey;">
              <menupopup id="menu_FilePopup" onpopupshowing="getContentAreaFrameCount();">
                <menuitem label="&newNavigatorCmd.label;"
                          accesskey="&newNavigatorCmd.accesskey;"
                          key="key_newNavigator"
                          command="cmd_newNavigator"/>
                <menuitem command="cmd_newNavigatorTab" key="key_newNavigatorTab"
                          label="&tabCmd.label;" accesskey="&tabCmd.accesskey;"/>
                <menuitem label="&openLocationCmd.label;" accesskey="&openLocationCmd.accesskey;" key="focusURLBar" command="Browser:OpenLocation"/>
                <menuitem label="&openFileCmd.label;" accesskey="&openFileCmd.accesskey;" key="openFileKb" command="Browser:OpenFile"/>
                <menuitem id="menu_closeWindow" hidden="true" command="cmd_closeWindow" key="key_closeWindow" label="&closeWindow.label;"/>
                <menuitem id="menu_close" label="&closeCmd.label;" key="key_close" accesskey="&closeCmd.accesskey;" command="cmd_close"/>
                <menuseparator/>
                <menuitem label="&savePageCmd.label;" accesskey="&savePageCmd.accesskey;" key="key_savePage" command="Browser:SavePage"/>
                <menuitem id="menu_saveFrame" label="&saveFrameCmd.label;" accesskey="&saveFrameCmd.accesskey;" oncommand="saveFrameDocument();" hidden="true"/>
                <menuitem id="menu_sendLink"  label="&sendPageCmd.label;"  accesskey="&sendPageCmd.accesskey;"  command="Browser:SendLink"/>
                <menuseparator/>
                <menuitem label="&printSetupCmd.label;" accesskey="&printSetupCmd.accesskey;" command="cmd_pageSetup"/>
                <menuitem label="&printPreviewCmd.label;" accesskey="&printPreviewCmd.accesskey;" oncommand="PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview);"/>
                <menuitem label="&printCmd.label;" accesskey="&printCmd.accesskey;" key="printKb" command="cmd_print"/>
                <menuseparator/>
                <menuitem label="&import.label;" accesskey="&import.accesskey;" oncommand="BrowserImport();"/>
                <menuseparator/>
                <menuitem id="goOfflineMenuitem"
                          label="&goOfflineCmd.label;" accesskey="&goOfflineCmd.accesskey;" 
                          type="checkbox" oncommand="BrowserOffline.toggleOfflineStatus();"/>
                <menuitem id="menu_FileQuitItem" 
			  label="&quitApplicationCmdWin.label;"
			  accesskey="&quitApplicationCmdWin.accesskey;"
			  oncommand="goQuitApplication();"/>
              </menupopup>
            </menu>
  
            <menu id="edit-menu" label="&editMenu.label;"
                  accesskey="&editMenu.accesskey;">
              <menupopup id="menu_EditPopup">
                <menuitem label="&undoCmd.label;"
                          key="key_undo"
                          accesskey="&undoCmd.accesskey;"
                          command="cmd_undo"/>
                <menuitem label="&redoCmd.label;"
                          key="key_redo"
                          accesskey="&redoCmd.accesskey;"
                          command="cmd_redo"/>
                <menuseparator/>
                <menuitem label="&cutCmd.label;"
                          key="key_cut"
                          accesskey="&cutCmd.accesskey;"
                          command="cmd_cut"/>
                <menuitem label="&copyCmd.label;"
                          key="key_copy"
                          accesskey="&copyCmd.accesskey;"
                          command="cmd_copy"/>
                <menuitem label="&pasteCmd.label;"
                          key="key_paste"
                          accesskey="&pasteCmd.accesskey;"
                          command="cmd_paste"/>
                <menuitem label="&deleteCmd.label;"
                          key="key_delete"
                          accesskey="&deleteCmd.accesskey;"
                          command="cmd_delete"/>
                <menuseparator/>
                <menuitem label="&selectAllCmd.label;"
                          key="key_selectAll"
                          accesskey="&selectAllCmd.accesskey;"
                          command="cmd_selectAll"/>
                <menuseparator/>
                <menuitem label="&findOnCmd.label;" accesskey="&findOnCmd.accesskey;" key="key_find" command="cmd_find"/>
                <menuitem label="&findAgainCmd.label;" accesskey="&findAgainCmd.accesskey;" key="key_findAgain" command="cmd_findAgain"/>
                <menuseparator hidden="true" id="textfieldDirection-separator"/>
                <menuitem id="textfieldDirection-swap"
                          command="cmd_switchTextDirection"
                          key="key_switchTextDirection"
                          label="&bidiSwitchTextDirectionItem.label;"
                          accesskey="&bidiSwitchTextDirectionItem.accesskey;"
                          hidden="true"/>
              </menupopup>
            </menu>
  
            <menu id="view-menu" label="&viewMenu.label;" accesskey="&viewMenu.accesskey;">
              <menupopup id="menu_viewPopup">
                <menu id="viewToolbarsMenu" label="&viewToolbarsMenu.label;" accesskey="&viewToolbarsMenu.accesskey;"
                      onpopupshowing="onViewToolbarsPopupShowing(event);">
                  <menupopup onpopupshowing="updateToolbarStates(this);"> 
                    <menuseparator/>
                      <menuitem label="&viewCustomizeToolbar.label;" accesskey="&viewCustomizeToolbar.accesskey;"
                                command="cmd_CustomizeToolbars"/>             
                  </menupopup>
                </menu>
                <menuitem id="toggle_taskbar" label="&taskbarCmd.label;" accesskey="&taskbarCmd.accesskey;" type="checkbox" command="cmd_toggleTaskbar" checked="true" />
                <menu id="viewSidebarMenuMenu"
                      label="&viewSidebarMenu.label;"
                      accesskey="&viewSidebarMenu.accesskey;">
                  <menupopup id="viewSidebarMenu">
                    <menuitem key="viewBookmarksSidebarKb" observes="viewBookmarksSidebar" accesskey="&bookmarksSidebarCmd.accesskey;"/>
                    <menuitem key="key_gotoHistory" observes="viewHistorySidebar" accesskey="&historySidebarCmd.accesskey;"/>
                  </menupopup>
                </menu>            
                <menuseparator/>
                <menuitem label="&stopCmd.label;"
                          accesskey="&stopCmd.accesskey;"
                          command="Browser:Stop"
                          key="key_stop"/>
                <menuitem label="&reloadCmd.label;" accesskey="&reloadCmd.accesskey;" command="Browser:Reload" key="key_reload"/>
                <menuseparator/>
                <menu id="viewTextZoomMenu" label="&textSize.label;" accesskey="&textSize.accesskey;">
                  <menupopup>                    
                    <menuitem key="key_textZoomEnlarge" label="&textZoomEnlargeCmd.label;" accesskey="&textZoomEnlargeCmd.accesskey;"
                              command="cmd_textZoomEnlarge"/>
                    <menuitem key="key_textZoomReduce"  label="&textZoomReduceCmd.label;"  accesskey="&textZoomReduceCmd.accesskey;"
                              command="cmd_textZoomReduce"/>
                    <menuseparator/>
                    <menuitem key="key_textZoomReset" label="&textZoomResetCmd.label;" accesskey="&textZoomResetCmd.accesskey;"
                              command="cmd_textZoomReset"/>
                  </menupopup>
                </menu>
                <menu id="pageStyleMenu" label="&pageStyleMenu.label;" accesskey="&pageStyleMenu.accesskey;">
                  <menupopup onpopupshowing="stylesheetFillPopup(this);"
                             oncommand="stylesheetSwitchAll(window.content, event.target.getAttribute('data')); setStyleDisabled(false);">
                    <menuitem label="&pageStyleNoStyle.label;" accesskey="&pageStyleNoStyle.accesskey;"
                              oncommand="setStyleDisabled(true); event.preventBubble();" type="radio"/>
                    <menuitem label="&pageStylePersistentOnly.label;" accesskey="&pageStylePersistentOnly.accesskey;" type="radio" checked="true"/>
                    <menuseparator/>
                  </menupopup>
                </menu>
                <menu id="charsetMenu"
                      label="&charsetMenu.label;"
                      accesskey="&charsetMenu.accesskey;"
                      datasources="rdf:charset-menu"
                      ref="NC:BrowserCharsetMenuRoot"
                      oncommand="MultiplexHandler(event)"
                      onpopupshowing="CreateMenu('browser');UpdateMenus(event)"
                      onpopupshown="CreateMenu('more-menu');">
                    <template>
                        <rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
                            <menupopup>
                            <menuseparator uri="..." />
                            </menupopup>
                        </rule>
                        <rule>
                            <menupopup>
                            <menuitem type="radio" name="charsetGroup" checked="rdf:http://home.netscape.com/NC-rdf#Checked" uri="..." label="rdf:http://home.netscape.com/NC-rdf#Name"/>
                            </menupopup>
                        </rule>
                    </template>
      
                    <menupopup>
                    <menu label="&charsetMenuAutodet.label;" accesskey="&charsetMenuAutodet.accesskey;" datasources="rdf:charset-menu" ref="NC:BrowserAutodetMenuRoot">
                        <template>
                            <rule rdf:type="http://home.netscape.com/NC-rdf#CharsetDetector">
                                <menupopup>
                                <menuitem type="radio" name="detectorGroup" checked="rdf:http://home.netscape.com/NC-rdf#Checked" uri="..." label="rdf:http://home.netscape.com/NC-rdf#Name"/>
                                </menupopup>
                            </rule>
                        </template>
                        <menupopup>
                        </menupopup>
                    </menu>
                    <menu label="&charsetMenuMore.label;" accesskey="&charsetMenuMore.accesskey;" datasources="rdf:charset-menu" ref="NC:BrowserMoreCharsetMenuRoot">
                        <template>
                            <rule>
                                <menupopup>
                                <menuitem uri="..." label="rdf:http://home.netscape.com/NC-rdf#Name"/>
                                </menupopup>
                            </rule>
                        </template>
                        <menupopup>
                            <menu label="&charsetMenuMore1.label;" accesskey="&charsetMenuMore1.accesskey;" datasources="rdf:charset-menu" ref="NC:BrowserMore1CharsetMenuRoot">
                                <template>
                                    <rule>
                                        <menupopup>
                                        <menuitem uri="..." label="rdf:http://home.netscape.com/NC-rdf#Name"/>
                                        </menupopup>
                                    </rule>
                                </template>
                                <menupopup>
                                </menupopup>
                            </menu>
                            <menu label="&charsetMenuMore2.label;" accesskey="&charsetMenuMore2.accesskey;" datasources="rdf:charset-menu" ref="NC:BrowserMore2CharsetMenuRoot">
                                <template>
                                    <rule>
                                        <menupopup>
                                        <menuitem uri="..." label="rdf:http://home.netscape.com/NC-rdf#Name"/>
                                        </menupopup>
                                    </rule>
                                </template>
                                <menupopup>
                                </menupopup>
                            </menu>
                            <menu label="&charsetMenuMore3.label;" accesskey="&charsetMenuMore3.accesskey;" datasources="rdf:charset-menu" ref="NC:BrowserMore3CharsetMenuRoot">
                                <template>
                                    <rule>
                                        <menupopup>
                                        <menuitem uri="..." label="rdf:http://home.netscape.com/NC-rdf#Name"/>
                                        </menupopup>
                                    </rule>
                                </template>
                                <menupopup>
                                </menupopup>
                            </menu>
                            <menu label="&charsetMenuMore4.label;" accesskey="&charsetMenuMore4.accesskey;" datasources="rdf:charset-menu" ref="NC:BrowserMore4CharsetMenuRoot">
                                <template>
                                    <rule>
                                        <menupopup>
                                        <menuitem uri="..." label="rdf:http://home.netscape.com/NC-rdf#Name"/>
                                        </menupopup>
                                    </rule>
                                </template>
                                <menupopup>
                                </menupopup>
                            </menu>
                            <menu label="&charsetMenuMore5.label;" accesskey="&charsetMenuMore5.accesskey;" datasources="rdf:charset-menu" ref="NC:BrowserMore5CharsetMenuRoot">
                                <template>
                                    <rule>
                                        <menupopup>
                                        <menuitem uri="..." label="rdf:http://home.netscape.com/NC-rdf#Name"/>
                                        </menupopup>
                                    </rule>
                                </template>
                                <menupopup>
                                </menupopup>
                            </menu>
                            <menu label="&charsetMenuUnicode.label;" accesskey="&charsetMenuUnicode.accesskey;" datasources="rdf:charset-menu" ref="NC:BrowserUnicodeCharsetMenuRoot">
                                <template>
                                    <rule>
                                        <menupopup>
                                        <menuitem uri="..." label="rdf:http://home.netscape.com/NC-rdf#Name"/>
                                        </menupopup>
                                    </rule>
                                </template>
                                <menupopup>
                                </menupopup>
                            </menu>
                            <menuseparator />
                        </menupopup>
                    </menu>
                    <menuitem name="charsetCustomize" accesskey="&charsetCustomize.accesskey;" label="&charsetCustomize.label;" oncommand="window.openDialog('chrome://global/content/customizeCharset.xul','PrefWindow', 'chrome,modal=yes,resizable=yes', 'browser')"/>
                    </menupopup>
                </menu>
                <menuseparator/>
                <menuitem accesskey="&pageSourceCmd.accesskey;" label="&pageSourceCmd.label;" key="key_viewSource" command="View:PageSource"/>
                <menuitem accesskey="&fullScreenCmd.accesskey;"
                          label="&fullScreenCmd.label;" key="key_fullScreen"
                          id="fullScreenItem"
                          type="checkbox"
                          command="View:FullScreen"/>
                <menuseparator hidden="true" id="documentDirection-separator"/>
                <menuitem hidden="true" id="documentDirection-swap" 
                          label="&bidiSwitchPageDirectionItem.label;"
                          accesskey="&bidiSwitchPageDirectionItem.accesskey;"
                          oncommand="SwitchDocumentDirection(window.content)"/>
              </menupopup>
            </menu>
  
            <menu id="go-menu" label="&goMenu.label;" accesskey="&goMenu.accesskey;" 
                  oncommand="var url = event.target.getAttribute('statustext'); if (url) openUILink(url, event, false, true);"
                  onclick="checkForMiddleClick(this, event);">

              <menupopup id="goPopup" onpopupshowing="updateGoMenu(this);" onpopuphiding="onGoMenuHidden();">
                <menuitem label="&backCmd.label;"
                          key="goBackKb"
                          oncommand="BrowserBack(event, true)"
                          onclick="checkForMiddleClick(this, event);">
                  <observes element="Browser:Back" attribute="disabled" />
                </menuitem>
                <menuitem label="&forwardCmd.label;" 
                          key="goForwardKb"
                          oncommand="BrowserForward(event, true)"
                          onclick="checkForMiddleClick(this, event);">
                  <observes element="Browser:Forward" attribute="disabled" />
                </menuitem>

                <menuitem label="&goHomeCmd.label;"
                          command="Browser:Home"
                          key="goHome"/>
                <menuseparator id="startHistorySeparator"/>
                <menuseparator hidden="true" id="endHistorySeparator"/>
                <menuitem observes="viewHistorySidebar"
                          key="key_gotoHistory"/>
              </menupopup>
            </menu>

            <menu id="bookmarks-menu" label="&bookmarksMenu.label;" accesskey="&bookmarksMenu.accesskey;"
                  datasources="rdf:bookmarks rdf:files rdf:localsearch" 
                  ref="NC:BookmarksRoot" flags="dont-test-empty"
                  template='bookmarks-template'
                  infer="forward-proxy"
                  onpopupshowing="UpdateBookmarkAllTabsMenuitem(); BookmarksMenu.onShowMenu(event.target)"
                  onpopuphidden="BookmarksMenu.onHideMenu(event.target)"
                  oncommand="BookmarksMenu.loadBookmark(event, event.target, this.database)"
                  onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
                  ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
                  ondragdrop="nsDragAndDrop.drop(event, BookmarksMenuDNDObserver); event.preventBubble()"
                  ondragenter="nsDragAndDrop.dragEnter(event, BookmarksMenuDNDObserver); event.preventBubble()"
                  ondragexit="nsDragAndDrop.dragExit(event, BookmarksMenuDNDObserver); event.preventBubble()"
                  ondragover="nsDragAndDrop.dragOver(event, BookmarksMenuDNDObserver); event.preventBubble()">
              <menupopup id="menu_BookmarksPopup" contextmenu='bookmarks-context-menu'>
                <menuitem key="addBookmarkAsKb"
                          label="&addCurPageAsCmd.label;"
                          command="Browser:AddBookmarkAs"/>
                <menuitem id="bookmarkAllCmd"
                          key="bookmarkAllTabsKb"
                          label="&bookmarkAllCmd.label;"
                          command="Browser:BookmarkAllTabs"/>
                <menuitem key="manBookmarkKb" 
                          label="&manBookmarksCmd.label;"
                          oncommand="toOpenWindowByType('bookmarks:manager', 'chrome://browser/content/bookmarks/bookmarksManager.xul');"/>
                <menuseparator/>
              </menupopup>
            </menu>
        
            <menu id="tools-menu" label="&toolsMenu.label;" accesskey="&toolsMenu.accesskey;">
              <menupopup id="menu_ToolsPopup"
                       onpopupshowing="MailIntegration.updateUnreadCount();"
            >
              <menuitem label="&search.label;" accesskey="&search.accesskey;" 
                        key="key_search" command="Tools:Search"/>
              <menuseparator/>
              <menuitem label="&mailButton.readMail.label;" 
                               accesskey="&mailButton.readMail.accesskey;"
                               command="Browser:ReadMail"/>
              <menuitem label="&mailButton.newMessage.label;" 
                               accesskey="&mailButton.newMessage.accesskey;"
                               key="key_newMessage" command="Browser:NewMessage"/>

              <menuseparator/>
              <menuitem label="&downloads.label;" accesskey="&downloads.accesskey;"
                        key="key_openDownloads"
                        command="Tools:Downloads"/>
              <menuitem label="&extensions.label;" accesskey="&extensions.accesskey;" 
                        command="Tools:Extensions"/>
              <menuitem label="&themes.label;" accesskey="&themes.accesskey;" 
                        command="Tools:Themes"/>
              <menuseparator id="devToolsSeparator"/>
              <menuitem id="javascriptConsole" 
                        label="&javaScriptConsoleCmd.label;" accesskey="&javaScriptConsoleCmd.accesskey;" 
                        oncommand="toJavaScriptConsole();"/>
              <menuitem accesskey="&pageInfoCmd.accesskey;" label="&pageInfoCmd.label;"   
                        command="View:PageInfo"/>
              <menuseparator id="sanitizeSeparator"/>
              <menuitem id="sanitizeItem" 
                        accesskey="&clearPrivateDataCmd.accesskey;"
                        label="&clearPrivateDataCmd.label;"
                        key="key_sanitize" command="Tools:Sanitize"/>
              <menuseparator id="prefSep"/>
              <menuitem id="menu_preferences"
                        label="&preferencesCmd.label;"
                        accesskey="&preferencesCmd.accesskey;"
                        oncommand="openPreferences();"/>
              </menupopup>
            </menu>
    
          <menu id="helpMenu" />
        </menubar>


  <template id='bookmarks-template' xmlns:nc="http://home.netscape.com/NC-rdf#">
    <rule parent="hbox" rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
      <toolbarseparator uri="rdf:*"
                        rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>
    </rule>
    <rule parent="hbox" rdf:type="http://home.netscape.com/NC-rdf#Livemark">
      <toolbarbutton type="menu" class="bookmark-item" uri="rdf:*" editable="true"
                     rdf:type="http://home.netscape.com/NC-rdf#Folder"
                     label="rdf:http://home.netscape.com/NC-rdf#Name"
                     livemark="true"
                     chromedir="&locale.dir;">
        <menupopup contextmenu="bookmarks-context-menu"/>
      </toolbarbutton>
    </rule>
    <rule parent="hbox" iscontainer="true">
      <toolbarbutton type="menu" class="bookmark-item" uri="rdf:*" editable="true"
                     rdf:type="http://home.netscape.com/NC-rdf#Folder"
                     label="rdf:http://home.netscape.com/NC-rdf#Name">
        <menupopup contextmenu="bookmarks-context-menu"/>
      </toolbarbutton>
    </rule>
    <rule parent="hbox">
      <toolbarbutton class="bookmark-item" uri="rdf:*" editable="true" 
                     status="rdf:http://home.netscape.com/WEB-rdf#status"
                     rdf:type="http://home.netscape.com/NC-rdf#Bookmark"
                     image="rdf:http://home.netscape.com/NC-rdf#Icon"
                     statustext="rdf:http://home.netscape.com/NC-rdf#URL"
                     tooltip="btTooltip"
                     label="rdf:http://home.netscape.com/NC-rdf#Name"/>
    </rule>
    <rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
      <menupopup> 
        <menuseparator uri="rdf:*" />
      </menupopup>
    </rule>
    <rule rdf:type="http://home.netscape.com/NC-rdf#Livemark">
      <menupopup>
        <menu class="menu-iconic bookmark-item" uri="rdf:*"
              label="rdf:http://home.netscape.com/NC-rdf#Name"
              type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
              livemark="true">
          <menupopup contextmenu="bookmarks-context-menu"/>
        </menu>
      </menupopup>
    </rule>
    <rule iscontainer="true">
      <menupopup>
        <menu class="menu-iconic bookmark-item" uri="rdf:*"
              label="rdf:http://home.netscape.com/NC-rdf#Name"
              type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
        <menupopup contextmenu="bookmarks-context-menu"/>
        </menu>
      </menupopup>
    </rule>
    <rule>
      <menupopup>
        <menuitem class="menuitem-iconic bookmark-item" uri="rdf:*"
                  label="rdf:http://home.netscape.com/NC-rdf#Name" 
                  image="rdf:http://home.netscape.com/NC-rdf#Icon"
                  status="rdf:http://home.netscape.com/WEB-rdf#status"
                  statustext="rdf:http://home.netscape.com/NC-rdf#URL"/>
      </menupopup>
    </rule>
  </template>
      </toolbaritem>








      <toolbaritem id="urlbar-container" align="center" flex="1000"
                   title="&locationItem.title;" class="chromeclass-location">
        <textbox id="urlbar" flex="1"
                 type="autocomplete"
                 autocompletesearch="history" 
                 autocompletepopup="PopupAutoComplete"
                 completeselectedindex="true"
                 tabscrolling="true"
                 showcommentcolumn="true"
                 enablehistory="true"
                 oninput="gBrowser.userTypedValue = this.value"
                 ontextentered="return handleURLBarCommand(param);"
                 ontextreverted="return handleURLBarRevert();"
                 onfocus="URLBarFocusHandler(event, this);"
                 onmousedown="URLBarMouseDownHandler(event, this);"
                 onclick="URLBarClickHandler(event, this);">
          <deck id="page-proxy-deck" onclick="PageProxyClickHandler(event);">
            <image id="page-proxy-button"
                    ondraggesture="PageProxyDragGesture(event);"
                    tooltiptext="&proxyIcon.tooltip;"/>
            <image id="page-proxy-favicon"
                    ondraggesture="PageProxyDragGesture(event);"
                    onload="this.parentNode.selectedIndex = 1;
                            event.stopPropagation();
                            event.preventBubble();"
                    onerror="gBrowser.addToMissedIconCache(this.src);
                             this.removeAttribute('src');
                             this.parentNode.selectedIndex = 0;"
                    tooltiptext="&proxyIcon.tooltip;"/>
          </deck>
          <hbox>
            <button type="menu" style="-moz-user-focus: none" class="plain" id="feed-button" chromedir="&locale.dir;">
              <menupopup onpopupshowing="return FeedHandler.buildFeedList(event);" position="after_end"
                         oncommand="FeedHandler.addLiveBookmark(event.target.getAttribute('feed'));" />
            </button>
            <image id="lock-icon" onclick="displaySecurityInfo()"/>
          </hbox>
        </textbox>
      </toolbaritem>

      <toolbaritem id="search-container" title="&searchItem.title;" 
                   align="center" class="chromeclass-toolbar-additional">
        <searchbar id="searchbar"/>
      </toolbaritem>
      
      <toolbaritem id="go-container" align="center" class="chromeclass-toolbar-additional">
        <toolbarbutton id="go-button"
                       chromedir="&locale.dir;"
                       label="&goButton.label;"
                       oncommand="handleURLBarCommand(event);"
                       ondragover="nsDragAndDrop.dragOver(event, goButtonObserver);"
                       ondragdrop="nsDragAndDrop.drop(event, goButtonObserver);"
                       ondragexit="nsDragAndDrop.dragExit(event, goButtonObserver);"
                       tooltiptext="&goButton.tooltip;"/> 
      </toolbaritem>
      
      <toolbarbutton id="print-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                     label="&printButton.label;" command="cmd_print"
                     tooltiptext="&printButton.tooltip;"/>

      <toolbaritem id="throbber-box" title="&throbberItem.title;" align="center" pack="center">
        <button id="navigator-throbber" 
                oncommand="goClickThrobber('browser.throbber.url', event)"
                onclick="checkForMiddleClick(this, event);"
                tooltiptext="&throbber.tooltip;"/>
      </toolbaritem>
      
      <toolbaritem id="personal-bookmarks" title="&bookmarksItem.title;" flex="1"
                   class="chromeclass-directories">
        <stack id="bookmarks-stack" flex="1" style="min-width:0px; width:0px;"
               onpopupshowing="BookmarksToolbar.setOpenedMenu(event);"
               onpopuphidden="BookmarksToolbar.unsetOpenedMenu(event);">
          <hbox id="bookmarks-ptf" class="bookmarks-toolbar-items" contextmenu="bookmarks-context-menu"
                flex="1" style="min-width:0px; width:0px;padding-left: 3px;" 
                datasources="rdf:bookmarks rdf:files rdf:localsearch"
                template="bookmarks-template" flags="dont-test-empty"
                infer="forward-proxy"
                rdf:type="http://home.netscape.com/NC-rdf#Folder"
                onpopupshowing="BookmarksMenu.onShowMenu(event.target)"
                onpopuphidden="BookmarksMenu.onHideMenu(event.target)"
                oncommand="BookmarksMenu.loadBookmark(event, event.target, this.database)"
                onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
                ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
                ondragdrop="nsDragAndDrop.drop(event, BookmarksMenuDNDObserver); event.preventBubble()"
                ondragenter="nsDragAndDrop.dragEnter(event, BookmarksMenuDNDObserver); event.preventBubble()"
                ondragexit="nsDragAndDrop.dragExit(event, BookmarksMenuDNDObserver); event.preventBubble()"
                ondragover="nsDragAndDrop.dragOver(event, BookmarksMenuDNDObserver); event.preventBubble()">
          </hbox>
          <hbox class="bookmarks-toolbar-overflow-items" mousethrough="always">
            <hbox mousethrough="always" id="overflow-padder"/>
              <toolbarbutton id="bookmarks-chevron" type="menu" class="chevron"
                             chromedir="&locale.dir;"
                             mousethrough="never" collapsed="true" 
                             datasources="rdf:bookmarks rdf:files rdf:localsearch"
                             template="bookmarks-template" flags="dont-test-empty"
                             onpopupshowing="BookmarksMenu.onShowMenu(event.target)"
                             onpopuphidden="BookmarksMenu.onHideMenu(event.target)"
                             oncommand="BookmarksMenu.loadBookmark(event, event.target, this.database)"
                             onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
                             ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
                             ondragdrop="nsDragAndDrop.drop(event, BookmarksMenuDNDObserver); event.preventBubble()"
                             ondragenter="nsDragAndDrop.dragEnter(event, BookmarksMenuDNDObserver); event.preventBubble()"
                             ondragexit="nsDragAndDrop.dragExit(event, BookmarksMenuDNDObserver); event.preventBubble()"
                             ondragover="nsDragAndDrop.dragOver(event, BookmarksMenuDNDObserver); event.preventBubble()">
                <menupopup onpopupshowing="if (event.target == this) BookmarksToolbar.updateOverflowMenu(this);"
                           contextmenu="bookmarks-context-menu"
                           />
              </toolbarbutton>
            </hbox>
            <toolbarbutton class="bookmark-item bookmarks-toolbar-customize" mousethrough="never"
                           label="&bookmarksToolbarItem.label;"/>
          </stack>
        </toolbaritem>

        <toolbarbutton id="downloads-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                       observes="Tools:Downloads"
                       ondragdrop="nsDragAndDrop.drop(event, DownloadsButtonDNDObserver); event.preventBubble()"
                       ondragover="nsDragAndDrop.dragOver(event, DownloadsButtonDNDObserver); event.preventBubble()"
                       ondragenter="nsDragAndDrop.dragEnter(event, DownloadsButtonDNDObserver); event.preventBubble()"
                       ondragexit="nsDragAndDrop.dragExit(event, DownloadsButtonDNDObserver); event.preventBubble()"
                       label="&downloads.label;"
                       tooltiptext="&downloads.tooltip;"/>

        <toolbarbutton id="history-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                       observes="viewHistorySidebar"
                       tooltiptext="&historyButton.tooltip;"/>

        <toolbarbutton id="mail-button" type="menu" class="toolbarbutton-1 chromeclass-toolbar-additional"
                       label="&mailButton.label;" orient="vertical"
                       onmouseover="MailIntegration.updateUnreadCount();"
                       tooltiptext="&mailButton.tooltip;">
          <menupopup tooltiptext="">
            <menuitem accesskey="&mailButton.readMail.accesskey;"
                      command="Browser:ReadMail"/>
            <menuitem label="&mailButton.newMessage.label;" 
                      accesskey="&mailButton.newMessage.accesskey;"
                      command="Browser:NewMessage"/>
          </menupopup>
        </toolbarbutton>                       

        <toolbarbutton id="bookmarks-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                       observes="viewBookmarksSidebar"
                       tooltiptext="&bookmarksButton.tooltip;"
                       ondragover="nsDragAndDrop.dragOver(event, bookmarksButtonObserver);"
                       ondragdrop="nsDragAndDrop.drop(event, bookmarksButtonObserver);"
                       ondragexit="nsDragAndDrop.dragExit(event, bookmarksButtonObserver);"/>

        <toolbarbutton id="new-tab-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                       label="&tabCmd.label;"
                       command="cmd_newNavigatorTab"
                       tooltiptext="&newTabButton.tooltip;"
                       ondragover="nsDragAndDrop.dragOver(event, newTabButtonObserver);"
                       ondragdrop="nsDragAndDrop.drop(event, newTabButtonObserver);"
                       ondragexit="nsDragAndDrop.dragExit(event, newTabButtonObserver);"/>         

        <toolbarbutton id="new-window-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                       label="&newNavigatorCmd.label;"
                       command="key_newNavigator"
                       tooltiptext="&newWindowButton.tooltip;"
                       ondragover="nsDragAndDrop.dragOver(event, newWindowButtonObserver);"
                       ondragdrop="nsDragAndDrop.drop(event, newWindowButtonObserver);"
                       ondragexit="nsDragAndDrop.dragExit(event, newWindowButtonObserver);"/>

        <toolbarbutton id="cut-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                       label="&cutCmd.label;"
                       command="cmd_cut"
                       tooltiptext="&cutButton.tooltip;"/>

        <toolbarbutton id="copy-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                       label="&copyCmd.label;"
                       command="cmd_copy"
                       tooltiptext="&copyButton.tooltip;"/>

        <toolbarbutton id="paste-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                       label="&pasteCmd.label;"
                       command="cmd_paste"
                       tooltiptext="&pasteButton.tooltip;"/>

    </toolbarpalette>

    <toolbar id="nav-bar" class="toolbar-primary chromeclass-toolbar"
             toolbarname="&navbarCmd.label;" accesskey="&navbarCmd.accesskey;"
             fullscreentoolbar="true" mode="icons" 
             customizable="true"
             defaultset="back-button,forward-button,reload-button,stop-button,home-button,urlbar-container,go-container,search-container,fullscreenflex,window-controls"
             context="toolbar-context-menu">
      <hbox id="fullscreenflex" flex="1" hidden="true" fullscreencontrol="true"/>
      <hbox id="window-controls" hidden="true" fullscreencontrol="true">
        <toolbarbutton id="minimize-button" class="toolbarbutton-1"
                       tooltiptext="&fullScreenMinimize.tooltip;"
                       oncommand="window.minimize();"/>

        <toolbarbutton id="restore-button" class="toolbarbutton-1"
                       tooltiptext="&fullScreenRestore.tooltip;"
                       oncommand="BrowserFullScreen();"/>

        <toolbarbutton id="close-button" class="toolbarbutton-1"
                       tooltiptext="&fullScreenClose.tooltip;"
                       oncommand="BrowserTryToCloseWindow();"/>
      </hbox>
    </toolbar>
 
    <toolbarset id="customToolbars" context="toolbar-context-menu"/>

    <toolbar id="PersonalToolbar" class="chromeclass-directories" iconsize="small"
             customizable="true" defaultset="personal-bookmarks" mode="icons"
             toolbarname="&personalbarCmd.label;" accesskey="&personalbarCmd.accesskey;"
             context="toolbar-context-menu"/>   
  </toolbox>
  
  <hbox flex="1" id="browser">
    <vbox id="sidebar-box" hidden="true" class="chromeclass-extrachrome">
      <sidebarheader align="center">
        <label id="sidebar-title" persist="value" flex="1" crop="end"/>
        <image id="sidebar-throbber"/>
        <toolbarbutton class="tabs-closebutton" tooltiptext="&sidebarCloseButton.tooltip;" oncommand="toggleSidebar();"/>
      </sidebarheader>        
      <browser id="sidebar" flex="1" autoscroll="false"
               style="min-width: 150px; width: 200px; max-width: 400px;"/>
    </vbox>    
    
    <splitter id="sidebar-splitter" class="chromeclass-extrachrome" hidden="true"/>
    <vbox id="appcontent" flex="1">
      <tabbrowser id="content" disablehistory="true"
                  flex="1" contenttooltip="aHTMLTooltip"
                  contentcontextmenu="contentAreaContextMenu"
                  onnewtab="BrowserOpenTab();"
                  autocompletepopup="PopupAutoComplete"
                  ondragdrop="nsDragAndDrop.drop(event, contentAreaDNDObserver);"
                  onclick="return contentAreaClick(event, false);"/>
    </vbox>
  </hbox>
  
    <toolbar id="FindToolbar" hidden="true" align="center" fullscreentoolbar="true">
      <toolbarbutton id="find-closebutton" tooltiptext="&findCloseButton.tooltip;"
                     oncommand="closeFindBar();"/>

      <label control="find-field" value="&find.label;"/>
      <hbox id="find-field-container">
        <textbox id="find-field" oninput="find(this.value);"
                onkeypress="onFindBarKeyPress(event);" onblur="onFindBarBlur();"
                oncompositionstart="onFindBarCompositionStart(event);"
                oncompositionend="onFindBarCompositionEnd(event);"/>
      </hbox>
      <toolbarbutton id="find-next" label="&findNext.label;" tooltiptext="&findNext.tooltip;"
                     command="cmd_findAgain" disabled="true" accesskey="&findNext.accesskey;"/>
      <toolbarbutton id="find-previous" label="&findPrevious.label;" tooltiptext="&findPrevious.tooltip;"
                     command="cmd_findPrevious" disabled="true" accesskey="&findPrevious.accesskey;"/>
      <toolbarbutton id="highlight"
                     label="&highlight.label;"
                     tooltiptext="&highlight.tooltip;"
                     oncommand="toggleHighlight(!this.checked);
                                if (gFindMode != FIND_NORMAL) setFindCloseTimeout();"
                     type="checkbox" disabled="true"
                     accesskey="&highlight.accesskey;"/>
      <checkbox id="find-case-sensitive" oncommand="toggleCaseSensitivity(this.checked);"
                label="&caseSensitiveCheckbox.label;" accesskey="&caseSensitiveCheckbox.accesskey;"/>
      <image id="find-status-icon"/>
      <label id="find-status"/>
    </toolbar>

  
  <statusbar class="chromeclass-status" id="status-bar"
             ondragdrop="nsDragAndDrop.drop(event, contentAreaDNDObserver);">
    <statusbarpanel id="statusbar-display" flex="1"/>
    <statusbarpanel class="statusbarpanel-progress" collapsed="true" id="statusbar-progresspanel">
      <progressmeter class="progressmeter-statusbar" id="statusbar-icon" mode="normal" value="0"/>
    </statusbarpanel>
    <statusbarpanel id="security-button" class="statusbarpanel-iconic-text"
                    ondblclick="if (event.button == 0) displaySecurityInfo();"/>
    <statusbarpanel id="page-report-button" type="menu" 
                    class="statusbarpanel-menu-iconic" 
                    tooltiptext="&pageReportIcon.tooltip;">
      <menupopup onpopupshowing="gPopupBlockerObserver.fillPopupList(event);">
        <menuitem observes="blockedPopupAllowSite"/>
        <menuitem observes="blockedPopupEditSettings"/>
        <menuitem observes="blockedPopupDontShowMessage"/>
        <menuseparator observes="blockedPopupsSeparator"/>
      </menupopup>
    </statusbarpanel>
  </statusbar>
</window>
  
