<?xml version="1.0"?>
<?xml-stylesheet href="chrome://stylish/skin/overlay.css" type="text/css"?>

<!DOCTYPE overlay [
	<!ENTITY % common SYSTEM "chrome://stylish/locale/common.dtd">
	<!ENTITY % branding SYSTEM "chrome://stylish/content/branding.dtd">
	<!ENTITY % overlay SYSTEM "chrome://stylish/locale/overlay.dtd">
	%common;
	%branding;
	%overlay;
]>

<overlay id="stylish-overlay"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

	<script type="application/javascript" src="rdfds.js"/>
	<script type="application/javascript" src="common.js"/>
	<script type="application/javascript" src="StylishStyle.js"/>
	<script type="application/javascript" src="commonOverlay.js"/>
	<script type="application/javascript" src="browserOverlay.js"/>
	<script type="application/javascript" src="seamonkeyCompat.js"/>

	<keyset id="mainKeyset">
		<key id="stylish-open-manage"/>
		<key id="stylish-view-sidebar"/>
	</keyset>

	<keyset id="navKeys">
		<key id="stylish-open-manage"/>
		<key id="stylish-view-sidebar"/>
	</keyset>

	<key id="stylish-open-manage" modifiers="control" key="M" oncommand="stylishCommonOverlay.openManageStyles()"/>
	<key id="stylish-view-sidebar" modifiers="control,shift" key="M" command="viewStylishSidebar"/>

	<toolbarpalette id="BrowserToolbarPalette">
		<toolbarbutton id="stylish-toolbar-button" label="&stylish;" tooltiptext="&stylish;" orient="vertical" class="toolbarbutton-1" type="menu">
			<menupopup id="stylish-toolbar-popup" onpopupshowing="stylishBrowserOverlay.mainPopupShowing(event)" onpopuphiding="stylishCommonOverlay.clearMenu(event)"/>
		</toolbarbutton>
	</toolbarpalette>

	<!-- Firefox and Flock Tools menu -->
	<menupopup id="menu_ToolsPopup">
		<menu id="stylish-tools-menu" label="&stylish;" insertbefore="devToolsSeparator">
			<menupopup id="stylish-tools-menu-popup" onpopupshowing="stylishBrowserOverlay.mainPopupShowing(event)" onpopuphiding="stylishCommonOverlay.clearMenu(event)"/>
		</menu>
	</menupopup>

	<!-- SeaMonkey Tools menu -->
	<menupopup id="toolsPopup">
		<menu id="stylish-seamonkey-tools-menu" label="&stylish;">
			<menupopup id="stylish-tools-menu-popup" onpopupshowing="stylishBrowserOverlay.mainPopupShowing(event)" onpopuphiding="stylishCommonOverlay.clearMenu(event)"/>
		</menu>
	</menupopup>

	<statusbar id="status-bar">
		<stringbundle id="stylish-strings" src="chrome://stylish/locale/stylish.properties"/>
		<stringbundle id="stylish-url-strings" src="chrome://stylish/content/urls.properties"/>
		<statusbarpanel id="stylish-panel" src="chrome://stylish/skin/smallicon.png" class="statusbarpanel-menu-iconic" tooltiptext="&stylish;" onclick="stylishCommonOverlay.handleStatusClick(event)">
			<menupopup id="stylish-status-popup" onpopupshowing="stylishBrowserOverlay.mainPopupShowing(event)" onpopuphiding="stylishBrowserOverlay.clearStyleMenuItems(event)">
				<menuitem label="&stylish.manageSites;" accesskey="&stylish.manageSites.ak;" oncommand="stylishCommonOverlay.openManageStyles()"/>
				<menuitem id="stylish-add-file" label="&stylish.addfile;" accesskey="&stylish.addfile.ak;" oncommand="stylishBrowserOverlay.addFile()"/>
				<menuitem label="&stylish.findStyleBrowser;" accesskey="&stylish.findStyleBrowser.ak;" oncommand="stylishBrowserOverlay.findStyle(event)" onclick="checkForMiddleClick(this, event)"/>
				<menu id="stylish-write-style-menu" label="&stylish.writeStyle;" accesskey="&stylish.writeStyle.ak;">
					<menupopup onpopupshowing="stylishBrowserOverlay.writeStylePopupShowing(event)" onpopuphiding="stylishCommonOverlay.clearMenu(event)"/>
				</menu>
				<menuseparator/>
				<menu id="stylish-global-styles" label="&stylish.globalStyles;" accesskey="&stylish.globalStyles.ak;">
					<menupopup onpopupshowing="stylishBrowserOverlay.showGlobalStyles(event)" onpopuphiding="stylishBrowserOverlay.clearStyleMenuItems(event)"/>
				</menu>
			</menupopup>
		</statusbarpanel>
	</statusbar>

	<broadcasterset id="mainBroadcasterSet">
		<broadcaster id="viewStylishSidebar" autoCheck="false" label="&stylish;" type="checkbox" group="sidebar" sidebarurl="chrome://stylish/content/manage.xul?sidebar=1" sidebartitle="&stylish;" oncommand="stylishBrowserOverlay.openSidebar();"/>
	</broadcasterset>

	<menupopup id="viewSidebarMenu">
		<menuitem key="stylish-view-sidebar" observes="viewStylishSidebar"/>
	</menupopup>

</overlay>
