<?xml version="1.0"?> 
<!DOCTYPE overlay SYSTEM "chrome://dustmeselectors/locale/dustmeselectors.dtd">

<overlay id="dms-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 
	
	<script type="application/x-javascript" src="chrome://dustmeselectors/content/base2.js"/>
	<script type="application/x-javascript" src="chrome://dustmeselectors/content/tools.js"/>
	<script type="application/x-javascript" src="chrome://dustmeselectors/content/filesystem.js"/>
	<script type="application/x-javascript" src="chrome://dustmeselectors/content/preferences.js"/>
	<script type="application/x-javascript" src="chrome://dustmeselectors/content/dustmeselectors.js"/>
	<script type="application/x-javascript" src="chrome://dustmeselectors/content/browser.js"/>

	<menupopup id="menu_ToolsPopup"> 
		<stringbundleset>
			<stringbundle id="dms-bundle" src="chrome://dustmeselectors/locale/dustmeselectors.properties"/>		
		</stringbundleset>
		<keyset>
			<key id="dms-findkey" key="&dms.menu.accesskey.find;" modifiers="alt accel"/>
			<key id="dms-spiderkey" key="&dms.menu.accesskey.spider;" modifiers="alt accel"/>
		</keyset>
		<menu id="dms-mainmenu" label="&dms.title;" accesskey="&dms.menu.accesskey.title;" 
			insertbefore="sanitizeSeparator"  
			style="list-style-image:url(chrome://dustmeselectors/content/statusicon_default.png);">
			<menupopup id="dms-mainmenupopup" style="list-style-image:none;">
				<menuitem id="dms-mainmenu-find" label="&dms.menu.find;" 
					key="dms-findkey" accesskey="&dms.menu.accesskey.find;" 
					oncommand="DustMeSelectors_browser.findRedundentSelectors();"/>
				<menuitem id="dms-mainmenu-stop" label="&dms.menu.stop;"
					disabled="true" accesskey="&dms.menu.accesskey.stop;" 
					oncommand="DustMeSelectors_browser.stop();"/>
				<menuseparator/>
				<menu id="dms-mainmenu-automationmenu" label="&dms.menu.automation;" 
					accesskey="&dms.menu.accesskey.autorun;">
					<menupopup>
						<menuitem id="dms-mainmenu-autorun" label="&dms.menu.autorun;" 
							type="checkbox" autocheck="false" 
							accesskey="&dms.menu.accesskey.autorun;" 
							oncommand="DustMeSelectors_browser.setAutorunPreference(this);"/>
					<menuitem id="dms-mainmenu-sitemap" label="&dms.menu.sitemap;" 
						key="dms-spiderkey" accesskey="&dms.menu.accesskey.spider;" 
						oncommand="DustMeSelectors_browser.openSpiderDialog();"/>
					</menupopup>
				</menu>
				<menuseparator/>
				<menuitem label="&dms.menu.view;" id="dms-mainmenu-view" 
					accesskey="&dms.menu.accesskey.view;" 
					oncommand="DustMeSelectors_browser.viewSavedSelectors(null, true, true);"/>
				<menu id="dms-mainmenu-clearmenu" label="&dms.menu.clear;" 
					accesskey="&dms.menu.accesskey.clear;">
					<menupopup>
						<menuitem label="&dms.menu.thishost;" id="dms-mainmenu-clear" 
							accesskey="&dms.menu.accesskey.thishost;" 
							oncommand="DustMeSelectors_browser.clearSavedSelectors();"/>
						<menuitem label="&dms.menu.allhosts;" id="dms-mainmenu-clearall" 
							accesskey="&dms.menu.accesskey.allhosts;" 
							oncommand="DustMeSelectors_browser.clearAllSavedSelectors();"/>
					</menupopup>
				</menu>
				<menuseparator/>
				<menuitem id="dms-mainmenu-disable" label="&dms.menu.disable;" 
					accesskey="&dms.menu.accesskey.disable;" type="checkbox" 
					oncommand="DustMeSelectors_browser.setDisabledPreference(true);"/>
				<menuitem id="dms-mainmenu-preferences" label="&dms.menu.preferences;" accesskey="&dms.menu.accesskey.preferences;" 
					oncommand="DustMeSelectors_browser.openPreferencesDialog();"/>
			</menupopup>
		</menu>
	</menupopup> 

    <statusbar id="status-bar">
        <statusbarpanel insertafter="statusbar-progresspanel" id="dms-statusoverlay" hidden="true">
        	<label id="dms-statuslabel" context="dms-statuspopup" hidden="true"/>
            <image id="dms-statusicon" width="16" height="16" style="cursor:pointer;" 
            	src="chrome://dustmeselectors/content/statusicon_default.png"
            	tooltiptext="&dms.menu.find;"
            	onclick="if(!event.button) { 
            		if(!DustMeSelectors.running) { DustMeSelectors_browser.findRedundentSelectors(); } 
            		else { DustMeSelectors_browser.stop(); } }"
            	context="dms-statuspopup"/>
            <popup id="dms-statuspopup">
				<menuitem id="dms-statuspopup-find" label="&dms.menu.find;" 
					key="dms-findkey" accesskey="&dms.menu.accesskey.find;" 
					oncommand="DustMeSelectors_browser.findRedundentSelectors();"/>
				<menuitem id="dms-statuspopup-stop" label="&dms.menu.stop;" 
					disabled="true" accesskey="&dms.menu.accesskey.stop;" 
					oncommand="DustMeSelectors_browser.stop();"/>
				<menuseparator/>
				<menu id="dms-statuspopup-automationmenu" label="&dms.menu.automation;" 
					accesskey="&dms.menu.accesskey.autorun;">
					<menupopup>
						<menuitem id="dms-statuspopup-autorun" label="&dms.menu.autorun;" 
							type="checkbox" autocheck="false" 
							accesskey="&dms.menu.accesskey.autorun;" 
							oncommand="DustMeSelectors_browser.setAutorunPreference(this);"/>
						<menuitem id="dms-statuspopup-sitemap" label="&dms.menu.sitemap;" 
							key="dms-spiderkey" accesskey="&dms.menu.accesskey.spider;" 
							oncommand="DustMeSelectors_browser.openSpiderDialog();"/>
					</menupopup>
				</menu>
				<menuseparator/>
				<menuitem label="&dms.menu.view;" id="dms-statuspopup-view" 
					accesskey="&dms.menu.accesskey.view;" 
					oncommand="DustMeSelectors_browser.viewSavedSelectors(null, true, true);"/>
				<menu id="dms-statuspopup-clearmenu" label="&dms.menu.clear;" 
					accesskey="&dms.menu.accesskey.clear;">
					<menupopup>
						<menuitem label="&dms.menu.thishost;" id="dms-statuspopup-clear" 
							accesskey="&dms.menu.accesskey.thishost;" 
							oncommand="DustMeSelectors_browser.clearSavedSelectors();"/>
						<menuitem label="&dms.menu.allhosts;" id="dms-statuspopup-clearall" 
							accesskey="&dms.menu.accesskey.allhosts;" 
							oncommand="DustMeSelectors_browser.clearAllSavedSelectors();"/>
					</menupopup>
				</menu>
				<menuseparator/>
				<menuitem id="dms-statuspopup-disable" label="&dms.menu.disable;" 
					accesskey="&dms.menu.accesskey.disable;" type="checkbox" 
					oncommand="DustMeSelectors_browser.setDisabledPreference(true);"/>
				<menuitem id="dms-statuspopup-preferences" label="&dms.menu.preferences;" accesskey="&dms.menu.accesskey.preferences;" 
					oncommand="DustMeSelectors_browser.openPreferencesDialog();"/>
          </popup>
		</statusbarpanel>
	</statusbar>
	
</overlay>