<?xml version="1.0"?>
<!DOCTYPE overlay SYSTEM "chrome://kmprefs/locale/pref-kbookmarks.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
	<script type="application/x-javascript">
<![CDATA[
var kBooklistManager = {
	_base : null,
	_pref : null,
	_ctrl : null,
	plug : null,
	init : function (plugin) {
		this.plug = plugin;
		if (kPlugin.absent(plugin)) {
			var node = document.getElementById("kBooklistManag");
			node.parentNode.removeChild(node);
			node = document.getElementById("kBooklistManagTab");
			node.parentNode.removeChild(node);
		} else {
			this._base = "kmeleon.plugins." + plugin + ".editdialog.";
			this._pref = new Array("maximized",
					"zoom");
			this._ctrl = new Array("height",
					"left",
					"top",
					"width");
			this._initTags(this._pref, "Check");
			this._initTags(this._ctrl, "Text");
			this._setControls();
		}
	},
	center : function () {
		var val = new Array();
		for (var j = 0; j < this._ctrl.length; j++)
			val[val.length] = pref.getIntPref(this._base + this._ctrl[j]);
		pref.setIntPref(this._base + this._ctrl[1], Math.floor((screen.width - val[3]) / 2));
		initTextbox(this._base + this._ctrl[1], false);
		pref.setIntPref(this._base + this._ctrl[2], Math.floor((screen.height - val[0]) / 2));
		initTextbox(this._base + this._ctrl[2], false);
	},
	_initTags : function (prefArray, boxName) {
		for (var j = 0, e; j < prefArray.length; j++) {
			e = document.getElementById(prefArray[j]);
			e.id = this._base + e.id;
			eval("init" + boxName + "box(e.id,false)");
		}
	},
	_setControls : function () {
		var dis = kPlugin.load(this.plug) ? document.getElementById(this._base + this._pref[0]).checked : true;
		for (var j = 0; j < this._ctrl.length; j++)
			document.getElementById(this._base + this._ctrl[j]).disabled = dis;
		document.getElementById("kBooklistManag0").disabled = dis;
	}
};
//addEventListener("load",kBooklistManager.init,true);
]]>
	</script>
	<tabpanel id="kBooklistManag" flex="1" orient="vertical" style="overflow:auto">
		<separator class="thin"/>
		<checkbox oncommand="toggleCheckbox(this.id)" id="zoom" label="&manager.hide;" disabled="true"/>
		<separator class="thick"/>
		<hbox>
			<groupbox flex="1">
				<caption>
					<label>&window.size;</label>
				</caption>
				<separator class="thin"/>
				<grid>
					<columns>
						<column/>
						<column/>
						<column/>
					</columns>
					<rows>
						<row align="center">
							<label value="&width;"/>
							<textbox id="width" size="4" class="uri-element" oninput="setIntPref(this.id,this.value)" disabled="true"/>
							<label value="&pixels;"/>
						</row>
						<row align="center">
							<label value="&height;"/>
							<textbox id="height" size="4" class="uri-element" oninput="setIntPref(this.id,this.value)" disabled="true"/>
							<label value="&pixels;"/>
						</row>
					</rows>
				</grid>
				<separator class="thin"/>
				<checkbox oncommand="toggleCheckbox(this.id);kBooklistManager._setControls()" id="maximized" label="&maximized;" disabled="true"/>
				<separator class="thin"/>
			</groupbox>
			<groupbox flex="1">
				<caption>
					<label>&window.position;</label>
				</caption>
				<separator class="thin"/>
				<grid>
					<columns>
						<column/>
						<column/>
						<column/>
					</columns>
					<rows>
						<row align="center">
							<label value="&left;"/>
							<textbox id="left" size="4" class="uri-element" oninput="setIntPref(this.id,this.value)" disabled="true"/>
							<label value="&pixels;"/>
						</row>
						<row align="center">
							<label value="&top;"/>
							<textbox id="top" size="4" class="uri-element" oninput="setIntPref(this.id,this.value)" disabled="true"/>
							<label value="&pixels;"/>
						</row>
					</rows>
				</grid>
				<separator class="thin"/>
				<hbox>
					<button id="kBooklistManag0" label="&center;" oncommand="kBooklistManager.center()"/>
					<hbox flex="1"/>
				</hbox>
			</groupbox>
		</hbox>
	</tabpanel>
	<tab id="kBooklistManagTab"/>
</overlay>