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

<!DOCTYPE overlay SYSTEM "chrome://gproxy/locale/locale.dtd" >

<overlay id="gproxyOverlay"
			title="GProxy Overlay"
			xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
	
	<script type="application/x-javascript" src="chrome://gproxy/content/globals.js"></script>
	<script type="application/x-javascript" src="chrome://gproxy/content/datasource.js"></script>
	<script type="application/x-javascript" src="chrome://gproxy/content/tabmanager.js"></script>
	<script type="application/x-javascript" src="chrome://gproxy/content/proxy.js"></script>
	<script language="JavaScript">
		//Window Event Handers
		try{window.addEventListener("load", gproxy_initProxy, true);}catch(e){}
		//try{window.addEventListener("focus", gproxy_tab_windowFocus, true);}catch(e){}
	</script>
	
	<!-- Toolbar -->
	<toolbox id="navigator-toolbox" context="toolbar-context-menu">
		<toolbar id="proxy-toolbar"
					accesskey="&toolbar.name.key;"
					context="toolbar-context-menu" 
					customizable="true" 
					iconsize="small" 
					mode="full"
					collapsed="false" persist="collapsed"
					toolbarname="&toolbar.name.label;"
					class="chromeclass">
			
			<hbox align="center" flex="2">
				<label value="&toolbar.proxy.label;" style="margin-right: 0;" />
				
				<menulist id="proxy-list" popup="proxy-list-popup">	
					<menupopup id="proxy-list-popup" position="after_start">
						<menuitem value="" label="&common.none;" oncommand="gproxy_selectProxy(this)" />
					</menupopup>
				</menulist>						
				
				<toolbarbutton id="apply-button" label="&common.apply.label;" default="true" onclick="gproxy_setProxy(true)" image="chrome://gproxy/content/icons/check.png" tooltiptext="&common.apply.tip;" />				
				<spacer width="25" />	
				
				<groupbox orient="horizontal" style="padding: 1px;">
					<description id="status-label" value="&toolbar.status;" style="font-weight: bold;" />
					<description id="status-text" value="&toolbar.using.none;" />
				</groupbox>
				
				<spacer width="25" />	
				<toolbarbutton id="options-list" label="&common.manage.label;" onclick="gproxy_openProxyManager();" image="chrome://gproxy/content/icons/isp.png" />				
				<spacer width="12" />	
				<toolbarbutton id="options-list" label="&common.preferences.label;" onclick="gproxy_opengproxyPrefs();" image="chrome://gproxy/content/icons/options.png" />
			</hbox>
		</toolbar>
	</toolbox>
	
	<!-- Toolbar Element -->
	<toolbarpalette id="BrowserToolbarPalette">
		<toolbaritem id="gproxy-container" title="&common.product.name;" align="center">
			<button id="gproxy-element-button" tooltiptext="&toolelement.tip;" label="" popup="gproxy-element-list" 
					image="chrome://gproxy/content/icons/arrow-dn.gif" dir="rtl" />
		</toolbaritem>
	</toolbarpalette>
	
	<!-- Statusbar  -->
	<statusbar id="status-bar" class="chromeclass-status">
	    <statusbarpanel id="gproxy-status"
						insertbefore="statusbar-updates"
						label="" collapsed="false"
						context="gproxy-element-list"
						tooltiptext="&common.product.name;" />
	    <statusbarpanel id="gproxy-status-image"
						insertbefore="gproxy-status"
						class="statusbarpanel-menu-iconic"
						src="chrome://gproxy/content/icons/gproxy.png"
						context="gproxy-element-list"
						popup="gproxy-element-list"
						tooltiptext="&common.product.name;" />
	</statusbar>
	
	<!-- Firefox Tools Menu -->
	<menupopup id="menu_ToolsPopup">
		<menu id="gproxy-tools-menu" label="&common.product.name;" 
				accesskey="P" class="menuitem-iconic"
				insertafter="devToolsSeparator">
			<menupopup id="gproxy-menu-list" position="after_start" onpopupshowing="gproxy_showElementList(event);">
				<menuitem label="&common.none;" type="checkbox" checked="true" oncommand="gproxy_queueSetProxy(this);" class="proxy-menu-item"/>				
				<menuseparator id="gproxy-menu-list-separator" />
				<menuitem label="&common.manage.label;" accesskey="&common.manage.key;" oncommand="gproxy_openProxyManager();" />
				<menuseparator />
				<menuitem image="chrome://gproxy/content/icons/options.png" label="&common.preferences.label;" accesskey="&common.preferences.key;" oncommand="gproxy_opengproxyPrefs();" />

				<menuitem label="&common.about.label;" accesskey="&common.about.key;" oncommand="gproxy_goTogproxyAbout()" />
			</menupopup>
		</menu>
	</menupopup>
	
	<!-- Context Menu -->
	<popup id="contentAreaContextMenu">
		<menuseparator id="gproxy-context-separator"/>
		<menu label="&context.label;" id="gproxy-context-menu" accesskey="&context.key;">
			<menupopup id="gproxy-context-menu-popup;" onpopupshowing="gproxy_showElementList(event);">
				<menu label="&context.proxies.label;" accesskey="&context.proxies.key;" id="gproxy-context-proxylist">
					<menupopup id="context-proxy-list">
						<menuitem label="&common.none;" type="checkbox" checked="true" oncommand="gproxy_setProxy(true, true);" />
					</menupopup>
				</menu>
				<menuseparator />
				<menuitem label="&common.manage.label;" accesskey="&common.manage.key;" oncommand="gproxy_openProxyManager();" />
				<menuseparator />
				<menuitem label="&common.preferences.label;" accesskey="&common.preferences.key;" oncommand="gproxy_opengproxyPrefs();" />
			
				<menuitem label="&common.about.label;" accesskey="&common.about.key;" oncommand="gproxy_goTogproxyAbout()" />
			</menupopup>
		</menu>
	</popup>
	
	<!-- Popups -->
	<popupset id="mainPopupSet">
		<popup id="gproxy-element-list" position="after_start" onpopupshowing="gproxy_showElementList(event);">
			<menuitem label="&common.none;" type="checkbox" checked="true" oncommand="gproxy_queueSetProxy(this);" class="proxy-menu-item"/>				
			<menuseparator id="gproxy-element-list-separator" />
			<menuitem label="&common.manage.label;" accesskey="&common.manage.key;" oncommand="gproxy_openProxyManager();" />
			<menuseparator />
			<menuitem label="&common.preferences.label;" accesskey="&common.preferences.key;" oncommand="gproxy_opengproxyPrefs();" />
		
			<menuitem label="&common.about.label;" accesskey="&common.about.key;" oncommand="gproxy_goTogproxyAbout()" />
		</popup>
	</popupset>
</overlay>