[Pkg-mozext-commits] [all-in-one-sidebar] 01/06: Imported Upstream version 0.7.23

David Prévot taffit at moszumanska.debian.org
Fri Jul 18 16:28:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository all-in-one-sidebar.

commit 0cf5a05088f223f0b954ee4ab660326954bc615c
Author: David Prévot <taffit at debian.org>
Date:   Fri Jul 18 09:16:51 2014 -0400

    Imported Upstream version 0.7.23
---
 content/_helper.js           |  824 ++++++++++-----------
 content/_lib.js              | 1412 +++++++++++++++++------------------
 content/aios.js              |  188 ++---
 content/aios.xul             |   14 +-
 content/aios_fx.js           |  614 ++++++++--------
 content/aios_old.js          | 1630 ++++++++++++++++++++--------------------
 content/aios_tbx.js          |  644 ++++++++--------
 content/console.js           |  138 ++--
 content/multipanel.js        |  528 ++++++-------
 content/pageinfo.js          |  682 ++++++++---------
 content/prefs/_keyconfig.js  |  840 ++++++++++-----------
 content/prefs/_overlay.js    |  118 +--
 content/prefs/general.js     |  344 ++++-----
 content/prefs/keys.xul       |  154 ++--
 content/prefs/prefs.js       | 1376 +++++++++++++++++-----------------
 content/prefs/prefs.xul      | 1672 +++++++++++++++++++++---------------------
 defaults/preferences/aios.js |  214 +++---
 install.rdf                  |   58 +-
 license.txt                  |  678 ++++++++---------
 locale/hu-HU/aios.dtd        |    2 +-
 locale/it/aios.dtd           |    4 +-
 locale/pt-PT/about.dtd       |    4 +-
 locale/pt-PT/prefs.dtd       |    2 +-
 locale/ro/lib.properties     |    2 +-
 locale/ro/prefs.dtd          |   60 +-
 locale/ru/aios.dtd           |    2 +-
 locale/sr/aios.dtd           |   18 +-
 locale/tr/aios.dtd           |    2 +-
 locale/uk/aios.dtd           |    4 +-
 29 files changed, 6114 insertions(+), 6114 deletions(-)

diff --git a/content/_helper.js b/content/_helper.js
index 1579359..7f7e79d 100644
--- a/content/_helper.js
+++ b/content/_helper.js
@@ -1,413 +1,413 @@
-var AiOS_HELPER = {
-
-    init: function() {
-
-        this.prefInterface = Components.interfaces.nsIPrefBranch;
-        this.prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
-        this.prefBranch = this.prefService.getBranch(null);
-        this.prefBranchAiOS = this.prefService.getBranch("extensions.aios.");
-
-        this.windowWatcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher);
-        this.windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
-        this.mostRecentWindow = this.windowMediator.getMostRecentWindow('navigator:browser');
-
-        this.appInfo = Components.classes['@mozilla.org/xre/app-info;1'].getService(Components.interfaces.nsIXULAppInfo);
-        this.os = Components.classes['@mozilla.org/xre/app-info;1'].getService(Components.interfaces.nsIXULRuntime).OS;
-        this.osVersion = window.navigator.oscpu;
-        this.defTheme = (this.prefBranch.getCharPref('general.skins.selectedSkin') == "classic/1.0") ? true : false;
-
-    },
-
-    initOnDOMLoaded: function() {
-
-        AiOS_HELPER.aiosToolbar = document.getElementById('aios-toolbar');
-        AiOS_HELPER.sbhToolbar = document.getElementById('aios-sbhtoolbar');
-
-    },
-
-    rememberAppInfo: function(aObj) {
-
-        aObj.setAttribute('aios-appVendor', this.appInfo.vendor);
-        aObj.setAttribute('aios-appVersion', this.appInfo.version);
-        aObj.setAttribute('aios-appOS', this.os);
-        aObj.setAttribute('aios-appOSVersion', this.osVersion);
-        aObj.setAttribute('aios-appDefTheme', this.defTheme);
-
-    },
-
-    unload: function() {
-        window.removeEventListener("DOMContentLoaded", AiOS_HELPER.initOnDOMLoaded);
-        //window.removeEventListener("load", AiOS_HELPER.initOnLoad);
-        window.removeEventListener("unload", AiOS_HELPER.unload);
-    }
-
-};
-
-AiOS_HELPER.init();
-
-window.addEventListener("DOMContentLoaded", AiOS_HELPER.initOnDOMLoaded, false);
-//window.addEventListener("load", AiOS_HELPER.initOnLoad, false);
-window.addEventListener("unload", AiOS_HELPER.unload, false);
-
-
-
-// globale Variablen und Funktionen zur Ueberwachung auf Progress-Veraenderungen
-// Verwendung in pageInfo.xul
-var aios_ProgListStart = Components.interfaces.nsIWebProgressListener.STATE_START;
-var aios_ProgListStop = Components.interfaces.nsIWebProgressListener.STATE_STOP;
-
-var aiosProgListener = {
-    QueryInterface: function(aIID) {
-        if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
-            aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
-            aIID.equals(Components.interfaces.nsISupports))
-            return this;
-        throw Components.results.NS_NOINTERFACE;
-    },
-
-    onStateChange: function(aProgress, aRequest, aFlag, aStatus) {
-        //if(aFlag & aios_ProgListStart) { /* This fires when the load event is initiated */ }
-        //if(aFlag & aios_ProgListStop) { /* This fires when the load finishes */ }
-        if(aFlag & aios_ProgListStop) {
-            if(typeof aios_onStateChange == "function") aios_onStateChange();
-        }
-        return 0;
-    },
-
-    onLocationChange: function(aProgress, aRequest, aURI) {
-        // This fires when the location bar changes i.e load event is confirmed
-        // or when the user switches tabs
-        if(typeof aios_onLocationChange == "function") aios_onLocationChange();
-        return 0;
-    },
-
-    // For definitions of the remaining functions see XulPlanet.com
-    onProgressChange: function() {
-        return 0;
-    },
-    onStatusChange: function() {
-        return 0;
-    },
-    onSecurityChange: function() {
-        return 0;
-    },
-    onLinkIconAvailable: function() {
-        return 0;
-    }
-};
-
-
-/*
-    oeffnet ein neues Tab mit der uebergebenen Adresse im Vordergrund
-*/
-var aiosLastSelTab;     // wird fuer Page Info/MultiPanel im Tab benoetigt
-function aios_addTab(aUrl) {
-
-    var browser = AiOS_HELPER.mostRecentWindow.getBrowser();
-    aiosLastSelTab = AiOS_HELPER.mostRecentWindow.content;
-
-    var browserDoc;
-    var existTab = null;
-    var emptyTab = null;
-
-    // alle geoeffneten Tabs durchgehen
-    for(var i = 0; i < browser.tabContainer.childNodes.length; i++) {
-        browserDoc = browser.getBrowserAtIndex(i).contentWindow.document;
-        //alert(browser.getBrowserAtIndex(i).currentURI.spec);
-
-        var isPermaTab = (browser.tabContainer.childNodes[i].getAttribute('isPermaTab')) ? true : false;
-        //alert(isPermaTab);
-
-        /*var attribs = browser.tabContainer.childNodes[i].attributes;
-        //var attribs = browser.mCurrentTab.attributes;
-        for(var a = 0; a < attribs.length; a++) {
-            alert(attribs[a].name + ": " + attribs[a].value);
-        }*/
-
-        // wenn der Tab leer ist
-        if(browserDoc.location.href == "about:blank" && browser.selectedTab.getAttribute('openBy') != "aios" && !isPermaTab && emptyTab == null)
-            emptyTab = i;
-        // wenn der Tab schon existiert
-        if(browserDoc.location.href == aUrl && !isPermaTab && existTab == null)
-            existTab = i;
-    }
-
-    // wenn der Tab schon existiert
-    if(existTab != null) {
-        browser.selectedTab = browser.tabContainer.childNodes[existTab];
-        return browser.selectedTab;
-    }
-
-    // wenn der Tab leer ist
-    if(emptyTab != null) {
-        // URL oeffnen und Tab selektieren
-        browser.getBrowserAtIndex(emptyTab).contentWindow.document.location.href = aUrl;
-        browser.selectedTab = browser.tabContainer.childNodes[emptyTab];
-        browser.selectedTab.setAttribute('openBy', 'aios');
-        return browser.selectedTab;
-    }
-
-    // wenn kein leerer Tab vorhanden war, wird ein neuer geoeffnet
-    browser.selectedTab = browser.addTab(aUrl);
-    browser.selectedTab.setAttribute('openBy', 'aios');
-    return browser.selectedTab;
-}
-
-
-/*
-  fuegt dem Dokument dynamisch ein Stylesheet hinzu
-    => Aufruf u.a. durch aios_init() und aios_sidebarLayout() bei den Add-ons, Downloads
-*/
-function aios_addCSS(aURI, aBefore) {
-    var path = "chrome://aios/skin/css/";
-
-    var elem = (typeof aBefore == "object") ? aBefore : document.getElementById(aBefore);
-
-    var css = document.createProcessingInstruction("xml-stylesheet", 'href="' + path + aURI + '" type="text/css"');
-    document.insertBefore(css, elem);
-}
-
-
-/*
-    errechnet die Breite des Browsers exkl. der AIOS-Toolbar
-        => Aufruf durch aios_setSidebarDefWidth() in aios.js und aios_setSidebarWidth() in general.js
-*/
-function aios_getBrowserWidth() {
-    var cStyleSidebar = AiOS_HELPER.mostRecentWindow.document.defaultView.getComputedStyle(AiOS_HELPER.mostRecentWindow.document.getElementById('sidebar-box'), '');
-    var cStyleSplitter = AiOS_HELPER.mostRecentWindow.document.defaultView.getComputedStyle(AiOS_HELPER.mostRecentWindow.document.getElementById('sidebar-splitter'), '');
-    var cStyleContent = AiOS_HELPER.mostRecentWindow.document.defaultView.getComputedStyle(AiOS_HELPER.mostRecentWindow.document.getElementById('appcontent'), '');
-
-    var widthSidebar = parseInt(cStyleSidebar.width) + parseInt(cStyleSidebar.paddingLeft) + parseInt(cStyleSidebar.paddingRight) + parseInt(cStyleSidebar.marginLeft) + parseInt(cStyleSidebar.marginRight);
-
-    var widthSplitter = parseInt(cStyleSplitter.width) + parseInt(cStyleSplitter.paddingLeft) + parseInt(cStyleSplitter.paddingRight) + parseInt(cStyleSplitter.marginLeft) + parseInt(cStyleSplitter.marginRight);
-
-    var widthContent = parseInt(cStyleContent.width) + parseInt(cStyleContent.paddingLeft) + parseInt(cStyleContent.paddingRight) + parseInt(cStyleContent.marginLeft) + parseInt(cStyleContent.marginRight);
-
-    var compWidth = widthSidebar + widthSplitter + widthContent;
-
-    var ret_arr = new Array(widthSidebar, widthSplitter, widthContent, compWidth);
-    return(ret_arr);
-}
-
-
-/*
-    erweitert das Attribut "class" eines Elementes
-*/
-function aios_appendClass(elem, appClass) {
-    if(typeof elem == "string") elem = document.getElementById(elem);
-
-    var old_class = elem.getAttribute('class');
-    if(old_class.indexOf(appClass) < 0) elem.setAttribute('class', old_class + " " + appClass);
-}
-
-
-/*
-    loescht einen Klassennamen im Attribut "class" eines Elementes
-*/
-function aios_stripClass(elem, stripClass) {
-    if(typeof elem == "string") elem = document.getElementById(elem);
-
-    var old_class = elem.getAttribute('class');
-
-    if(old_class.indexOf(stripClass) >= 0) {
-        var pos = old_class.indexOf(stripClass);
-
-        var slice1 = old_class.substring(0, pos);
-        slice1 = slice1.replace(/ /, "");
-        var slice2 = old_class.substring(pos + stripClass.length, old_class.length);
-        slice2 = slice2.replace(/ /, "");
-
-        elem.setAttribute('class', slice1 + " " + slice2);
-    }
-
-}
-
-
-function aios_gElem(aID) {
-    if(AiOS_HELPER.mostRecentWindow && AiOS_HELPER.mostRecentWindow.document.getElementById(aID)) return AiOS_HELPER.mostRecentWindow.document.getElementById(aID);
-    return false;
-}
-
-
-/*
- *  ersetzt fuer MacOS X die Angaben zu Tastaturkuerzeln in den Tooltips
- *
- **/
-function aios_replaceKey(aElem, aAttr, aKey) {
-    var strings = document.getElementById("aiosProperties");
-
-    var rep_elem = document.getElementById(aElem);
-    var rep = rep_elem.getAttribute(aAttr);
-    rep = rep.substr(rep.indexOf('+'), rep.length);
-    rep_elem.setAttribute(aAttr, strings.getString('key.mac.' + aKey) + rep);
-}
-
-
-/*
-    gibt den boolschen Wert eines Wertes zurueck
-        => getAttribute(val) liefert nur "true" oder "false" als String
-*/
-function aios_getBoolean(aElem, aVal) {
-    var elem, bool;
-
-    if(typeof aElem == "object") {
-        elem = aElem;
-    }
-    else if(typeof aElem == "string" && document.getElementById(aElem)) {
-        elem = document.getElementById(aElem);
-    }
-
-    if(elem) {
-        if(typeof elem.getAttribute == "function") bool = elem.getAttribute(aVal);
-    }
-
-    if(bool == "true") return true;
-    else return false;
-}
-
-
-/*
-    Dialoge oeffnen
-*/
-function aios_openDialog(which, args) {
-    var theUrl, theId, theFeatures;
-    var theArgs = args;
-
-    switch(which) {
-        case "prefs":
-            theUrl = "chrome://aios/content/prefs/prefs.xul";
-            theId = "aiosPrefsDialog";
-            theFeatures = "chrome,titlebar,toolbar,centerscreen,";
-            theFeatures+= (AiOS_HELPER.os == "Darwin") ? "dialog=no" : "modal";
-            break;
-
-        case "about":
-            theUrl = "chrome://aios/content/about.xul";
-            theId = "aiosAboutDialog";
-            theFeatures = "chrome,modal";
-            break;
-
-        case "bookmarks":
-            theUrl = "chrome://browser/content/bookmarks/bookmarksPanel.xul";
-            theId = "aiosGlobal:Bookmarks";
-            theFeatures = "width=640,height=480,chrome,resizable,centerscreen";
-            break;
-
-        case "history":
-            theUrl = "chrome://browser/content/history/history-panel.xul";
-            theId = "aiosGlobal:History";
-            theFeatures = "width=640,height=480,chrome,resizable,centerscreen";
-            break;
-
-        case "multipanel":
-            theUrl = "chrome://browser/content/web-panels.xul";
-            theId = "aiosGlobal:MultiPanel";
-            theFeatures = "width=640,height=480,chrome,resizable,centerscreen";
-            break;
-    }
-
-    if(which == "prefs" || which == "about") openDialog(theUrl, theId, theFeatures, theArgs);
-    else toOpenWindowByType(theId, theUrl, theFeatures);
-}
-
-
-/*
-    prueft welche Elemente angezeigt werden sollen
-        => Aufruf jeweils durch Initialisierung
-*/
-function aios_synchElements(aElems) {
-    var elem, child, childElems, childMode;
-
-    for(var i = 0; i < aElems.length; i++) {
-        elem = document.getElementById(aElems[i]);
-
-        if(elem) {
-
-            childElems = elem.getAttribute('aiosChilds');
-
-            if(childElems) {
-                childMode = !aios_getBoolean(elem, 'checked');
-                aios_toggleChilds(childElems, childMode);
-            }
-        }
-    }
-}
-
-
-/*
-    toggelt einen Menuepunkt und das/die zugehoerige/n Element/e
-        => Aufruf durch die menuitems in der aios.xul
-*/
-function aios_toggleElement(aMenuitem) {
-    var menuitem;
-
-    if(typeof aMenuitem != "object") aMenuitem = document.getElementById(aMenuitem);
-
-    if(aMenuitem.getAttribute('observes')) {
-        menuitem = document.getElementById(aMenuitem.getAttribute('observes'));
-    }
-    else {
-        menuitem = document.getElementById(aMenuitem.id);
-    }
-
-    var mode = aios_getBoolean(menuitem, 'checked');
-    var childElems = menuitem.getAttribute('aiosChilds');
-
-    menuitem.setAttribute('checked', !mode);
-    aios_toggleChilds(childElems, mode);
-}
-
-
-/*
-    toggelt Kindelemente eines Menuepunkts
-        => Aufruf durch aios_toggleElement()
-*/
-function aios_toggleChilds(childElems, childMode) {
-    var child_str, child;
-
-    if(childElems != "") {
-        var childElems_arr = childElems.split(",");
-
-        for(var i = 0; i < childElems_arr.length; i++) {
-            child_str = childElems_arr[i].replace(/ /, "");
-
-            var idChilds_arr = document.getElementsByAttribute('id', child_str);
-
-            // wenn es nur ein Element mit der ID gibt...
-            if(idChilds_arr.length == 1) {
-                child = document.getElementById(child_str);
-            }
-            // wenn es mehrere Elemente mit der ID gibt...
-            else {
-                for(var j = 0; j < idChilds_arr.length; j++) {
-                    //... nimm das auf der AIOS-Toolbar
-                    if(idChilds_arr[j].parentNode.id == "aios-toolbar") child = idChilds_arr[j];
-                }
-            }
-
-            if(child) child.setAttribute('hidden', childMode);
-        }
-    }
-}
-
-
-/**
- *  Tastaturkuerzel entfernen, um nicht die des Hauptbrowsers zu blockieren
- *
- *      => Aufruf in downloads.js, pageinfo.js, console.js
- **/
-function aios_removeAccesskeys() {
-    var keys = document.getElementsByAttribute('accesskey', '*');
-    for(var i = 0; i < keys.length; i++) {
-        keys[i].removeAttribute('accesskey')
-    }
-}
-
-
-/**
- *
- **/
-function aios_hideMacMenubar() {
-    if(document.getElementById('main-menubar'))
-        document.getElementById('main-menubar').style.display = "none";
+var AiOS_HELPER = {
+
+    init: function() {
+
+        this.prefInterface = Components.interfaces.nsIPrefBranch;
+        this.prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
+        this.prefBranch = this.prefService.getBranch(null);
+        this.prefBranchAiOS = this.prefService.getBranch("extensions.aios.");
+
+        this.windowWatcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher);
+        this.windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
+        this.mostRecentWindow = this.windowMediator.getMostRecentWindow('navigator:browser');
+
+        this.appInfo = Components.classes['@mozilla.org/xre/app-info;1'].getService(Components.interfaces.nsIXULAppInfo);
+        this.os = Components.classes['@mozilla.org/xre/app-info;1'].getService(Components.interfaces.nsIXULRuntime).OS;
+        this.osVersion = window.navigator.oscpu;
+        this.defTheme = (this.prefBranch.getCharPref('general.skins.selectedSkin') == "classic/1.0") ? true : false;
+
+    },
+
+    initOnDOMLoaded: function() {
+
+        AiOS_HELPER.aiosToolbar = document.getElementById('aios-toolbar');
+        AiOS_HELPER.sbhToolbar = document.getElementById('aios-sbhtoolbar');
+
+    },
+
+    rememberAppInfo: function(aObj) {
+
+        aObj.setAttribute('aios-appVendor', this.appInfo.vendor);
+        aObj.setAttribute('aios-appVersion', this.appInfo.version);
+        aObj.setAttribute('aios-appOS', this.os);
+        aObj.setAttribute('aios-appOSVersion', this.osVersion);
+        aObj.setAttribute('aios-appDefTheme', this.defTheme);
+
+    },
+
+    unload: function() {
+        window.removeEventListener("DOMContentLoaded", AiOS_HELPER.initOnDOMLoaded);
+        //window.removeEventListener("load", AiOS_HELPER.initOnLoad);
+        window.removeEventListener("unload", AiOS_HELPER.unload);
+    }
+
+};
+
+AiOS_HELPER.init();
+
+window.addEventListener("DOMContentLoaded", AiOS_HELPER.initOnDOMLoaded, false);
+//window.addEventListener("load", AiOS_HELPER.initOnLoad, false);
+window.addEventListener("unload", AiOS_HELPER.unload, false);
+
+
+
+// globale Variablen und Funktionen zur Ueberwachung auf Progress-Veraenderungen
+// Verwendung in pageInfo.xul
+var aios_ProgListStart = Components.interfaces.nsIWebProgressListener.STATE_START;
+var aios_ProgListStop = Components.interfaces.nsIWebProgressListener.STATE_STOP;
+
+var aiosProgListener = {
+    QueryInterface: function(aIID) {
+        if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
+            aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
+            aIID.equals(Components.interfaces.nsISupports))
+            return this;
+        throw Components.results.NS_NOINTERFACE;
+    },
+
+    onStateChange: function(aProgress, aRequest, aFlag, aStatus) {
+        //if(aFlag & aios_ProgListStart) { /* This fires when the load event is initiated */ }
+        //if(aFlag & aios_ProgListStop) { /* This fires when the load finishes */ }
+        if(aFlag & aios_ProgListStop) {
+            if(typeof aios_onStateChange == "function") aios_onStateChange();
+        }
+        return 0;
+    },
+
+    onLocationChange: function(aProgress, aRequest, aURI) {
+        // This fires when the location bar changes i.e load event is confirmed
+        // or when the user switches tabs
+        if(typeof aios_onLocationChange == "function") aios_onLocationChange();
+        return 0;
+    },
+
+    // For definitions of the remaining functions see XulPlanet.com
+    onProgressChange: function() {
+        return 0;
+    },
+    onStatusChange: function() {
+        return 0;
+    },
+    onSecurityChange: function() {
+        return 0;
+    },
+    onLinkIconAvailable: function() {
+        return 0;
+    }
+};
+
+
+/*
+    oeffnet ein neues Tab mit der uebergebenen Adresse im Vordergrund
+*/
+var aiosLastSelTab;     // wird fuer Page Info/MultiPanel im Tab benoetigt
+function aios_addTab(aUrl) {
+
+    var browser = AiOS_HELPER.mostRecentWindow.getBrowser();
+    aiosLastSelTab = AiOS_HELPER.mostRecentWindow.content;
+
+    var browserDoc;
+    var existTab = null;
+    var emptyTab = null;
+
+    // alle geoeffneten Tabs durchgehen
+    for(var i = 0; i < browser.tabContainer.childNodes.length; i++) {
+        browserDoc = browser.getBrowserAtIndex(i).contentWindow.document;
+        //alert(browser.getBrowserAtIndex(i).currentURI.spec);
+
+        var isPermaTab = (browser.tabContainer.childNodes[i].getAttribute('isPermaTab')) ? true : false;
+        //alert(isPermaTab);
+
+        /*var attribs = browser.tabContainer.childNodes[i].attributes;
+        //var attribs = browser.mCurrentTab.attributes;
+        for(var a = 0; a < attribs.length; a++) {
+            alert(attribs[a].name + ": " + attribs[a].value);
+        }*/
+
+        // wenn der Tab leer ist
+        if(browserDoc.location.href == "about:blank" && browser.selectedTab.getAttribute('openBy') != "aios" && !isPermaTab && emptyTab == null)
+            emptyTab = i;
+        // wenn der Tab schon existiert
+        if(browserDoc.location.href == aUrl && !isPermaTab && existTab == null)
+            existTab = i;
+    }
+
+    // wenn der Tab schon existiert
+    if(existTab != null) {
+        browser.selectedTab = browser.tabContainer.childNodes[existTab];
+        return browser.selectedTab;
+    }
+
+    // wenn der Tab leer ist
+    if(emptyTab != null) {
+        // URL oeffnen und Tab selektieren
+        browser.getBrowserAtIndex(emptyTab).contentWindow.document.location.href = aUrl;
+        browser.selectedTab = browser.tabContainer.childNodes[emptyTab];
+        browser.selectedTab.setAttribute('openBy', 'aios');
+        return browser.selectedTab;
+    }
+
+    // wenn kein leerer Tab vorhanden war, wird ein neuer geoeffnet
+    browser.selectedTab = browser.addTab(aUrl);
+    browser.selectedTab.setAttribute('openBy', 'aios');
+    return browser.selectedTab;
+}
+
+
+/*
+  fuegt dem Dokument dynamisch ein Stylesheet hinzu
+    => Aufruf u.a. durch aios_init() und aios_sidebarLayout() bei den Add-ons, Downloads
+*/
+function aios_addCSS(aURI, aBefore) {
+    var path = "chrome://aios/skin/css/";
+
+    var elem = (typeof aBefore == "object") ? aBefore : document.getElementById(aBefore);
+
+    var css = document.createProcessingInstruction("xml-stylesheet", 'href="' + path + aURI + '" type="text/css"');
+    document.insertBefore(css, elem);
+}
+
+
+/*
+    errechnet die Breite des Browsers exkl. der AIOS-Toolbar
+        => Aufruf durch aios_setSidebarDefWidth() in aios.js und aios_setSidebarWidth() in general.js
+*/
+function aios_getBrowserWidth() {
+    var cStyleSidebar = AiOS_HELPER.mostRecentWindow.document.defaultView.getComputedStyle(AiOS_HELPER.mostRecentWindow.document.getElementById('sidebar-box'), '');
+    var cStyleSplitter = AiOS_HELPER.mostRecentWindow.document.defaultView.getComputedStyle(AiOS_HELPER.mostRecentWindow.document.getElementById('sidebar-splitter'), '');
+    var cStyleContent = AiOS_HELPER.mostRecentWindow.document.defaultView.getComputedStyle(AiOS_HELPER.mostRecentWindow.document.getElementById('appcontent'), '');
+
+    var widthSidebar = parseInt(cStyleSidebar.width) + parseInt(cStyleSidebar.paddingLeft) + parseInt(cStyleSidebar.paddingRight) + parseInt(cStyleSidebar.marginLeft) + parseInt(cStyleSidebar.marginRight);
+
+    var widthSplitter = parseInt(cStyleSplitter.width) + parseInt(cStyleSplitter.paddingLeft) + parseInt(cStyleSplitter.paddingRight) + parseInt(cStyleSplitter.marginLeft) + parseInt(cStyleSplitter.marginRight);
+
+    var widthContent = parseInt(cStyleContent.width) + parseInt(cStyleContent.paddingLeft) + parseInt(cStyleContent.paddingRight) + parseInt(cStyleContent.marginLeft) + parseInt(cStyleContent.marginRight);
+
+    var compWidth = widthSidebar + widthSplitter + widthContent;
+
+    var ret_arr = new Array(widthSidebar, widthSplitter, widthContent, compWidth);
+    return(ret_arr);
+}
+
+
+/*
+    erweitert das Attribut "class" eines Elementes
+*/
+function aios_appendClass(elem, appClass) {
+    if(typeof elem == "string") elem = document.getElementById(elem);
+
+    var old_class = elem.getAttribute('class');
+    if(old_class.indexOf(appClass) < 0) elem.setAttribute('class', old_class + " " + appClass);
+}
+
+
+/*
+    loescht einen Klassennamen im Attribut "class" eines Elementes
+*/
+function aios_stripClass(elem, stripClass) {
+    if(typeof elem == "string") elem = document.getElementById(elem);
+
+    var old_class = elem.getAttribute('class');
+
+    if(old_class.indexOf(stripClass) >= 0) {
+        var pos = old_class.indexOf(stripClass);
+
+        var slice1 = old_class.substring(0, pos);
+        slice1 = slice1.replace(/ /, "");
+        var slice2 = old_class.substring(pos + stripClass.length, old_class.length);
+        slice2 = slice2.replace(/ /, "");
+
+        elem.setAttribute('class', slice1 + " " + slice2);
+    }
+
+}
+
+
+function aios_gElem(aID) {
+    if(AiOS_HELPER.mostRecentWindow && AiOS_HELPER.mostRecentWindow.document.getElementById(aID)) return AiOS_HELPER.mostRecentWindow.document.getElementById(aID);
+    return false;
+}
+
+
+/*
+ *  ersetzt fuer MacOS X die Angaben zu Tastaturkuerzeln in den Tooltips
+ *
+ **/
+function aios_replaceKey(aElem, aAttr, aKey) {
+    var strings = document.getElementById("aiosProperties");
+
+    var rep_elem = document.getElementById(aElem);
+    var rep = rep_elem.getAttribute(aAttr);
+    rep = rep.substr(rep.indexOf('+'), rep.length);
+    rep_elem.setAttribute(aAttr, strings.getString('key.mac.' + aKey) + rep);
+}
+
+
+/*
+    gibt den boolschen Wert eines Wertes zurueck
+        => getAttribute(val) liefert nur "true" oder "false" als String
+*/
+function aios_getBoolean(aElem, aVal) {
+    var elem, bool;
+
+    if(typeof aElem == "object") {
+        elem = aElem;
+    }
+    else if(typeof aElem == "string" && document.getElementById(aElem)) {
+        elem = document.getElementById(aElem);
+    }
+
+    if(elem) {
+        if(typeof elem.getAttribute == "function") bool = elem.getAttribute(aVal);
+    }
+
+    if(bool == "true") return true;
+    else return false;
+}
+
+
+/*
+    Dialoge oeffnen
+*/
+function aios_openDialog(which, args) {
+    var theUrl, theId, theFeatures;
+    var theArgs = args;
+
+    switch(which) {
+        case "prefs":
+            theUrl = "chrome://aios/content/prefs/prefs.xul";
+            theId = "aiosPrefsDialog";
+            theFeatures = "chrome,titlebar,toolbar,centerscreen,";
+            theFeatures+= (AiOS_HELPER.os == "Darwin") ? "dialog=no" : "modal";
+            break;
+
+        case "about":
+            theUrl = "chrome://aios/content/about.xul";
+            theId = "aiosAboutDialog";
+            theFeatures = "chrome,modal";
+            break;
+
+        case "bookmarks":
+            theUrl = "chrome://browser/content/bookmarks/bookmarksPanel.xul";
+            theId = "aiosGlobal:Bookmarks";
+            theFeatures = "width=640,height=480,chrome,resizable,centerscreen";
+            break;
+
+        case "history":
+            theUrl = "chrome://browser/content/history/history-panel.xul";
+            theId = "aiosGlobal:History";
+            theFeatures = "width=640,height=480,chrome,resizable,centerscreen";
+            break;
+
+        case "multipanel":
+            theUrl = "chrome://browser/content/web-panels.xul";
+            theId = "aiosGlobal:MultiPanel";
+            theFeatures = "width=640,height=480,chrome,resizable,centerscreen";
+            break;
+    }
+
+    if(which == "prefs" || which == "about") openDialog(theUrl, theId, theFeatures, theArgs);
+    else toOpenWindowByType(theId, theUrl, theFeatures);
+}
+
+
+/*
+    prueft welche Elemente angezeigt werden sollen
+        => Aufruf jeweils durch Initialisierung
+*/
+function aios_synchElements(aElems) {
+    var elem, child, childElems, childMode;
+
+    for(var i = 0; i < aElems.length; i++) {
+        elem = document.getElementById(aElems[i]);
+
+        if(elem) {
+
+            childElems = elem.getAttribute('aiosChilds');
+
+            if(childElems) {
+                childMode = !aios_getBoolean(elem, 'checked');
+                aios_toggleChilds(childElems, childMode);
+            }
+        }
+    }
+}
+
+
+/*
+    toggelt einen Menuepunkt und das/die zugehoerige/n Element/e
+        => Aufruf durch die menuitems in der aios.xul
+*/
+function aios_toggleElement(aMenuitem) {
+    var menuitem;
+
+    if(typeof aMenuitem != "object") aMenuitem = document.getElementById(aMenuitem);
+
+    if(aMenuitem.getAttribute('observes')) {
+        menuitem = document.getElementById(aMenuitem.getAttribute('observes'));
+    }
+    else {
+        menuitem = document.getElementById(aMenuitem.id);
+    }
+
+    var mode = aios_getBoolean(menuitem, 'checked');
+    var childElems = menuitem.getAttribute('aiosChilds');
+
+    menuitem.setAttribute('checked', !mode);
+    aios_toggleChilds(childElems, mode);
+}
+
+
+/*
+    toggelt Kindelemente eines Menuepunkts
+        => Aufruf durch aios_toggleElement()
+*/
+function aios_toggleChilds(childElems, childMode) {
+    var child_str, child;
+
+    if(childElems != "") {
+        var childElems_arr = childElems.split(",");
+
+        for(var i = 0; i < childElems_arr.length; i++) {
+            child_str = childElems_arr[i].replace(/ /, "");
+
+            var idChilds_arr = document.getElementsByAttribute('id', child_str);
+
+            // wenn es nur ein Element mit der ID gibt...
+            if(idChilds_arr.length == 1) {
+                child = document.getElementById(child_str);
+            }
+            // wenn es mehrere Elemente mit der ID gibt...
+            else {
+                for(var j = 0; j < idChilds_arr.length; j++) {
+                    //... nimm das auf der AIOS-Toolbar
+                    if(idChilds_arr[j].parentNode.id == "aios-toolbar") child = idChilds_arr[j];
+                }
+            }
+
+            if(child) child.setAttribute('hidden', childMode);
+        }
+    }
+}
+
+
+/**
+ *  Tastaturkuerzel entfernen, um nicht die des Hauptbrowsers zu blockieren
+ *
+ *      => Aufruf in downloads.js, pageinfo.js, console.js
+ **/
+function aios_removeAccesskeys() {
+    var keys = document.getElementsByAttribute('accesskey', '*');
+    for(var i = 0; i < keys.length; i++) {
+        keys[i].removeAttribute('accesskey')
+    }
+}
+
+
+/**
+ *
+ **/
+function aios_hideMacMenubar() {
+    if(document.getElementById('main-menubar'))
+        document.getElementById('main-menubar').style.display = "none";
 }
\ No newline at end of file
diff --git a/content/_lib.js b/content/_lib.js
index 1d3f3e1..557bf25 100644
--- a/content/_lib.js
+++ b/content/_lib.js
@@ -1,707 +1,707 @@
-
-/*
-    modifiziert das Firefox-Sidebar-Menue
-        => Aufruf durch aios_initSidebar() und aios_getSidebarMenu() (Menuebutton-Events 'onpopupshowing')
-*/
-function aios_modSidebarMenu() {
-    aios_getObjects();
-
-    var actSidebar = aios_remLastSidebar();
-    var command, commandParent;
-
-    // jeden einzelnen Menuepunkt uebernehmen oder ggfs. abaendern
-    for(var i = 0; i < fx_sidebarMenu.childNodes.length; i++) {
-        command = null;
-        commandParent = null;
-        var broadcaster = null;
-        var item = fx_sidebarMenu.childNodes[i];
-
-        // Icons ein- oder ausblenden
-        try {
-            var enable_icons = AiOS_HELPER.prefBranchAiOS.getBoolPref('menus.sidebar.icons');
-            var theClass = (enable_icons) ? '' : 'aios-noIcons';
-
-            if(theClass != '') aios_appendClass(item, theClass);
-            else aios_stripClass(item, 'aios-noIcons');
-        }
-        catch(e) { }
-
-        // nur, wenn es kein Separator o.ae. ist
-        if(item.getAttribute('observes') && document.getElementById(item.getAttribute('observes'))) {
-            broadcaster = document.getElementById(item.getAttribute('observes'));
-
-            if(broadcaster.getAttribute('oncommand')) {
-                commandParent = broadcaster;
-
-                if(broadcaster.id == "viewDMSidebar") {
-                    var dmLabel = broadcaster.getAttribute('label');
-                    if(dmLabel.indexOf(" (DMT)") < 0) {
-                        broadcaster.setAttribute('label', dmLabel + " (DMT)");
-                        broadcaster.setAttribute('tooltiptext', dmLabel + " (Download Manager Tweak)");
-                    }
-                }
-            }
-            else if(broadcaster.getAttribute('command')) {
-                commandParent = document.getElementById(broadcaster.getAttribute('command'));
-            }
-
-            if(commandParent) command = commandParent.getAttribute('oncommand');
-        }
-        else if(item.getAttribute('oncommand')) {
-            command = item.getAttribute('oncommand');
-            commandParent = item;
-        }
-
-        // Label als Tooltip verwenden, wenn kein Tooltiptext eingestellt wurde
-        if(!item.getAttribute('tooltiptext') && item.getAttribute('label'))
-            item.setAttribute('tooltiptext', item.getAttribute('label'));
-
-        // den Menuepunkt der aktuellen Sidebar aktivieren/deaktivieren
-        if(command && commandParent) {
-
-            try {
-                var enable_deac = AiOS_HELPER.prefBranchAiOS.getBoolPref('menus.sidebar.entrydeac');
-
-                if(actSidebar && command.indexOf(actSidebar) != -1 && enable_deac) item.setAttribute('disabled', true);
-                else item.setAttribute('disabled', false);
-            }
-            catch(e) { }
-
-        }
-    }
-
-    var mitemsep1 = document.getElementById('aios-sidebar-mitem-sep1');
-    if(mitemsep1.nextSibling.id == "aios-sidebar-mitem-sep0" || mitemsep1.nextSibling.getAttribute('observes') == "viewConsole2Sidebar" || mitemsep1.nextSibling.getAttribute('observes') == "viewDmtSidebar")
-        mitemsep1.setAttribute('hidden', true);
-
-
-    // Menueeintraege anzeigen/verbergen (Sidebar oeffnen/schliessen und Einstellungen) und verschieben
-    var showhideMenuseparator = document.getElementById('aios-sidebar-mitem-sep0');
-    var paneltabMitem1 = document.getElementById('aios-sidebar-mitem-paneltab1');
-    var paneltabMitem2 = document.getElementById('aios-sidebar-mitem-paneltab2');
-    var sidebarshowMitem = document.getElementById('aios-sidebar-mitem-show');
-    var sidebarhideMitem = document.getElementById('aios-sidebar-mitem-hide');
-    var prefsMitem = document.getElementById('aios-sidebar-mitem-prefs');
-
-    var entries = new Array();
-    entries[0] = new Array( "showhide", "paneltab1", "paneltab2", "prefs" );
-
-    // Eintraege/Icons ein- oder ausblenden
-    try {
-        var enable_showhide = AiOS_HELPER.prefBranchAiOS.getBoolPref('menus.sidebar.showhide');
-        var enable_entries = AiOS_HELPER.prefBranchAiOS.getBoolPref('menus.sidebar.entries');
-
-        var returnVals = aios_showHideEntries(entries, 'menus.sidebar.', 'aios-sidebar-mitem-');
-
-        if(enable_showhide && enable_entries) {
-            sidebarshowMitem.setAttribute('hidden', !aios_isSidebarHidden());
-            sidebarhideMitem.setAttribute('hidden', aios_isSidebarHidden());
-        }
-        else {
-            sidebarshowMitem.setAttribute('hidden', true);
-            sidebarhideMitem.setAttribute('hidden', true);
-        }
-    }
-    catch(e) { }
-
-
-    // Menueeintraege ganz nach unten verschieben, wenn das Menue noch nicht bearbeitet wurde
-    if(!aios_getBoolean(fx_sidebarMenu, 'aios-modified')) {
-
-        fx_sidebarMenu.appendChild(showhideMenuseparator);
-        fx_sidebarMenu.appendChild(paneltabMitem1);
-        fx_sidebarMenu.appendChild(paneltabMitem2);
-        fx_sidebarMenu.appendChild(sidebarshowMitem);
-        fx_sidebarMenu.appendChild(sidebarhideMitem);
-        fx_sidebarMenu.appendChild(prefsMitem);
-    }
-
-    // Sidebarmenue als bearbeitet merken
-    fx_sidebarMenu.setAttribute('aios-modified', true);
-}
-
-
-/*
-    Eintraege/Icons ein- oder ausblenden
-        => Aufruf durch aios_modSidebarMenu()
-*/
-function aios_showHideEntries(entries, prefPre_tmp, IDPre) {
-    var prefPre = prefPre_tmp;
-    var returnVals = new Array();
-
-    try {
-        var enable_entries = AiOS_HELPER.prefBranchAiOS.getBoolPref(prefPre + "entries");
-        var enable_icons = AiOS_HELPER.prefBranchAiOS.getBoolPref(prefPre + "icons");
-
-        var theClass = (enable_icons) ? '' : 'aios-noIcons';
-
-        for(var i = 0; i < entries.length; i++) {
-
-            for(var j = 0; j < entries[i].length; j++) {
-                var pref = false;
-                // Pref fuer jeden Eintrag einlesen
-                if(enable_entries) pref = AiOS_HELPER.prefBranchAiOS.getBoolPref(prefPre + entries[i][j]);
-
-                // Eintraege ein- oder ausblenden
-                var theID = IDPre + entries[i][j];
-                if(document.getElementById(theID)) {
-                    // falls es mehrere davon gibt => z.B. wegen CompactMenu
-                    var items = document.getElementsByAttribute('id', theID);
-                    for(var xy = 0; xy < items.length; xy++) {
-                        items[xy].hidden = !pref;
-                    }
-                }
-
-                // aktivierte Eintraege je Gruppe zaehlen
-                if(!returnVals[i]) returnVals[i] = 0;
-                if(pref) returnVals[i]++;
-
-                // Icons ein- oder ausblenden
-                if(document.getElementById(IDPre + entries[i][j])) {
-                    var elem = document.getElementById(IDPre + entries[i][j]);
-
-                    if(theClass != '') aios_appendClass(elem, theClass);
-                    else aios_stripClass(elem, 'aios-noIcons');
-                }
-            }
-
-            // Separator ein- oder ausblenden
-            var sep = IDPre + "sep" + i;
-            if(document.getElementById(sep)) document.getElementById(sep).hidden = !(returnVals[i] > 0);
-        }
-    }
-    catch(e) { }
-
-    return returnVals;
-}
-
-
-/*
-    Oeffnet die Tab-URL in der Sidebar oder die Sidebar-URL in einem neuen Tab
-        => Aufruf durch <command id="aiosCmd_panelTab1">
-                                        <command id="aiosCmd_panelTab2">
-                                        <toolbarbutton id="paneltab-button">
-             in aios.xul
-*/
-var aiosNewTab, aiosSidebarTitle;
-function aios_panelTab(event) {
-    try {
-        var ptReverse = AiOS_HELPER.prefBranchAiOS.getBoolPref("paneltab.reverse");
-        var enable_rightclick = AiOS_HELPER.prefBranchAiOS.getBoolPref("rightclick");
-    }
-    catch(e) { }
-
-    if(!event || (!enable_rightclick && event.button == 2)) return false;
-
-    var theSidebar;
-    var mode = "sidebar";
-
-    if(typeof event == "object") {
-        if((event.shiftKey && event.button == 0)) mode = "window";
-        // metaKey = Mac
-        if((event.ctrlKey && event.button == 0) || (event.metaKey && event.button == 0) || event.button == 1) mode = "tab";
-
-        // Button-Funktion umkehren?
-        if(ptReverse) {
-            mode = "tab";
-            if((event.shiftKey && event.button == 0)) mode = "window";
-            // metaKey = Mac
-            if((event.ctrlKey && event.button == 0) || (event.metaKey && event.button == 0) || event.button == 1) mode = "sidebar";
-        }
-
-        // Rechtsklick?
-        if(enable_rightclick && event.button == 2)  mode = "window";
-    }
-
-    if(typeof event == "string") mode = event;
-
-
-    /*
-        in SIDEBAR oeffnen
-    */
-    if(mode == "sidebar") {
-        var tabHref = top.window.content.location.href;
-
-        // interne FF-Quellen (chrome:/)
-        if(tabHref.indexOf("chrome:/") >= 0) {
-            theSidebar = aios_isSidebar(tabHref);
-
-            // bei "richtigem" Sidebar-Panel den Sidebar-Toggle-Befehl anwenden
-            if(theSidebar) {
-                toggleSidebar(theSidebar, true);
-            }
-            // keine Sidebar (aber chrome://)
-            else {
-                // aktive Sidebar deaktivieren und persists loeschen
-                if(document.getElementById(theSidebar)) {
-                    document.getElementById(theSidebar).removeAttribute('checked');
-                    document.getElementById("sidebar").removeAttribute("src");
-                    document.getElementById("sidebar-box").removeAttribute("src");
-                    document.getElementById("sidebar-box").removeAttribute("sidebarcommand");
-                }
-
-                // chrome-URI in Sidebar oeffnen
-                top.document.getElementById('sidebar').contentDocument.location.href = tabHref;
-                document.getElementById('sidebar-title').setAttribute('value', top.window.content.document.title);
-            }
-        }
-        // about:
-        else if(tabHref.indexOf("about:") >= 0) {
-            aios_setMultiPanel(tabHref);
-        }
-        // normale Webseite
-        else {
-            aios_setMultiPanel('page');
-        }
-    }
-    /*
-        in TAB oder FENSTER oeffnen
-    */
-    else {
-        var newSrc;
-
-        if(fx_sidebarBox.hidden) return false;
-
-        var sidebarDoc = top.document.getElementById('sidebar').contentDocument;
-        var sidebarHref = sidebarDoc.location.href;
-        aiosSidebarTitle = top.document.getElementById('sidebar-title').getAttribute('value');
-
-        if(sidebarDoc.getElementById('web-panels-browser')) {
-            var panelDoc = sidebarDoc.getElementById('web-panels-browser').contentDocument;
-            var panelHref = panelDoc.location.href;
-        }
-
-        // Bookmark-Manager statt Panel?
-        if(sidebarHref == "chrome://browser/content/bookmarks/bookmarksPanel.xul") {
-            try {
-                var enable_bmm = AiOS_HELPER.prefBranchAiOS.getBoolPref("paneltab.bm");
-            }
-            catch(e) { }
-            newSrc = (enable_bmm) ? "chrome://browser/content/places/places.xul" : sidebarHref;
-        }
-        // statt MultiPanel-XUL die im Panel geoeffnete Webseite oeffnen
-        else if(sidebarHref == "chrome://browser/content/web-panels.xul" && mode == "tab") newSrc = panelHref;
-        // alle anderen
-        else newSrc = sidebarHref;
-
-        // in TAB oeffnen
-        if(mode == "tab") {
-            aiosNewTab = aios_addTab(newSrc);
-
-            if(!enable_bmm) {
-
-                window.setTimeout(function() {
-                    aiosNewTab.setAttribute('label', aiosSidebarTitle);
-                }, 400);
-
-            }
-        }
-        // in FENSTER oeffnen
-        else {
-            // wird zur Abfrage in addons/downlaods_....xul und downloads.js benoetigt
-            // sonst wuerden extra geoeffnete Fenster (Downloads, Add-ons) sofort wieder geschlossen
-            AiOS_HELPER.mostRecentWindow.aiosIsWindow = true;
-            window.setTimeout(function() {
-                AiOS_HELPER.mostRecentWindow.aiosIsWindow = false;
-            }, 500);
-
-            var winID = "aiosPanelTabWindow_" + top.document.getElementById('sidebar-box').getAttribute('sidebarcommand');
-            var winWidth = (screen.availWidth >= 900) ? 800 : screen.availWidth/2;
-            var winHeight = (screen.availHeight >= 700) ? 600 : screen.availHeight/2;
-            toOpenWindowByType(winID, newSrc, "width="+winWidth+",height="+winHeight+",chrome,titlebar,toolbar,resizable,centerscreen,dialog=no");
-        }
-    }
-
-    return true;
-}
-
-
-/*
-
-*/
-function aios_isSidebar(aHref) {
-    // wenn es ein "richtiges" Sidebar-Panel ist (vorhandener broadcaster)
-    // => richtigen Sidebar-Toggle-Befehl anwenden
-    //var isSidebar = null;
-    var theSidebar = null;
-    var allSidebars = AiOS_HELPER.mostRecentWindow.document.getElementsByAttribute('group', 'sidebar');
-
-    for(var i = 0; i < allSidebars.length; i++) {
-
-        // muss eine ID haben, darf keinen observer haben (Menueeintraege usw.) und muss eine Sidebar-URL haben
-        if(allSidebars[i].id && !allSidebars[i].getAttribute('observes') && allSidebars[i].getAttribute('sidebarurl')) {
-
-            // aktive Sidebar merken
-            if(aios_getBoolean(allSidebars[i].id, 'checked')) theSidebar = allSidebars[i].id;
-
-            if(aHref == allSidebars[i].getAttribute('sidebarurl')) {
-                return allSidebars[i].id;
-            //isSidebar = true;
-            }
-        }
-    }
-
-    return false;
-}
-
-
-/*
-    Oeffnet div. Fenster u. Manager per Original-Anweisung
-        Aufruf durch Toolbarbuttons und Menueeintraege
-*/
-function aios_contextEvent(event, which) {
-    try {
-        var enable_rightclick = AiOS_HELPER.prefBranchAiOS.getBoolPref("rightclick");
-    }
-    catch(e) { }
-
-    //alert("Maus: " + event.button + "\nShift: " + event.shiftKey + "\nCtrl: " + event.ctrlKey + "\nAlt: " + event.altKey + "\nMeta: " + event.metaKey);
-
-    if(event.button == 0 && (!event.shiftKey && !event.ctrlKey && !event.metaKey)) return false;      // nur Linksklick (metaKey = Mac)
-
-    if(!enable_rightclick && event.button == 2) return false;                       // Rechtsklick nicht erlaubt
-
-    if(!event || typeof which != "object") return false;                            // kein empfangenes Event
-
-    var mWindow = document.getElementById('main-window');
-    if(mWindow && mWindow.getAttribute('chromehidden').indexOf('extrachrome') >= 0) return false; // in einem JS-PopUp
-
-    // Objekt ermitteln, welches das Attribut mit Befehl enthaelt (zuvor in aios_setTargets() gesetzt)
-    var cmdObj;
-    if(which.getAttribute('command')) cmdObj = document.getElementById(which.getAttribute('command'));
-    if(!cmdObj && which.getAttribute('observes')) cmdObj = document.getElementById(which.getAttribute('observes'));
-
-    // Modus ermitteln
-    var mode = "sidebar";
-
-    // Shift+Linksklick => neues Fenster
-    if((event.shiftKey && event.button == 0) || (enable_rightclick && event.button == 2)) {
-        if(aios_getBoolean(cmdObj, 'aios_inSidebar') || cmdObj.getAttribute('group') == "sidebar") mode = "window";
-    }
-
-    // Ctrl+Linksklick oder Mittelklick => neuer Tab (metaKey = Mac)
-    if((event.ctrlKey && event.button == 0) || (event.metaKey && event.button == 0) || event.button == 1) mode = "tab";
-
-    if(!cmdObj) return false;
-
-    // Befehl ausfuehren
-    switch(mode) {
-        case "sidebar":
-            toggleSidebar(cmdObj.getAttribute('aios_sbCmd'));
-            break;
-
-        case "window":      // wird zur Abfrage in addons/downloads_....xul und downloads.js benoetigt
-            // sonst wuerden extra geoeffnete Fenster (Downloads, Add-ons) sofort wieder geschlossen
-            AiOS_HELPER.mostRecentWindow.aiosIsWindow = true;
-            window.setTimeout(function() {
-                AiOS_HELPER.mostRecentWindow.aiosIsWindow = false;
-            }, 500);
-
-            var winID = "aiosContextEventWindow_" + cmdObj.getAttribute('aios_sbCmd');
-            var winSRC = cmdObj.getAttribute('aios_sbUri');
-            var winWidth = (screen.availWidth >= 900) ? 800 : screen.availWidth/2;
-            var winHeight = (screen.availHeight >= 700) ? 600 : screen.availHeight/2;
-            toOpenWindowByType(winID, winSRC, "width="+winWidth+",height="+winHeight+",chrome,titlebar,toolbar,resizable,centerscreen,dialog=no");
-
-            break;
-
-        case "tab":
-            aios_addTab(cmdObj.getAttribute('aios_sbUri'));
-            break;
-    }
-
-    return true;
-}
-
-
-/*
-    legt commands fuer Fenster fest, die lt. Einstellungen in der Sidebar geoeffnet werden sollen
-        => dynamisch per JS, damit keinerlei Veraenderungen vorgenommen werden, wenn es nicht in der Sidebar geoeffnet werden soll
-                => bessere Kompatibilitaet mit anderen Erweiterungen
-        => Aufruf durch aios_initSidebar()
-*/
-function aios_setTargets() {
-    var objects, i;
-
-    // weise den Menueelementen der Fehlerkonsole, des Seitenquelltextes und der Seiteninformationen die entsprechenden commands zu
-    document.getElementById('javascriptConsole').removeAttribute('oncommand');
-    document.getElementById('javascriptConsole').setAttribute('command', 'Tools:Console');
-
-    if(document.getElementById('key_errorConsole')) {
-        document.getElementById('key_errorConsole').removeAttribute('oncommand');
-        document.getElementById('key_errorConsole').setAttribute('command', 'Tools:Console');
-    }
-
-    document.getElementById('context-viewinfo').removeAttribute('oncommand');
-    document.getElementById('context-viewinfo').setAttribute('command', 'View:PageInfo');
-
-
-    var targets = new Array();
-    targets['bm'] = new Array('View:Bookmarks',     'viewBookmarksSidebar',     'bookmarks');
-    targets['hi'] = new Array('View:History',       'viewHistorySidebar',       'history');
-    targets['dm'] = new Array('Tools:Downloads',    'viewDownloadsSidebar',     'downloads');
-    targets['ad'] = new Array('Tools:Addons',       'viewAddonsSidebar',        'addons');
-    targets['mp'] = new Array('Tools:MultiPanel',   'viewWebPanelsSidebar',     'multipanel');
-    targets['pi'] = new Array('View:PageInfo',      'viewPageInfoSidebar',      'pageinfo');
-    targets['co'] = new Array('Tools:Console',      'viewConsoleSidebar',       'console');
-
-    if(document.getElementById('viewConsole2Sidebar'))
-        targets['co'] = new Array('Tools:Console', 'viewConsole2Sidebar', 'console');
-
-    // informative Tooltips und Funktionsumkehrung (PanelTab) aktivieren?
-    var prefInfotip = false;
-    var ptReverse = false;
-    try {
-        prefInfotip = AiOS_HELPER.prefBranchAiOS.getBoolPref("infotips");
-        ptReverse = AiOS_HELPER.prefBranchAiOS.getBoolPref("paneltab.reverse");
-
-        if(prefInfotip) {
-            if(elem_switch) elem_switch.removeAttribute('tooltiptext');
-
-            //if(document.getElementById('paneltab-button')) document.getElementById('paneltab-button').removeAttribute('tooltiptext');
-            // in Schleife, weil es mehrere Buttons mit der gleichen ID geben kann
-            objects = document.getElementsByAttribute('id', 'paneltab-button');
-            for(i = 0; i < objects.length; i++) {
-                objects[i].removeAttribute('tooltiptext');
-            }
-        }
-
-        if(document.getElementById('paneltab-button')) {
-            if(ptReverse) document.getElementById('paneltab-button').setAttribute('tooltip', 'paneltab-tooltip-reverse');
-            else document.getElementById('paneltab-button').setAttribute('tooltip', 'paneltab-tooltip');
-        }
-    }
-    catch(e) { }
-
-    for(var obj in targets) {
-        // in Sidebar oeffnen?
-        var prefSidebar;
-        try {
-            if(obj != "ad") prefSidebar = AiOS_HELPER.prefBranchAiOS.getBoolPref(obj + ".sidebar");
-            else prefSidebar = AiOS_HELPER.prefBranchAiOS.getBoolPref("em.sidebar");
-
-            var enable_rightclick = AiOS_HELPER.prefBranchAiOS.getBoolPref("rightclick");
-        }
-        catch(e) { }
-
-        var ffObj = document.getElementById(targets[obj][0]);           // Original-Objekt
-        var sbObj = document.getElementById(targets[obj][1]);           // Sidebar-Objekt
-        var tpObj = document.getElementById(targets[obj][2] + "-tooltip");  // Tooltip
-        var btObj = document.getElementById(targets[obj][2] + "-button");   // Button
-
-        if(ffObj && sbObj) {
-
-            var newObj, newCmd, newTp;
-
-            if(prefSidebar) {
-                newObj = sbObj;
-                newTp = document.getElementById('template-sidebar-tooltip').childNodes[0].cloneNode(true);
-            }
-            else {
-                newObj = ffObj;
-                newTp = document.getElementById('template-window-tooltip').childNodes[0].cloneNode(true);
-            }
-
-            newCmd = newObj.getAttribute('oncommand');
-
-            // verhindern dass zwei Befehle ausgefuehrt werden, wenn eine Taste mitgedrueckt wird
-            newCmd = "if(aios_preventDblCmd(event)) " + newCmd + " return true;";
-
-            // Befehl zuweisen
-            ffObj.setAttribute('oncommand', newCmd);
-
-
-            // Befehle merken
-            //  => fuer Context-Funktionen - aios_contextEvent() - abfragbar
-            //  => zuweisbar, wenn nicht mehr in Sidebar geoeffnet werden soll
-            if(!aios_getBoolean(ffObj, 'modByAIOS')) {
-                // fuer Klicks auf Toolbarbuttons und Menueeintraege
-                ffObj.setAttribute('aios_sbUri', sbObj.getAttribute('sidebarurl'));
-                ffObj.setAttribute('aios_sbCmd', targets[obj][1]);
-                ffObj.setAttribute('aios_inSidebar', prefSidebar);
-
-                // fuer Klicks auf Menueeintraege in den Sidebarmenues => siehe aios_preventDblCmd()
-                sbObj.setAttribute('aios_sbUri', sbObj.getAttribute('sidebarurl'));
-                sbObj.setAttribute('oncommand', "if(aios_preventDblCmd(event)) " + sbObj.getAttribute('oncommand'));
-            }
-
-
-            // Tooltiptext entfernen, um Info-Tooltips sichtbar zu machen (in Schleife, weil es mehrere Buttons mit der gleichen ID geben kann)
-            //if(prefInfotip && btObj) btObj.removeAttribute('tooltiptext');
-            if(prefInfotip && btObj) {
-                objects = document.getElementsByAttribute('id', btObj.id);
-                for(i = 0; i < objects.length; i++) {
-                    objects[i].removeAttribute('tooltiptext');
-                }
-            }
-
-            // "alte" Tooltip-Zeilen entfernen (sonst werden sie mit jedem Funktionsaufruf zusaetzlich eingefuegt)
-            if(tpObj.childNodes.length > 1) tpObj.removeChild(tpObj.childNodes[1]);
-
-            // Rechtsklick im Tooltip aktivieren
-            if(enable_rightclick)
-                newTp.setAttribute('r3c2', newTp.getAttribute('r3c2') + newTp.getAttribute('rightclick'));
-
-            // Tooltip zuweisen
-            tpObj.appendChild(newTp);
-
-            // Kontext-Menue der Toolbarbuttons deaktivieren, wenn Rechtsklick erlaubt ist
-            if(btObj && enable_rightclick) btObj.setAttribute('context', '');
-
-            ffObj.setAttribute('modByAIOS', true);
-        }
-    }
-
-    // Kontext-Menue des PanelTab buttons deaktivieren, wenn Rechtsklick erlaubt ist
-    if(enable_rightclick && document.getElementById('paneltab-button')) {
-        document.getElementById('paneltab-button').setAttribute('context', '');
-        var pttt1 = document.getElementById('paneltab-tooltip').firstChild;
-        var pttt2 = document.getElementById('paneltab-tooltip-reverse').firstChild;
-
-        if(pttt1.getAttribute('r3c2').indexOf(pttt1.getAttribute('rightclick')) == -1) {
-            pttt1.setAttribute('r3c2', pttt1.getAttribute('r3c2') + pttt1.getAttribute('rightclick'));
-        }
-        if(pttt2.getAttribute('r3c2').indexOf(pttt2.getAttribute('rightclick')) == -1) {
-            pttt2.setAttribute('r3c2', pttt2.getAttribute('r3c2') + pttt2.getAttribute('rightclick'));
-        }
-    }
-
-
-    // Oeffnen des Download-Fensters verhindern, wenn die Sidebar genutzt werden soll
-    if(AiOS_HELPER.prefBranchAiOS.getBoolPref('dm.sidebar')) AiOS_HELPER.prefService.setBoolPref("browser.download.manager.showWhenStarting", false);
-
-
-    // Download-Observer hinzufuegen, falls Downloads in der Sidebar geoeffnet werden sollen
-    var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
-
-    observerService.addObserver(aios_DownloadObserver, "dl-start",  false);
-    observerService.addObserver(aios_DownloadObserver, "dl-done",  false);
-
-    // Observer beim Schliessen des Fensters wieder loeschen
-    window.addEventListener("unload", function() {
-        if(aios_DownloadObserver) {
-            var aios_myOs = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
-            aios_myOs.removeObserver(aios_DownloadObserver, "dl-start");
-            aios_myOs.removeObserver(aios_DownloadObserver, "dl-done");
-            aios_DownloadObserver = null;
-        }
-
-    }, false);
-
-
-
-    return true;
-}
-
-/*
-    Oeffnet die Sidebar,
-        1. wenn ein Download gestartet wird ...
-        2. der Manager geoeffnet werden soll und ...
-        3. das Ziel die Sidebar sein soll
-*/
-var aios_DownloadObserver = {
-    observe: function (aSubject, aTopic, aState) {
-
-        var autoOpen = AiOS_HELPER.prefBranchAiOS.getBoolPref('dm.autoopen');
-        var autoClose = AiOS_HELPER.prefBranchAiOS.getBoolPref('dm.autoclose');
-        var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation).QueryInterface(Components.interfaces.nsIDocShellTreeItem).rootTreeItem.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow);
-
-        switch (aTopic) {
-            case "dl-start":
-                var comElem = document.getElementById('Tools:Downloads');
-                if(autoOpen && comElem.getAttribute('oncommand').indexOf('viewDownloadsSidebar') >= 0) {
-                    // AiOS_HELPER.windowWatcher.activeWindow verhindert, dass die Sidebar in jedem Fenster geoeffnet wird
-                    if(typeof AiOS_HELPER.windowWatcher.activeWindow.toggleSidebar == "function") AiOS_HELPER.windowWatcher.activeWindow.toggleSidebar("viewDownloadsSidebar", true);
-                }
-                break;
-
-            case "dl-done":
-                var sideSrc = document.getElementById('sidebar').getAttribute('src');
-                if(autoOpen && autoClose && sideSrc.indexOf('downloads.xul') >= 0) {
-                    if(typeof AiOS_HELPER.windowWatcher.activeWindow.toggleSidebar == "function") AiOS_HELPER.windowWatcher.activeWindow.toggleSidebar();
-                }
-                break;
-        }
-    }
-};
-
-
-/*
-  verhindert, dass bei Klick + Shift oder Strg der normale Command-Befehl und die Doppelfunktion ausgefuehrt wird
-    => Aufruf durch die
-*/
-function aios_preventDblCmd(ev) {
-    // metaKey = Mac
-    if(ev.shiftKey || ev.ctrlKey || ev.metaKey) {
-        if(ev.explicitOriginalTarget.tagName == 'toolbarbutton' || ev.explicitOriginalTarget.tagName == 'menuitem') return false;
-    }
-    return true;
-}
-
-
-/*
-    prueft, ob das Browserfenster maximiert ist oder sich im Vollbildmodus befindet
-        => Aufruf durch aios_checkThinSwitch()
-*/
-function aios_isWinMax() {
-    var windowMax = document.getElementById('main-window').getAttribute('sizemode') == "maximized";
-
-    var maxWidth = window.outerWidth > screen.availWidth;
-    var maxHeight = window.outerHeight > screen.availHeight;
-    if((maxWidth && maxHeight) || window.fullScreen) windowMax = true;
-
-    return windowMax;
-}
-
-
-/*
-    prueft, ob die Sidebar gerade sichtbar/unsichtbar ist => abhaengig von der Sidebar-Methode
-*/
-function aios_isSidebarHidden() {
-    aios_getObjects();
-
-    try {
-        var aios_collapseSidebar = AiOS_HELPER.prefBranchAiOS.getBoolPref('collapse');
-    }
-    catch(e) { }
-
-    // CollapseByStyle-Methode if(aios_collapseSidebar) return (fx_sidebarBox.hidden || fx_sidebarBox.getAttribute('style') != "");
-    if(aios_collapseSidebar) return (fx_sidebarBox.hidden || fx_sidebarBox.collapsed);
-    else return fx_sidebarBox.hidden;
-}
-
-
-/*
-    Autohide-Feature initialisieren
-        => Aufruf durch aios_initSidebar() und aios_savePrefs()
-*/
-var aiosFocus = true;
-function aios_initAutohide() {
-    // Zustand des Autohide-Buttons einstellen
-    document.getElementById('aios-enableAutohide').setAttribute('checked', AiOS_HELPER.prefBranchAiOS.getBoolPref("gen.switch.autoshow"));
-
-    // Autohide-Feature-Funktion hinzufuegen
-    fx_sidebarBox.addEventListener("mouseover", function() {
-        if(document.getElementById('appcontent'))
-            document.getElementById('appcontent').addEventListener("mouseover", aios_autoShowHide, true);
-    }, true);
-
-    window.addEventListener("focus", function(e) {
-        aiosFocus = true;
-    }, true);
-    window.addEventListener("blur", function(e) {
-        aiosFocus = false;
-    }, true);
-}
-
-
-/*
-    Autohide ein- bzw. ausschalten per Toolbarbutton
-        => Aufruf durch broadcaster 'aios-enableAutohide'
-*/
-function aios_toggleAutohide(which) {
-    try {
-        AiOS_HELPER.prefBranchAiOS.setBoolPref("gen.switch.autoshow", aios_getBoolean(which, 'checked'));
-    }
-    catch(e) { }
+
+/*
+    modifiziert das Firefox-Sidebar-Menue
+        => Aufruf durch aios_initSidebar() und aios_getSidebarMenu() (Menuebutton-Events 'onpopupshowing')
+*/
+function aios_modSidebarMenu() {
+    aios_getObjects();
+
+    var actSidebar = aios_remLastSidebar();
+    var command, commandParent;
+
+    // jeden einzelnen Menuepunkt uebernehmen oder ggfs. abaendern
+    for(var i = 0; i < fx_sidebarMenu.childNodes.length; i++) {
+        command = null;
+        commandParent = null;
+        var broadcaster = null;
+        var item = fx_sidebarMenu.childNodes[i];
+
+        // Icons ein- oder ausblenden
+        try {
+            var enable_icons = AiOS_HELPER.prefBranchAiOS.getBoolPref('menus.sidebar.icons');
+            var theClass = (enable_icons) ? '' : 'aios-noIcons';
+
+            if(theClass != '') aios_appendClass(item, theClass);
+            else aios_stripClass(item, 'aios-noIcons');
+        }
+        catch(e) { }
+
+        // nur, wenn es kein Separator o.ae. ist
+        if(item.getAttribute('observes') && document.getElementById(item.getAttribute('observes'))) {
+            broadcaster = document.getElementById(item.getAttribute('observes'));
+
+            if(broadcaster.getAttribute('oncommand')) {
+                commandParent = broadcaster;
+
+                if(broadcaster.id == "viewDMSidebar") {
+                    var dmLabel = broadcaster.getAttribute('label');
+                    if(dmLabel.indexOf(" (DMT)") < 0) {
+                        broadcaster.setAttribute('label', dmLabel + " (DMT)");
+                        broadcaster.setAttribute('tooltiptext', dmLabel + " (Download Manager Tweak)");
+                    }
+                }
+            }
+            else if(broadcaster.getAttribute('command')) {
+                commandParent = document.getElementById(broadcaster.getAttribute('command'));
+            }
+
+            if(commandParent) command = commandParent.getAttribute('oncommand');
+        }
+        else if(item.getAttribute('oncommand')) {
+            command = item.getAttribute('oncommand');
+            commandParent = item;
+        }
+
+        // Label als Tooltip verwenden, wenn kein Tooltiptext eingestellt wurde
+        if(!item.getAttribute('tooltiptext') && item.getAttribute('label'))
+            item.setAttribute('tooltiptext', item.getAttribute('label'));
+
+        // den Menuepunkt der aktuellen Sidebar aktivieren/deaktivieren
+        if(command && commandParent) {
+
+            try {
+                var enable_deac = AiOS_HELPER.prefBranchAiOS.getBoolPref('menus.sidebar.entrydeac');
+
+                if(actSidebar && command.indexOf(actSidebar) != -1 && enable_deac) item.setAttribute('disabled', true);
+                else item.setAttribute('disabled', false);
+            }
+            catch(e) { }
+
+        }
+    }
+
+    var mitemsep1 = document.getElementById('aios-sidebar-mitem-sep1');
+    if(mitemsep1.nextSibling.id == "aios-sidebar-mitem-sep0" || mitemsep1.nextSibling.getAttribute('observes') == "viewConsole2Sidebar" || mitemsep1.nextSibling.getAttribute('observes') == "viewDmtSidebar")
+        mitemsep1.setAttribute('hidden', true);
+
+
+    // Menueeintraege anzeigen/verbergen (Sidebar oeffnen/schliessen und Einstellungen) und verschieben
+    var showhideMenuseparator = document.getElementById('aios-sidebar-mitem-sep0');
+    var paneltabMitem1 = document.getElementById('aios-sidebar-mitem-paneltab1');
+    var paneltabMitem2 = document.getElementById('aios-sidebar-mitem-paneltab2');
+    var sidebarshowMitem = document.getElementById('aios-sidebar-mitem-show');
+    var sidebarhideMitem = document.getElementById('aios-sidebar-mitem-hide');
+    var prefsMitem = document.getElementById('aios-sidebar-mitem-prefs');
+
+    var entries = new Array();
+    entries[0] = new Array( "showhide", "paneltab1", "paneltab2", "prefs" );
+
+    // Eintraege/Icons ein- oder ausblenden
+    try {
+        var enable_showhide = AiOS_HELPER.prefBranchAiOS.getBoolPref('menus.sidebar.showhide');
+        var enable_entries = AiOS_HELPER.prefBranchAiOS.getBoolPref('menus.sidebar.entries');
+
+        var returnVals = aios_showHideEntries(entries, 'menus.sidebar.', 'aios-sidebar-mitem-');
+
+        if(enable_showhide && enable_entries) {
+            sidebarshowMitem.setAttribute('hidden', !aios_isSidebarHidden());
+            sidebarhideMitem.setAttribute('hidden', aios_isSidebarHidden());
+        }
+        else {
+            sidebarshowMitem.setAttribute('hidden', true);
+            sidebarhideMitem.setAttribute('hidden', true);
+        }
+    }
+    catch(e) { }
+
+
+    // Menueeintraege ganz nach unten verschieben, wenn das Menue noch nicht bearbeitet wurde
+    if(!aios_getBoolean(fx_sidebarMenu, 'aios-modified')) {
+
+        fx_sidebarMenu.appendChild(showhideMenuseparator);
+        fx_sidebarMenu.appendChild(paneltabMitem1);
+        fx_sidebarMenu.appendChild(paneltabMitem2);
+        fx_sidebarMenu.appendChild(sidebarshowMitem);
+        fx_sidebarMenu.appendChild(sidebarhideMitem);
+        fx_sidebarMenu.appendChild(prefsMitem);
+    }
+
+    // Sidebarmenue als bearbeitet merken
+    fx_sidebarMenu.setAttribute('aios-modified', true);
+}
+
+
+/*
+    Eintraege/Icons ein- oder ausblenden
+        => Aufruf durch aios_modSidebarMenu()
+*/
+function aios_showHideEntries(entries, prefPre_tmp, IDPre) {
+    var prefPre = prefPre_tmp;
+    var returnVals = new Array();
+
+    try {
+        var enable_entries = AiOS_HELPER.prefBranchAiOS.getBoolPref(prefPre + "entries");
+        var enable_icons = AiOS_HELPER.prefBranchAiOS.getBoolPref(prefPre + "icons");
+
+        var theClass = (enable_icons) ? '' : 'aios-noIcons';
+
+        for(var i = 0; i < entries.length; i++) {
+
+            for(var j = 0; j < entries[i].length; j++) {
+                var pref = false;
+                // Pref fuer jeden Eintrag einlesen
+                if(enable_entries) pref = AiOS_HELPER.prefBranchAiOS.getBoolPref(prefPre + entries[i][j]);
+
+                // Eintraege ein- oder ausblenden
+                var theID = IDPre + entries[i][j];
+                if(document.getElementById(theID)) {
+                    // falls es mehrere davon gibt => z.B. wegen CompactMenu
+                    var items = document.getElementsByAttribute('id', theID);
+                    for(var xy = 0; xy < items.length; xy++) {
+                        items[xy].hidden = !pref;
+                    }
+                }
+
+                // aktivierte Eintraege je Gruppe zaehlen
+                if(!returnVals[i]) returnVals[i] = 0;
+                if(pref) returnVals[i]++;
+
+                // Icons ein- oder ausblenden
+                if(document.getElementById(IDPre + entries[i][j])) {
+                    var elem = document.getElementById(IDPre + entries[i][j]);
+
+                    if(theClass != '') aios_appendClass(elem, theClass);
+                    else aios_stripClass(elem, 'aios-noIcons');
+                }
+            }
+
+            // Separator ein- oder ausblenden
+            var sep = IDPre + "sep" + i;
+            if(document.getElementById(sep)) document.getElementById(sep).hidden = !(returnVals[i] > 0);
+        }
+    }
+    catch(e) { }
+
+    return returnVals;
+}
+
+
+/*
+    Oeffnet die Tab-URL in der Sidebar oder die Sidebar-URL in einem neuen Tab
+        => Aufruf durch <command id="aiosCmd_panelTab1">
+                                        <command id="aiosCmd_panelTab2">
+                                        <toolbarbutton id="paneltab-button">
+             in aios.xul
+*/
+var aiosNewTab, aiosSidebarTitle;
+function aios_panelTab(event) {
+    try {
+        var ptReverse = AiOS_HELPER.prefBranchAiOS.getBoolPref("paneltab.reverse");
+        var enable_rightclick = AiOS_HELPER.prefBranchAiOS.getBoolPref("rightclick");
+    }
+    catch(e) { }
+
+    if(!event || (!enable_rightclick && event.button == 2)) return false;
+
+    var theSidebar;
+    var mode = "sidebar";
+
+    if(typeof event == "object") {
+        if((event.shiftKey && event.button == 0)) mode = "window";
+        // metaKey = Mac
+        if((event.ctrlKey && event.button == 0) || (event.metaKey && event.button == 0) || event.button == 1) mode = "tab";
+
+        // Button-Funktion umkehren?
+        if(ptReverse) {
+            mode = "tab";
+            if((event.shiftKey && event.button == 0)) mode = "window";
+            // metaKey = Mac
+            if((event.ctrlKey && event.button == 0) || (event.metaKey && event.button == 0) || event.button == 1) mode = "sidebar";
+        }
+
+        // Rechtsklick?
+        if(enable_rightclick && event.button == 2)  mode = "window";
+    }
+
+    if(typeof event == "string") mode = event;
+
+
+    /*
+        in SIDEBAR oeffnen
+    */
+    if(mode == "sidebar") {
+        var tabHref = top.window.content.location.href;
+
+        // interne FF-Quellen (chrome:/)
+        if(tabHref.indexOf("chrome:/") >= 0) {
+            theSidebar = aios_isSidebar(tabHref);
+
+            // bei "richtigem" Sidebar-Panel den Sidebar-Toggle-Befehl anwenden
+            if(theSidebar) {
+                toggleSidebar(theSidebar, true);
+            }
+            // keine Sidebar (aber chrome://)
+            else {
+                // aktive Sidebar deaktivieren und persists loeschen
+                if(document.getElementById(theSidebar)) {
+                    document.getElementById(theSidebar).removeAttribute('checked');
+                    document.getElementById("sidebar").removeAttribute("src");
+                    document.getElementById("sidebar-box").removeAttribute("src");
+                    document.getElementById("sidebar-box").removeAttribute("sidebarcommand");
+                }
+
+                // chrome-URI in Sidebar oeffnen
+                top.document.getElementById('sidebar').contentDocument.location.href = tabHref;
+                document.getElementById('sidebar-title').setAttribute('value', top.window.content.document.title);
+            }
+        }
+        // about:
+        else if(tabHref.indexOf("about:") >= 0) {
+            aios_setMultiPanel(tabHref);
+        }
+        // normale Webseite
+        else {
+            aios_setMultiPanel('page');
+        }
+    }
+    /*
+        in TAB oder FENSTER oeffnen
+    */
+    else {
+        var newSrc;
+
+        if(fx_sidebarBox.hidden) return false;
+
+        var sidebarDoc = top.document.getElementById('sidebar').contentDocument;
+        var sidebarHref = sidebarDoc.location.href;
+        aiosSidebarTitle = top.document.getElementById('sidebar-title').getAttribute('value');
+
+        if(sidebarDoc.getElementById('web-panels-browser')) {
+            var panelDoc = sidebarDoc.getElementById('web-panels-browser').contentDocument;
+            var panelHref = panelDoc.location.href;
+        }
+
+        // Bookmark-Manager statt Panel?
+        if(sidebarHref == "chrome://browser/content/bookmarks/bookmarksPanel.xul") {
+            try {
+                var enable_bmm = AiOS_HELPER.prefBranchAiOS.getBoolPref("paneltab.bm");
+            }
+            catch(e) { }
+            newSrc = (enable_bmm) ? "chrome://browser/content/places/places.xul" : sidebarHref;
+        }
+        // statt MultiPanel-XUL die im Panel geoeffnete Webseite oeffnen
+        else if(sidebarHref == "chrome://browser/content/web-panels.xul" && mode == "tab") newSrc = panelHref;
+        // alle anderen
+        else newSrc = sidebarHref;
+
+        // in TAB oeffnen
+        if(mode == "tab") {
+            aiosNewTab = aios_addTab(newSrc);
+
+            if(!enable_bmm) {
+
+                window.setTimeout(function() {
+                    aiosNewTab.setAttribute('label', aiosSidebarTitle);
+                }, 400);
+
+            }
+        }
+        // in FENSTER oeffnen
+        else {
+            // wird zur Abfrage in addons/downlaods_....xul und downloads.js benoetigt
+            // sonst wuerden extra geoeffnete Fenster (Downloads, Add-ons) sofort wieder geschlossen
+            AiOS_HELPER.mostRecentWindow.aiosIsWindow = true;
+            window.setTimeout(function() {
+                AiOS_HELPER.mostRecentWindow.aiosIsWindow = false;
+            }, 500);
+
+            var winID = "aiosPanelTabWindow_" + top.document.getElementById('sidebar-box').getAttribute('sidebarcommand');
+            var winWidth = (screen.availWidth >= 900) ? 800 : screen.availWidth/2;
+            var winHeight = (screen.availHeight >= 700) ? 600 : screen.availHeight/2;
+            toOpenWindowByType(winID, newSrc, "width="+winWidth+",height="+winHeight+",chrome,titlebar,toolbar,resizable,centerscreen,dialog=no");
+        }
+    }
+
+    return true;
+}
+
+
+/*
+
+*/
+function aios_isSidebar(aHref) {
+    // wenn es ein "richtiges" Sidebar-Panel ist (vorhandener broadcaster)
+    // => richtigen Sidebar-Toggle-Befehl anwenden
+    //var isSidebar = null;
+    var theSidebar = null;
+    var allSidebars = AiOS_HELPER.mostRecentWindow.document.getElementsByAttribute('group', 'sidebar');
+
+    for(var i = 0; i < allSidebars.length; i++) {
+
+        // muss eine ID haben, darf keinen observer haben (Menueeintraege usw.) und muss eine Sidebar-URL haben
+        if(allSidebars[i].id && !allSidebars[i].getAttribute('observes') && allSidebars[i].getAttribute('sidebarurl')) {
+
+            // aktive Sidebar merken
+            if(aios_getBoolean(allSidebars[i].id, 'checked')) theSidebar = allSidebars[i].id;
+
+            if(aHref == allSidebars[i].getAttribute('sidebarurl')) {
+                return allSidebars[i].id;
+            //isSidebar = true;
+            }
+        }
+    }
+
+    return false;
+}
+
+
+/*
+    Oeffnet div. Fenster u. Manager per Original-Anweisung
+        Aufruf durch Toolbarbuttons und Menueeintraege
+*/
+function aios_contextEvent(event, which) {
+    try {
+        var enable_rightclick = AiOS_HELPER.prefBranchAiOS.getBoolPref("rightclick");
+    }
+    catch(e) { }
+
+    //alert("Maus: " + event.button + "\nShift: " + event.shiftKey + "\nCtrl: " + event.ctrlKey + "\nAlt: " + event.altKey + "\nMeta: " + event.metaKey);
+
+    if(event.button == 0 && (!event.shiftKey && !event.ctrlKey && !event.metaKey)) return false;      // nur Linksklick (metaKey = Mac)
+
+    if(!enable_rightclick && event.button == 2) return false;                       // Rechtsklick nicht erlaubt
+
+    if(!event || typeof which != "object") return false;                            // kein empfangenes Event
+
+    var mWindow = document.getElementById('main-window');
+    if(mWindow && mWindow.getAttribute('chromehidden').indexOf('extrachrome') >= 0) return false; // in einem JS-PopUp
+
+    // Objekt ermitteln, welches das Attribut mit Befehl enthaelt (zuvor in aios_setTargets() gesetzt)
+    var cmdObj;
+    if(which.getAttribute('command')) cmdObj = document.getElementById(which.getAttribute('command'));
+    if(!cmdObj && which.getAttribute('observes')) cmdObj = document.getElementById(which.getAttribute('observes'));
+
+    // Modus ermitteln
+    var mode = "sidebar";
+
+    // Shift+Linksklick => neues Fenster
+    if((event.shiftKey && event.button == 0) || (enable_rightclick && event.button == 2)) {
+        if(aios_getBoolean(cmdObj, 'aios_inSidebar') || cmdObj.getAttribute('group') == "sidebar") mode = "window";
+    }
+
+    // Ctrl+Linksklick oder Mittelklick => neuer Tab (metaKey = Mac)
+    if((event.ctrlKey && event.button == 0) || (event.metaKey && event.button == 0) || event.button == 1) mode = "tab";
+
+    if(!cmdObj) return false;
+
+    // Befehl ausfuehren
+    switch(mode) {
+        case "sidebar":
+            toggleSidebar(cmdObj.getAttribute('aios_sbCmd'));
+            break;
+
+        case "window":      // wird zur Abfrage in addons/downloads_....xul und downloads.js benoetigt
+            // sonst wuerden extra geoeffnete Fenster (Downloads, Add-ons) sofort wieder geschlossen
+            AiOS_HELPER.mostRecentWindow.aiosIsWindow = true;
+            window.setTimeout(function() {
+                AiOS_HELPER.mostRecentWindow.aiosIsWindow = false;
+            }, 500);
+
+            var winID = "aiosContextEventWindow_" + cmdObj.getAttribute('aios_sbCmd');
+            var winSRC = cmdObj.getAttribute('aios_sbUri');
+            var winWidth = (screen.availWidth >= 900) ? 800 : screen.availWidth/2;
+            var winHeight = (screen.availHeight >= 700) ? 600 : screen.availHeight/2;
+            toOpenWindowByType(winID, winSRC, "width="+winWidth+",height="+winHeight+",chrome,titlebar,toolbar,resizable,centerscreen,dialog=no");
+
+            break;
+
+        case "tab":
+            aios_addTab(cmdObj.getAttribute('aios_sbUri'));
+            break;
+    }
+
+    return true;
+}
+
+
+/*
+    legt commands fuer Fenster fest, die lt. Einstellungen in der Sidebar geoeffnet werden sollen
+        => dynamisch per JS, damit keinerlei Veraenderungen vorgenommen werden, wenn es nicht in der Sidebar geoeffnet werden soll
+                => bessere Kompatibilitaet mit anderen Erweiterungen
+        => Aufruf durch aios_initSidebar()
+*/
+function aios_setTargets() {
+    var objects, i;
+
+    // weise den Menueelementen der Fehlerkonsole, des Seitenquelltextes und der Seiteninformationen die entsprechenden commands zu
+    document.getElementById('javascriptConsole').removeAttribute('oncommand');
+    document.getElementById('javascriptConsole').setAttribute('command', 'Tools:Console');
+
+    if(document.getElementById('key_errorConsole')) {
+        document.getElementById('key_errorConsole').removeAttribute('oncommand');
+        document.getElementById('key_errorConsole').setAttribute('command', 'Tools:Console');
+    }
+
+    document.getElementById('context-viewinfo').removeAttribute('oncommand');
+    document.getElementById('context-viewinfo').setAttribute('command', 'View:PageInfo');
+
+
+    var targets = new Array();
+    targets['bm'] = new Array('View:Bookmarks',     'viewBookmarksSidebar',     'bookmarks');
+    targets['hi'] = new Array('View:History',       'viewHistorySidebar',       'history');
+    targets['dm'] = new Array('Tools:Downloads',    'viewDownloadsSidebar',     'downloads');
+    targets['ad'] = new Array('Tools:Addons',       'viewAddonsSidebar',        'addons');
+    targets['mp'] = new Array('Tools:MultiPanel',   'viewWebPanelsSidebar',     'multipanel');
+    targets['pi'] = new Array('View:PageInfo',      'viewPageInfoSidebar',      'pageinfo');
+    targets['co'] = new Array('Tools:Console',      'viewConsoleSidebar',       'console');
+
+    if(document.getElementById('viewConsole2Sidebar'))
+        targets['co'] = new Array('Tools:Console', 'viewConsole2Sidebar', 'console');
+
+    // informative Tooltips und Funktionsumkehrung (PanelTab) aktivieren?
+    var prefInfotip = false;
+    var ptReverse = false;
+    try {
+        prefInfotip = AiOS_HELPER.prefBranchAiOS.getBoolPref("infotips");
+        ptReverse = AiOS_HELPER.prefBranchAiOS.getBoolPref("paneltab.reverse");
+
+        if(prefInfotip) {
+            if(elem_switch) elem_switch.removeAttribute('tooltiptext');
+
+            //if(document.getElementById('paneltab-button')) document.getElementById('paneltab-button').removeAttribute('tooltiptext');
+            // in Schleife, weil es mehrere Buttons mit der gleichen ID geben kann
+            objects = document.getElementsByAttribute('id', 'paneltab-button');
+            for(i = 0; i < objects.length; i++) {
+                objects[i].removeAttribute('tooltiptext');
+            }
+        }
+
+        if(document.getElementById('paneltab-button')) {
+            if(ptReverse) document.getElementById('paneltab-button').setAttribute('tooltip', 'paneltab-tooltip-reverse');
+            else document.getElementById('paneltab-button').setAttribute('tooltip', 'paneltab-tooltip');
+        }
+    }
+    catch(e) { }
+
+    for(var obj in targets) {
+        // in Sidebar oeffnen?
+        var prefSidebar;
+        try {
+            if(obj != "ad") prefSidebar = AiOS_HELPER.prefBranchAiOS.getBoolPref(obj + ".sidebar");
+            else prefSidebar = AiOS_HELPER.prefBranchAiOS.getBoolPref("em.sidebar");
+
+            var enable_rightclick = AiOS_HELPER.prefBranchAiOS.getBoolPref("rightclick");
+        }
+        catch(e) { }
+
+        var ffObj = document.getElementById(targets[obj][0]);           // Original-Objekt
+        var sbObj = document.getElementById(targets[obj][1]);           // Sidebar-Objekt
+        var tpObj = document.getElementById(targets[obj][2] + "-tooltip");  // Tooltip
+        var btObj = document.getElementById(targets[obj][2] + "-button");   // Button
+
+        if(ffObj && sbObj) {
+
+            var newObj, newCmd, newTp;
+
+            if(prefSidebar) {
+                newObj = sbObj;
+                newTp = document.getElementById('template-sidebar-tooltip').childNodes[0].cloneNode(true);
+            }
+            else {
+                newObj = ffObj;
+                newTp = document.getElementById('template-window-tooltip').childNodes[0].cloneNode(true);
+            }
+
+            newCmd = newObj.getAttribute('oncommand');
+
+            // verhindern dass zwei Befehle ausgefuehrt werden, wenn eine Taste mitgedrueckt wird
+            newCmd = "if(aios_preventDblCmd(event)) " + newCmd + " return true;";
+
+            // Befehl zuweisen
+            ffObj.setAttribute('oncommand', newCmd);
+
+
+            // Befehle merken
+            //  => fuer Context-Funktionen - aios_contextEvent() - abfragbar
+            //  => zuweisbar, wenn nicht mehr in Sidebar geoeffnet werden soll
+            if(!aios_getBoolean(ffObj, 'modByAIOS')) {
+                // fuer Klicks auf Toolbarbuttons und Menueeintraege
+                ffObj.setAttribute('aios_sbUri', sbObj.getAttribute('sidebarurl'));
+                ffObj.setAttribute('aios_sbCmd', targets[obj][1]);
+                ffObj.setAttribute('aios_inSidebar', prefSidebar);
+
+                // fuer Klicks auf Menueeintraege in den Sidebarmenues => siehe aios_preventDblCmd()
+                sbObj.setAttribute('aios_sbUri', sbObj.getAttribute('sidebarurl'));
+                sbObj.setAttribute('oncommand', "if(aios_preventDblCmd(event)) " + sbObj.getAttribute('oncommand'));
+            }
+
+
+            // Tooltiptext entfernen, um Info-Tooltips sichtbar zu machen (in Schleife, weil es mehrere Buttons mit der gleichen ID geben kann)
+            //if(prefInfotip && btObj) btObj.removeAttribute('tooltiptext');
+            if(prefInfotip && btObj) {
+                objects = document.getElementsByAttribute('id', btObj.id);
+                for(i = 0; i < objects.length; i++) {
+                    objects[i].removeAttribute('tooltiptext');
+                }
+            }
+
+            // "alte" Tooltip-Zeilen entfernen (sonst werden sie mit jedem Funktionsaufruf zusaetzlich eingefuegt)
+            if(tpObj.childNodes.length > 1) tpObj.removeChild(tpObj.childNodes[1]);
+
+            // Rechtsklick im Tooltip aktivieren
+            if(enable_rightclick)
+                newTp.setAttribute('r3c2', newTp.getAttribute('r3c2') + newTp.getAttribute('rightclick'));
+
+            // Tooltip zuweisen
+            tpObj.appendChild(newTp);
+
+            // Kontext-Menue der Toolbarbuttons deaktivieren, wenn Rechtsklick erlaubt ist
+            if(btObj && enable_rightclick) btObj.setAttribute('context', '');
+
+            ffObj.setAttribute('modByAIOS', true);
+        }
+    }
+
+    // Kontext-Menue des PanelTab buttons deaktivieren, wenn Rechtsklick erlaubt ist
+    if(enable_rightclick && document.getElementById('paneltab-button')) {
+        document.getElementById('paneltab-button').setAttribute('context', '');
+        var pttt1 = document.getElementById('paneltab-tooltip').firstChild;
+        var pttt2 = document.getElementById('paneltab-tooltip-reverse').firstChild;
+
+        if(pttt1.getAttribute('r3c2').indexOf(pttt1.getAttribute('rightclick')) == -1) {
+            pttt1.setAttribute('r3c2', pttt1.getAttribute('r3c2') + pttt1.getAttribute('rightclick'));
+        }
+        if(pttt2.getAttribute('r3c2').indexOf(pttt2.getAttribute('rightclick')) == -1) {
+            pttt2.setAttribute('r3c2', pttt2.getAttribute('r3c2') + pttt2.getAttribute('rightclick'));
+        }
+    }
+
+
+    // Oeffnen des Download-Fensters verhindern, wenn die Sidebar genutzt werden soll
+    if(AiOS_HELPER.prefBranchAiOS.getBoolPref('dm.sidebar')) AiOS_HELPER.prefService.setBoolPref("browser.download.manager.showWhenStarting", false);
+
+
+    // Download-Observer hinzufuegen, falls Downloads in der Sidebar geoeffnet werden sollen
+    var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
+
+    observerService.addObserver(aios_DownloadObserver, "dl-start",  false);
+    observerService.addObserver(aios_DownloadObserver, "dl-done",  false);
+
+    // Observer beim Schliessen des Fensters wieder loeschen
+    window.addEventListener("unload", function() {
+        if(aios_DownloadObserver) {
+            var aios_myOs = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
+            aios_myOs.removeObserver(aios_DownloadObserver, "dl-start");
+            aios_myOs.removeObserver(aios_DownloadObserver, "dl-done");
+            aios_DownloadObserver = null;
+        }
+
+    }, false);
+
+
+
+    return true;
+}
+
+/*
+    Oeffnet die Sidebar,
+        1. wenn ein Download gestartet wird ...
+        2. der Manager geoeffnet werden soll und ...
+        3. das Ziel die Sidebar sein soll
+*/
+var aios_DownloadObserver = {
+    observe: function (aSubject, aTopic, aState) {
+
+        var autoOpen = AiOS_HELPER.prefBranchAiOS.getBoolPref('dm.autoopen');
+        var autoClose = AiOS_HELPER.prefBranchAiOS.getBoolPref('dm.autoclose');
+        var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation).QueryInterface(Components.interfaces.nsIDocShellTreeItem).rootTreeItem.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow);
+
+        switch (aTopic) {
+            case "dl-start":
+                var comElem = document.getElementById('Tools:Downloads');
+                if(autoOpen && comElem.getAttribute('oncommand').indexOf('viewDownloadsSidebar') >= 0) {
+                    // AiOS_HELPER.windowWatcher.activeWindow verhindert, dass die Sidebar in jedem Fenster geoeffnet wird
+                    if(typeof AiOS_HELPER.windowWatcher.activeWindow.toggleSidebar == "function") AiOS_HELPER.windowWatcher.activeWindow.toggleSidebar("viewDownloadsSidebar", true);
+                }
+                break;
+
+            case "dl-done":
+                var sideSrc = document.getElementById('sidebar').getAttribute('src');
+                if(autoOpen && autoClose && sideSrc.indexOf('downloads.xul') >= 0) {
+                    if(typeof AiOS_HELPER.windowWatcher.activeWindow.toggleSidebar == "function") AiOS_HELPER.windowWatcher.activeWindow.toggleSidebar();
+                }
+                break;
+        }
+    }
+};
+
+
+/*
+  verhindert, dass bei Klick + Shift oder Strg der normale Command-Befehl und die Doppelfunktion ausgefuehrt wird
+    => Aufruf durch die
+*/
+function aios_preventDblCmd(ev) {
+    // metaKey = Mac
+    if(ev.shiftKey || ev.ctrlKey || ev.metaKey) {
+        if(ev.explicitOriginalTarget.tagName == 'toolbarbutton' || ev.explicitOriginalTarget.tagName == 'menuitem') return false;
+    }
+    return true;
+}
+
+
+/*
+    prueft, ob das Browserfenster maximiert ist oder sich im Vollbildmodus befindet
+        => Aufruf durch aios_checkThinSwitch()
+*/
+function aios_isWinMax() {
+    var windowMax = document.getElementById('main-window').getAttribute('sizemode') == "maximized";
+
+    var maxWidth = window.outerWidth > screen.availWidth;
+    var maxHeight = window.outerHeight > screen.availHeight;
+    if((maxWidth && maxHeight) || window.fullScreen) windowMax = true;
+
+    return windowMax;
+}
+
+
+/*
+    prueft, ob die Sidebar gerade sichtbar/unsichtbar ist => abhaengig von der Sidebar-Methode
+*/
+function aios_isSidebarHidden() {
+    aios_getObjects();
+
+    try {
+        var aios_collapseSidebar = AiOS_HELPER.prefBranchAiOS.getBoolPref('collapse');
+    }
+    catch(e) { }
+
+    // CollapseByStyle-Methode if(aios_collapseSidebar) return (fx_sidebarBox.hidden || fx_sidebarBox.getAttribute('style') != "");
+    if(aios_collapseSidebar) return (fx_sidebarBox.hidden || fx_sidebarBox.collapsed);
+    else return fx_sidebarBox.hidden;
+}
+
+
+/*
+    Autohide-Feature initialisieren
+        => Aufruf durch aios_initSidebar() und aios_savePrefs()
+*/
+var aiosFocus = true;
+function aios_initAutohide() {
+    // Zustand des Autohide-Buttons einstellen
+    document.getElementById('aios-enableAutohide').setAttribute('checked', AiOS_HELPER.prefBranchAiOS.getBoolPref("gen.switch.autoshow"));
+
+    // Autohide-Feature-Funktion hinzufuegen
+    fx_sidebarBox.addEventListener("mouseover", function() {
+        if(document.getElementById('appcontent'))
+            document.getElementById('appcontent').addEventListener("mouseover", aios_autoShowHide, true);
+    }, true);
+
+    window.addEventListener("focus", function(e) {
+        aiosFocus = true;
+    }, true);
+    window.addEventListener("blur", function(e) {
+        aiosFocus = false;
+    }, true);
+}
+
+
+/*
+    Autohide ein- bzw. ausschalten per Toolbarbutton
+        => Aufruf durch broadcaster 'aios-enableAutohide'
+*/
+function aios_toggleAutohide(which) {
+    try {
+        AiOS_HELPER.prefBranchAiOS.setBoolPref("gen.switch.autoshow", aios_getBoolean(which, 'checked'));
+    }
+    catch(e) { }
 }
\ No newline at end of file
diff --git a/content/aios.js b/content/aios.js
index 4db01a3..6fbc670 100644
--- a/content/aios.js
+++ b/content/aios.js
@@ -1,95 +1,95 @@
-var AiOS = {
-
-    mainWindow: document.getElementById('main-window'),
-
-
-    initOnDOMLoaded: function() {
-
-        AiOS_HELPER.rememberAppInfo( AiOS.mainWindow );
-
-    },
-
-
-    // initOnLoad: function() {
-
-    // },
-
-
-    beforeCustomization: function() {
-
-        var toolbars = new Array(AiOS_HELPER.aiosToolbar, AiOS_HELPER.sbhToolbar);
-
-        PlacesToolbarHelper.customizeStart();
-
-        for(var i in toolbars) {
-
-            toolbars[i].setAttribute('_toolbox', toolbars[i].parentNode.id);
-
-            toolbars[i].setAttribute('_context', toolbars[i].getAttribute('context'));
-            toolbars[i].setAttribute('context', 'toolbar-context-menu');
-            toolbars[i].setAttribute('_orient', toolbars[i].getAttribute('orient'));
-            toolbars[i].setAttribute('orient', 'horizontal');
-            toolbars[i].setAttribute('_mode', toolbars[i].getAttribute('mode'));
-            toolbars[i].setAttribute('mode', 'icons');
-
-            toolbars[i].setAttribute('align', 'center');
-
-            var label = document.createElement('label');
-            label.setAttribute('value', toolbars[i].getAttribute('toolbarlabel'));
-            toolbars[i].insertBefore(label, toolbars[i].firstChild);
-
-            gNavToolbox.appendChild(toolbars[i]);
-
-        }
-
-        PlacesToolbarHelper.customizeDone();
-
-    },
-
-
-    afterCustomization: function() {
-
-        var toolbars = new Array(AiOS_HELPER.aiosToolbar, AiOS_HELPER.sbhToolbar);
-
-        PlacesToolbarHelper.customizeStart();
-
-        for(var i in toolbars) {
-
-            toolbars[i].removeChild(toolbars[i].querySelector('label'));
-
-            toolbars[i].setAttribute('context', toolbars[i].getAttribute('_context'));
-            toolbars[i].removeAttribute('_context');
-            toolbars[i].setAttribute('orient', toolbars[i].getAttribute('_orient'));
-            toolbars[i].removeAttribute('_orient');
-            toolbars[i].setAttribute('mode', toolbars[i].getAttribute('_mode'));
-            toolbars[i].removeAttribute('_mode');
-
-            toolbars[i].removeAttribute('align');
-
-            document.getElementById(toolbars[i].getAttribute('_toolbox')).appendChild(toolbars[i]);
-            toolbars[i].removeAttribute('_toolbox');
-
-        }
-
-        PlacesToolbarHelper.customizeDone();
-
-    },
-
-
-    unload: function() {
-        window.removeEventListener("DOMContentLoaded", AiOS.initOnDOMLoaded);
-        //window.removeEventListener("load", AiOS.initOnLoad);
-        window.removeEventListener("unload", AiOS.unload);
-
-        gNavToolbox.removeEventListener("beforecustomization", AiOS.beforeCustomization);
-        gNavToolbox.removeEventListener("aftercustomization", AiOS.afterCustomization);
-    }
-
-};
-
-window.addEventListener("DOMContentLoaded", AiOS.initOnDOMLoaded, false);
-//window.addEventListener("load", AiOS.initOnLoad, false);
-window.addEventListener("unload", AiOS.unload, false);
-
-gNavToolbox.addEventListener("beforecustomization", AiOS.beforeCustomization, false);
+var AiOS = {
+
+    mainWindow: document.getElementById('main-window'),
+
+
+    initOnDOMLoaded: function() {
+
+        AiOS_HELPER.rememberAppInfo( AiOS.mainWindow );
+
+    },
+
+
+    // initOnLoad: function() {
+
+    // },
+
+
+    beforeCustomization: function() {
+
+        var toolbars = new Array(AiOS_HELPER.aiosToolbar, AiOS_HELPER.sbhToolbar);
+
+        PlacesToolbarHelper.customizeStart();
+
+        for(var i in toolbars) {
+
+            toolbars[i].setAttribute('_toolbox', toolbars[i].parentNode.id);
+
+            toolbars[i].setAttribute('_context', toolbars[i].getAttribute('context'));
+            toolbars[i].setAttribute('context', 'toolbar-context-menu');
+            toolbars[i].setAttribute('_orient', toolbars[i].getAttribute('orient'));
+            toolbars[i].setAttribute('orient', 'horizontal');
+            toolbars[i].setAttribute('_mode', toolbars[i].getAttribute('mode'));
+            toolbars[i].setAttribute('mode', 'icons');
+
+            toolbars[i].setAttribute('align', 'center');
+
+            var label = document.createElement('label');
+            label.setAttribute('value', toolbars[i].getAttribute('toolbarlabel'));
+            toolbars[i].insertBefore(label, toolbars[i].firstChild);
+
+            gNavToolbox.appendChild(toolbars[i]);
+
+        }
+
+        PlacesToolbarHelper.customizeDone();
+
+    },
+
+
+    afterCustomization: function() {
+
+        var toolbars = new Array(AiOS_HELPER.aiosToolbar, AiOS_HELPER.sbhToolbar);
+
+        PlacesToolbarHelper.customizeStart();
+
+        for(var i in toolbars) {
+
+            toolbars[i].removeChild(toolbars[i].querySelector('label'));
+
+            toolbars[i].setAttribute('context', toolbars[i].getAttribute('_context'));
+            toolbars[i].removeAttribute('_context');
+            toolbars[i].setAttribute('orient', toolbars[i].getAttribute('_orient'));
+            toolbars[i].removeAttribute('_orient');
+            toolbars[i].setAttribute('mode', toolbars[i].getAttribute('_mode'));
+            toolbars[i].removeAttribute('_mode');
+
+            toolbars[i].removeAttribute('align');
+
+            document.getElementById(toolbars[i].getAttribute('_toolbox')).appendChild(toolbars[i]);
+            toolbars[i].removeAttribute('_toolbox');
+
+        }
+
+        PlacesToolbarHelper.customizeDone();
+
+    },
+
+
+    unload: function() {
+        window.removeEventListener("DOMContentLoaded", AiOS.initOnDOMLoaded);
+        //window.removeEventListener("load", AiOS.initOnLoad);
+        window.removeEventListener("unload", AiOS.unload);
+
+        gNavToolbox.removeEventListener("beforecustomization", AiOS.beforeCustomization);
+        gNavToolbox.removeEventListener("aftercustomization", AiOS.afterCustomization);
+    }
+
+};
+
+window.addEventListener("DOMContentLoaded", AiOS.initOnDOMLoaded, false);
+//window.addEventListener("load", AiOS.initOnLoad, false);
+window.addEventListener("unload", AiOS.unload, false);
+
+gNavToolbox.addEventListener("beforecustomization", AiOS.beforeCustomization, false);
 gNavToolbox.addEventListener("aftercustomization", AiOS.afterCustomization, false);
\ No newline at end of file
diff --git a/content/aios.xul b/content/aios.xul
index fa911a4..068dfca 100644
--- a/content/aios.xul
+++ b/content/aios.xul
@@ -50,7 +50,7 @@
             ondragover="nsDragAndDrop.dragOver(event, DownloadsButtonDNDObserver); event.stopPropagation();"
             ondragenter="nsDragAndDrop.dragEnter(event, DownloadsButtonDNDObserver); event.stopPropagation();"
             ondragexit="nsDragAndDrop.dragExit(event, DownloadsButtonDNDObserver); event.stopPropagation();"
-            label="&downloads.label;" tooltiptext="&downloads.tooltip;" />
+            label="&downloads.label;" tooltiptext="&downloads.label;" />
 
         <broadcaster id="viewAddonsSidebar" autoCheck="false" type="checkbox" group="sidebar"
             sidebartitle="&button.addons.label;" sidebarurl="about:addons"
@@ -158,21 +158,21 @@
             tooltiptext="&sidebarCloseButton.tooltip;" label="&sidebarCloseButton.tooltip;" />
 
         <toolbarbutton id="bookmarks-button" class="toolbarbutton-1 chromeclass-toolbar-additional aios-tbutton"
-            label="&bookmarksButton.label;" tooltip="bookmarks-tooltip" tooltiptext="&bookmarksButton.tooltip;"
+            label="&bookmarksButton.label;" tooltip="bookmarks-tooltip" tooltiptext="&bookmarksButton.label;"
             command="View:Bookmarks">
             <observes element="viewBookmarksSidebar" attribute="checked" />
             <observes element="viewBookmarksSidebar" attribute="onclick" />
         </toolbarbutton>
 
         <toolbarbutton id="history-button" class="toolbarbutton-1 chromeclass-toolbar-additional aios-tbutton"
-            label="&historyButton.label;" tooltip="history-tooltip" tooltiptext="&historyButton.tooltip;"
+            label="&historyButton.label;" tooltip="history-tooltip" tooltiptext="&historyButton.label;"
             command="View:History">
             <observes element="viewHistorySidebar" attribute="checked" />
             <observes element="viewHistorySidebar" attribute="onclick" />
         </toolbarbutton>
 
         <toolbarbutton id="downloads-button" class="toolbarbutton-1 chromeclass-toolbar-additional aios-tbutton"
-            label="&downloads.label;" tooltip="downloads-tooltip" tooltiptext="&downloads.tooltip;"
+            label="&downloads.label;" tooltip="downloads-tooltip" tooltiptext="&downloads.label;"
             command="Tools:Downloads">
             <observes element="viewDownloadsSidebar" attribute="checked" />
             <observes element="viewDownloadsSidebar" attribute="onclick" />
@@ -359,15 +359,15 @@
             </tooltip>
 
             <tooltip id="bookmarks-tooltip">
-                <label value="&bookmarksButton.tooltip;" />
+                <label value="&bookmarksButton.label;" />
             </tooltip>
 
             <tooltip id="history-tooltip">
-                <label value="&historyButton.tooltip;" />
+                <label value="&historyButton.label;" />
             </tooltip>
 
             <tooltip id="downloads-tooltip">
-                <label value="&downloads.tooltip;" />
+                <label value="&downloads.label;" />
             </tooltip>
 
             <tooltip id="addons-tooltip">
diff --git a/content/aios_fx.js b/content/aios_fx.js
index dc19ec4..c9fcdd1 100644
--- a/content/aios_fx.js
+++ b/content/aios_fx.js
@@ -1,308 +1,308 @@
-/*
-if(aios_collapseSidebar) BrowserStartup = function() {
-  var uriToLoad = null;
-
-  // window.arguments[0]: URI to load (string), or an nsISupportsArray of
-  //                      nsISupportsStrings to load, or a xul:tab of
-  //                      a tabbrowser, which will be replaced by this
-  //                      window (for this case, all other arguments are
-  //                      ignored).
-  //                 [1]: character set (string)
-  //                 [2]: referrer (nsIURI)
-  //                 [3]: postData (nsIInputStream)
-  //                 [4]: allowThirdPartyFixup (bool)
-  if ("arguments" in window && window.arguments[0])
-    uriToLoad = window.arguments[0];
-
-  var isLoadingBlank = uriToLoad == "about:blank";
-  var mustLoadSidebar = false;
-
-  prepareForStartup();
-
-  if (uriToLoad && !isLoadingBlank) {
-    if (uriToLoad instanceof Ci.nsISupportsArray) {
-      let count = uriToLoad.Count();
-      let specs = [];
-      for (let i = 0; i < count; i++) {
-        let urisstring = uriToLoad.GetElementAt(i).QueryInterface(Ci.nsISupportsString);
-        specs.push(urisstring.data);
-      }
-
-      // This function throws for certain malformed URIs, so use exception handling
-      // so that we don't disrupt startup
-      try {
-        gBrowser.loadTabs(specs, false, true);
-      } catch (e) {}
-    }
-    else if (uriToLoad instanceof XULElement) {
-      // swap the given tab with the default about:blank tab and then close
-      // the original tab in the other window.
-
-      // Stop the about:blank load
-      gBrowser.stop();
-      // make sure it has a docshell
-      gBrowser.docShell;
-
-      gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, uriToLoad);
-    }
-    else if (window.arguments.length >= 3) {
-      loadURI(uriToLoad, window.arguments[2], window.arguments[3] || null,
-              window.arguments[4] || false);
-      content.focus();
-    }
-    // Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
-    // Such callers expect that window.arguments[0] is handled as a single URI.
-    else
-      loadOneOrMoreURIs(uriToLoad);
-  }
-
-  if (window.opener && !window.opener.closed) {
-    let openerSidebarBox = window.opener.document.getElementById("sidebar-box");
-    // If the opener had a sidebar, open the same sidebar in our window.
-    // The opener can be the hidden window too, if we're coming from the state
-    // where no windows are open, and the hidden window has no sidebar box.
-    // mod by exxile if (openerSidebarBox && !openerSidebarBox.hidden) {
-    // CollapseByStyle-Methode if (openerSidebarBox && !openerSidebarBox.hidden && openerSidebarBox.getAttribute('style') == "") {
-    if (openerSidebarBox && !openerSidebarBox.hidden && !openerSidebarBox.collapsed) {
-      let sidebarCmd = openerSidebarBox.getAttribute("sidebarcommand");
-      let sidebarCmdElem = document.getElementById(sidebarCmd);
-
-      // dynamically generated sidebars will fail this check.
-      if (sidebarCmdElem) {
-        let sidebarBox = document.getElementById("sidebar-box");
-        let sidebarTitle = document.getElementById("sidebar-title");
-
-        sidebarTitle.setAttribute(
-          "value", window.opener.document.getElementById("sidebar-title").getAttribute("value"));
-        sidebarBox.setAttribute("width", openerSidebarBox.boxObject.width);
-
-        sidebarBox.setAttribute("sidebarcommand", sidebarCmd);
-        // Note: we're setting 'src' on sidebarBox, which is a <vbox>, not on
-        // the <browser id="sidebar">. This lets us delay the actual load until
-        // delayedStartup().
-        sidebarBox.setAttribute(
-          "src", window.opener.document.getElementById("sidebar").getAttribute("src"));
-        mustLoadSidebar = true;
-
-        sidebarBox.hidden = false;
-        document.getElementById("sidebar-splitter").hidden = false;
-        sidebarCmdElem.setAttribute("checked", "true");
-      }
-    }
-  }
-  else {
-    let box = document.getElementById("sidebar-box");
-    if (box.hasAttribute("sidebarcommand")) {
-      let commandID = box.getAttribute("sidebarcommand");
-      if (commandID) {
-        let command = document.getElementById(commandID);
-        if (command) {
-          mustLoadSidebar = true;
-          box.hidden = false;
-          document.getElementById("sidebar-splitter").hidden = false;
-          command.setAttribute("checked", "true");
-        }
-        else {
-          // Remove the |sidebarcommand| attribute, because the element it
-          // refers to no longer exists, so we should assume this sidebar
-          // panel has been uninstalled. (249883)
-          box.removeAttribute("sidebarcommand");
-        }
-      }
-    }
-  }
-
-  // Certain kinds of automigration rely on this notification to complete their
-  // tasks BEFORE the browser window is shown.
-  Services.obs.notifyObservers(null, "browser-window-before-show", "");
-
-  // Set a sane starting width/height for all resolutions on new profiles.
-  if (!document.documentElement.hasAttribute("width")) {
-    let defaultWidth = 994;
-    let defaultHeight;
-    if (screen.availHeight <= 600) {
-      document.documentElement.setAttribute("sizemode", "maximized");
-      defaultWidth = 610;
-      defaultHeight = 450;
-    }
-    else {
-      // Create a narrower window for large or wide-aspect displays, to suggest
-      // side-by-side page view.
-      if (screen.availWidth >= 1600)
-        defaultWidth = (screen.availWidth / 2) - 20;
-      defaultHeight = screen.availHeight - 10;
-//@line 1344 "e:\builds\moz2_slave\rel-m-beta-w32-bld\build\browser\base\content\browser.js"
-    }
-    document.documentElement.setAttribute("width", defaultWidth);
-    document.documentElement.setAttribute("height", defaultHeight);
-  }
-
-  if (!gShowPageResizers)
-    document.getElementById("status-bar").setAttribute("hideresizer", "true");
-
-  if (!window.toolbar.visible) {
-    // adjust browser UI for popups
-    if (gURLBar) {
-      gURLBar.setAttribute("readonly", "true");
-      gURLBar.setAttribute("enablehistory", "false");
-    }
-    goSetCommandEnabled("cmd_newNavigatorTab", false);
-  }
-
-//@line 1362 "e:\builds\moz2_slave\rel-m-beta-w32-bld\build\browser\base\content\browser.js"
-    //mod by exxile: updateAppButtonDisplay();
-    if(AiOS_HELPER.os != "Darwin") updateAppButtonDisplay();
-//@line 1364 "e:\builds\moz2_slave\rel-m-beta-w32-bld\build\browser\base\content\browser.js"
-
-  CombinedStopReload.init();
-
-  allTabs.readPref();
-
-  // mod by exxile: init >= Fx 12, syncCommand <= Fx 11
-  (typeof TabsOnTop.init == "function") ? TabsOnTop.init() : TabsOnTop.syncCommand();
-
-  BookmarksMenuButton.init();
-
-  TabsInTitlebar.init();
-
-  gPrivateBrowsingUI.init();
-
-  retrieveToolbarIconsizesFromTheme();
-
-  gDelayedStartupTimeoutId = window.setTimeout(function() {
-      delayedStartup(isLoadingBlank, mustLoadSidebar);
-  }, 0);
-
-  gStartupRan = true;
-}
-*/
-
-
-/*
-  from chrome://browser/content/browser.js
-*/
-
-/**
- * Opens or closes the sidebar identified by commandID.
- *
- * @param commandID a string identifying the sidebar to toggle; see the
- *                  note below. (Optional if a sidebar is already open.)
- * @param forceOpen boolean indicating whether the sidebar should be
- *                  opened regardless of its current state (optional).
- * @note
- * We expect to find a xul:broadcaster element with the specified ID.
- * The following attributes on that element may be used and/or modified:
- *  - id           (required) the string to match commandID. The convention
- *                 is to use this naming scheme: 'view<sidebar-name>Sidebar'.
- *  - sidebarurl   (required) specifies the URL to load in this sidebar.
- *  - sidebartitle or label (in that order) specify the title to
- *                 display on the sidebar.
- *  - checked      indicates whether the sidebar is currently displayed.
- *                 Note that toggleSidebar updates this attribute when
- *                 it changes the sidebar's visibility.
- *  - group        this attribute must be set to "sidebar".
- */
-// modified by exxile
-//    => original: function toggleSidebar(commandID, forceOpen) {
-if(aios_collapseSidebar) toggleSidebar = function(commandID, forceOpen) {
-// end modified by exxile
-
-  var sidebarBox = document.getElementById("sidebar-box");
-  if (!commandID)
-    commandID = sidebarBox.getAttribute("sidebarcommand");
-
-  // added by exxile
-  //    => sonst gibt es Fehler bei der 2. Druckvorschau, wenn SidebarCollapsing aktiv ist und die Sidebar zugeklappt
-  //    => commandID ist in diesem Fall nicht definiert
-  if(!commandID) return;
-  // end added by exxile
-
-  var sidebarBroadcaster = document.getElementById(commandID);
-  var sidebar = document.getElementById("sidebar"); // xul:browser
-  var sidebarTitle = document.getElementById("sidebar-title");
-  var sidebarSplitter = document.getElementById("sidebar-splitter");
-
-  if (sidebarBroadcaster.getAttribute("checked") == "true") {
-    if (!forceOpen) {
-      // Replace the document currently displayed in the sidebar with about:blank
-      // so that we can free memory by unloading the page. We need to explicitly
-      // create a new content viewer because the old one doesn't get destroyed
-      // until about:blank has loaded (which does not happen as long as the
-      // element is hidden).
-      sidebar.setAttribute("src", "about:blank");
-      sidebar.docShell.createAboutBlankContentViewer(null);
-
-      sidebarBroadcaster.removeAttribute("checked");
-      sidebarBox.setAttribute("sidebarcommand", "");
-
-      // commented by exxile
-      // sidebarTitle.value = "";
-      // sidebarBox.hidden = true;
-      // end commented by exxile
-
-      // added by exxile
-      sidebarBox.removeAttribute('hidden');
-      sidebarBox.collapsed = true;
-      // CollapseByStyle-Methode sidebarBox.setAttribute('style', 'display:none;');
-      // end added by exxile
-
-      sidebarSplitter.hidden = true;
-      gBrowser.selectedBrowser.focus();
-    } else {
-      fireSidebarFocusedEvent();
-    }
-    return;
-  }
-
-  // now we need to show the specified sidebar
-
-  // ..but first update the 'checked' state of all sidebar broadcasters
-  var broadcasters = document.getElementsByAttribute("group", "sidebar");
-  for (let broadcaster of broadcasters) {
-    // skip elements that observe sidebar broadcasters and random
-    // other elements
-    if (broadcaster.localName != "broadcaster")
-      continue;
-
-    if (broadcaster != sidebarBroadcaster)
-      broadcaster.removeAttribute("checked");
-    else
-      sidebarBroadcaster.setAttribute("checked", "true");
-  }
-
-  // commented by exxile
-  // sidebarBox.hidden = false;
-  // end commented by exxile
-
-  // added by exxile
-  sidebarBox.removeAttribute('hidden');
-  sidebarBox.removeAttribute('collapsed');
-  // CollapseByStyle-Methode sidebarBox.removeAttribute('style');
-  // end added by exxile
-
-  sidebarSplitter.hidden = false;
-
-  var url = sidebarBroadcaster.getAttribute("sidebarurl");
-  var title = sidebarBroadcaster.getAttribute("sidebartitle");
-  if (!title)
-    title = sidebarBroadcaster.getAttribute("label");
-  sidebar.setAttribute("src", url); // kick off async load
-  sidebarBox.setAttribute("sidebarcommand", sidebarBroadcaster.id);
-  sidebarTitle.value = title;
-
-  // We set this attribute here in addition to setting it on the <browser>
-  // element itself, because the code in gBrowserInit.onUnload persists this
-  // attribute, not the "src" of the <browser id="sidebar">. The reason it
-  // does that is that we want to delay sidebar load a bit when a browser
-  // window opens. See delayedStartup().
-  sidebarBox.setAttribute("src", url);
-
-  if (sidebar.contentDocument.location.href != url)
-    sidebar.addEventListener("load", sidebarOnLoad, true);
-  else // older code handled this case, so we do it too
-    fireSidebarFocusedEvent();
-
-// modified by exxile
-//    => original: }
-};
+/*
+if(aios_collapseSidebar) BrowserStartup = function() {
+  var uriToLoad = null;
+
+  // window.arguments[0]: URI to load (string), or an nsISupportsArray of
+  //                      nsISupportsStrings to load, or a xul:tab of
+  //                      a tabbrowser, which will be replaced by this
+  //                      window (for this case, all other arguments are
+  //                      ignored).
+  //                 [1]: character set (string)
+  //                 [2]: referrer (nsIURI)
+  //                 [3]: postData (nsIInputStream)
+  //                 [4]: allowThirdPartyFixup (bool)
+  if ("arguments" in window && window.arguments[0])
+    uriToLoad = window.arguments[0];
+
+  var isLoadingBlank = uriToLoad == "about:blank";
+  var mustLoadSidebar = false;
+
+  prepareForStartup();
+
+  if (uriToLoad && !isLoadingBlank) {
+    if (uriToLoad instanceof Ci.nsISupportsArray) {
+      let count = uriToLoad.Count();
+      let specs = [];
+      for (let i = 0; i < count; i++) {
+        let urisstring = uriToLoad.GetElementAt(i).QueryInterface(Ci.nsISupportsString);
+        specs.push(urisstring.data);
+      }
+
+      // This function throws for certain malformed URIs, so use exception handling
+      // so that we don't disrupt startup
+      try {
+        gBrowser.loadTabs(specs, false, true);
+      } catch (e) {}
+    }
+    else if (uriToLoad instanceof XULElement) {
+      // swap the given tab with the default about:blank tab and then close
+      // the original tab in the other window.
+
+      // Stop the about:blank load
+      gBrowser.stop();
+      // make sure it has a docshell
+      gBrowser.docShell;
+
+      gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, uriToLoad);
+    }
+    else if (window.arguments.length >= 3) {
+      loadURI(uriToLoad, window.arguments[2], window.arguments[3] || null,
+              window.arguments[4] || false);
+      content.focus();
+    }
+    // Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
+    // Such callers expect that window.arguments[0] is handled as a single URI.
+    else
+      loadOneOrMoreURIs(uriToLoad);
+  }
+
+  if (window.opener && !window.opener.closed) {
+    let openerSidebarBox = window.opener.document.getElementById("sidebar-box");
+    // If the opener had a sidebar, open the same sidebar in our window.
+    // The opener can be the hidden window too, if we're coming from the state
+    // where no windows are open, and the hidden window has no sidebar box.
+    // mod by exxile if (openerSidebarBox && !openerSidebarBox.hidden) {
+    // CollapseByStyle-Methode if (openerSidebarBox && !openerSidebarBox.hidden && openerSidebarBox.getAttribute('style') == "") {
+    if (openerSidebarBox && !openerSidebarBox.hidden && !openerSidebarBox.collapsed) {
+      let sidebarCmd = openerSidebarBox.getAttribute("sidebarcommand");
+      let sidebarCmdElem = document.getElementById(sidebarCmd);
+
+      // dynamically generated sidebars will fail this check.
+      if (sidebarCmdElem) {
+        let sidebarBox = document.getElementById("sidebar-box");
+        let sidebarTitle = document.getElementById("sidebar-title");
+
+        sidebarTitle.setAttribute(
+          "value", window.opener.document.getElementById("sidebar-title").getAttribute("value"));
+        sidebarBox.setAttribute("width", openerSidebarBox.boxObject.width);
+
+        sidebarBox.setAttribute("sidebarcommand", sidebarCmd);
+        // Note: we're setting 'src' on sidebarBox, which is a <vbox>, not on
+        // the <browser id="sidebar">. This lets us delay the actual load until
+        // delayedStartup().
+        sidebarBox.setAttribute(
+          "src", window.opener.document.getElementById("sidebar").getAttribute("src"));
+        mustLoadSidebar = true;
+
+        sidebarBox.hidden = false;
+        document.getElementById("sidebar-splitter").hidden = false;
+        sidebarCmdElem.setAttribute("checked", "true");
+      }
+    }
+  }
+  else {
+    let box = document.getElementById("sidebar-box");
+    if (box.hasAttribute("sidebarcommand")) {
+      let commandID = box.getAttribute("sidebarcommand");
+      if (commandID) {
+        let command = document.getElementById(commandID);
+        if (command) {
+          mustLoadSidebar = true;
+          box.hidden = false;
+          document.getElementById("sidebar-splitter").hidden = false;
+          command.setAttribute("checked", "true");
+        }
+        else {
+          // Remove the |sidebarcommand| attribute, because the element it
+          // refers to no longer exists, so we should assume this sidebar
+          // panel has been uninstalled. (249883)
+          box.removeAttribute("sidebarcommand");
+        }
+      }
+    }
+  }
+
+  // Certain kinds of automigration rely on this notification to complete their
+  // tasks BEFORE the browser window is shown.
+  Services.obs.notifyObservers(null, "browser-window-before-show", "");
+
+  // Set a sane starting width/height for all resolutions on new profiles.
+  if (!document.documentElement.hasAttribute("width")) {
+    let defaultWidth = 994;
+    let defaultHeight;
+    if (screen.availHeight <= 600) {
+      document.documentElement.setAttribute("sizemode", "maximized");
+      defaultWidth = 610;
+      defaultHeight = 450;
+    }
+    else {
+      // Create a narrower window for large or wide-aspect displays, to suggest
+      // side-by-side page view.
+      if (screen.availWidth >= 1600)
+        defaultWidth = (screen.availWidth / 2) - 20;
+      defaultHeight = screen.availHeight - 10;
+//@line 1344 "e:\builds\moz2_slave\rel-m-beta-w32-bld\build\browser\base\content\browser.js"
+    }
+    document.documentElement.setAttribute("width", defaultWidth);
+    document.documentElement.setAttribute("height", defaultHeight);
+  }
+
+  if (!gShowPageResizers)
+    document.getElementById("status-bar").setAttribute("hideresizer", "true");
+
+  if (!window.toolbar.visible) {
+    // adjust browser UI for popups
+    if (gURLBar) {
+      gURLBar.setAttribute("readonly", "true");
+      gURLBar.setAttribute("enablehistory", "false");
+    }
+    goSetCommandEnabled("cmd_newNavigatorTab", false);
+  }
+
+//@line 1362 "e:\builds\moz2_slave\rel-m-beta-w32-bld\build\browser\base\content\browser.js"
+    //mod by exxile: updateAppButtonDisplay();
+    if(AiOS_HELPER.os != "Darwin") updateAppButtonDisplay();
+//@line 1364 "e:\builds\moz2_slave\rel-m-beta-w32-bld\build\browser\base\content\browser.js"
+
+  CombinedStopReload.init();
+
+  allTabs.readPref();
+
+  // mod by exxile: init >= Fx 12, syncCommand <= Fx 11
+  (typeof TabsOnTop.init == "function") ? TabsOnTop.init() : TabsOnTop.syncCommand();
+
+  BookmarksMenuButton.init();
+
+  TabsInTitlebar.init();
+
+  gPrivateBrowsingUI.init();
+
+  retrieveToolbarIconsizesFromTheme();
+
+  gDelayedStartupTimeoutId = window.setTimeout(function() {
+      delayedStartup(isLoadingBlank, mustLoadSidebar);
+  }, 0);
+
+  gStartupRan = true;
+}
+*/
+
+
+/*
+  from chrome://browser/content/browser.js
+*/
+
+/**
+ * Opens or closes the sidebar identified by commandID.
+ *
+ * @param commandID a string identifying the sidebar to toggle; see the
+ *                  note below. (Optional if a sidebar is already open.)
+ * @param forceOpen boolean indicating whether the sidebar should be
+ *                  opened regardless of its current state (optional).
+ * @note
+ * We expect to find a xul:broadcaster element with the specified ID.
+ * The following attributes on that element may be used and/or modified:
+ *  - id           (required) the string to match commandID. The convention
+ *                 is to use this naming scheme: 'view<sidebar-name>Sidebar'.
+ *  - sidebarurl   (required) specifies the URL to load in this sidebar.
+ *  - sidebartitle or label (in that order) specify the title to
+ *                 display on the sidebar.
+ *  - checked      indicates whether the sidebar is currently displayed.
+ *                 Note that toggleSidebar updates this attribute when
+ *                 it changes the sidebar's visibility.
+ *  - group        this attribute must be set to "sidebar".
+ */
+// modified by exxile
+//    => original: function toggleSidebar(commandID, forceOpen) {
+if(aios_collapseSidebar) toggleSidebar = function(commandID, forceOpen) {
+// end modified by exxile
+
+  var sidebarBox = document.getElementById("sidebar-box");
+  if (!commandID)
+    commandID = sidebarBox.getAttribute("sidebarcommand");
+
+  // added by exxile
+  //    => sonst gibt es Fehler bei der 2. Druckvorschau, wenn SidebarCollapsing aktiv ist und die Sidebar zugeklappt
+  //    => commandID ist in diesem Fall nicht definiert
+  if(!commandID) return;
+  // end added by exxile
+
+  var sidebarBroadcaster = document.getElementById(commandID);
+  var sidebar = document.getElementById("sidebar"); // xul:browser
+  var sidebarTitle = document.getElementById("sidebar-title");
+  var sidebarSplitter = document.getElementById("sidebar-splitter");
+
+  if (sidebarBroadcaster.getAttribute("checked") == "true") {
+    if (!forceOpen) {
+      // Replace the document currently displayed in the sidebar with about:blank
+      // so that we can free memory by unloading the page. We need to explicitly
+      // create a new content viewer because the old one doesn't get destroyed
+      // until about:blank has loaded (which does not happen as long as the
+      // element is hidden).
+      sidebar.setAttribute("src", "about:blank");
+      sidebar.docShell.createAboutBlankContentViewer(null);
+
+      sidebarBroadcaster.removeAttribute("checked");
+      sidebarBox.setAttribute("sidebarcommand", "");
+
+      // commented by exxile
+      // sidebarTitle.value = "";
+      // sidebarBox.hidden = true;
+      // end commented by exxile
+
+      // added by exxile
+      sidebarBox.removeAttribute('hidden');
+      sidebarBox.collapsed = true;
+      // CollapseByStyle-Methode sidebarBox.setAttribute('style', 'display:none;');
+      // end added by exxile
+
+      sidebarSplitter.hidden = true;
+      gBrowser.selectedBrowser.focus();
+    } else {
+      fireSidebarFocusedEvent();
+    }
+    return;
+  }
+
+  // now we need to show the specified sidebar
+
+  // ..but first update the 'checked' state of all sidebar broadcasters
+  var broadcasters = document.getElementsByAttribute("group", "sidebar");
+  for (let broadcaster of broadcasters) {
+    // skip elements that observe sidebar broadcasters and random
+    // other elements
+    if (broadcaster.localName != "broadcaster")
+      continue;
+
+    if (broadcaster != sidebarBroadcaster)
+      broadcaster.removeAttribute("checked");
+    else
+      sidebarBroadcaster.setAttribute("checked", "true");
+  }
+
+  // commented by exxile
+  // sidebarBox.hidden = false;
+  // end commented by exxile
+
+  // added by exxile
+  sidebarBox.removeAttribute('hidden');
+  sidebarBox.removeAttribute('collapsed');
+  // CollapseByStyle-Methode sidebarBox.removeAttribute('style');
+  // end added by exxile
+
+  sidebarSplitter.hidden = false;
+
+  var url = sidebarBroadcaster.getAttribute("sidebarurl");
+  var title = sidebarBroadcaster.getAttribute("sidebartitle");
+  if (!title)
+    title = sidebarBroadcaster.getAttribute("label");
+  sidebar.setAttribute("src", url); // kick off async load
+  sidebarBox.setAttribute("sidebarcommand", sidebarBroadcaster.id);
+  sidebarTitle.value = title;
+
+  // We set this attribute here in addition to setting it on the <browser>
+  // element itself, because the code in gBrowserInit.onUnload persists this
+  // attribute, not the "src" of the <browser id="sidebar">. The reason it
+  // does that is that we want to delay sidebar load a bit when a browser
+  // window opens. See delayedStartup().
+  sidebarBox.setAttribute("src", url);
+
+  if (sidebar.contentDocument.location.href != url)
+    sidebar.addEventListener("load", sidebarOnLoad, true);
+  else // older code handled this case, so we do it too
+    fireSidebarFocusedEvent();
+
+// modified by exxile
+//    => original: }
+};
 // end modified by exxile
\ No newline at end of file
diff --git a/content/aios_old.js b/content/aios_old.js
index 00ec1a0..dbeb337 100644
--- a/content/aios_old.js
+++ b/content/aios_old.js
@@ -1,816 +1,816 @@
-
-// dem Sidebarheader eine ID zuweisen => dann per CSS ansprechbar (bei load oder DOMContentLoaded zu spaet)
-//top.document.getElementById("sidebar-throbber").parentNode.setAttribute('id', 'sidebar-header');
-
-window.addEventListener("load", aios_initSidebar, false);
-window.addEventListener("resize", aios_checkThinSwitch, false);
-window.addEventListener("mozfullscreenchange", aios_BrowserFullScreen, false);
-
-// sonst werden neu definierte Shortcuts bei Browser-Neustart zurueckgesetzt
-extLoad.add(30, function() {
-    aiosKeyconfig.loadkeys(aiosKeyconfig.prefService.getCharPref("extensions.aios.keyconf.profile"));
-});
-
-var initialised = false;
-
-var fx_mainWindow, fx_browser, fx_sidebar, fx_sidebarBox, fx_sidebarHeader, fx_sidebarSplitter, fx_sidebarMenu, fx_maximizedWindow;
-var aios_toggleBox, aios_toggleBar, aios_toggleSwitchItem, aios_toggleToolbarItem, aios_toolbar;
-var elem_switch, elem_tbb, elem_key, elem_close, elem_close2;
-
-var aios_enterFullScreen = 0;
-var aios_leaveFullScreen = 0;
-
-// Sidebar nur zusammenklappen statt schliessen
-var aios_collapseSidebar = AiOS_HELPER.prefBranchAiOS.getBoolPref('collapse');
-
-
-function aios_getObjects() {
-    try {
-        fx_mainWindow = document.getElementById('main-window');
-        fx_browser = document.getElementById('browser');
-        fx_sidebar = document.getElementById('sidebar');
-        fx_sidebarBox = document.getElementById('sidebar-box');
-        fx_sidebarHeader = document.getElementById('sidebar-header');
-        fx_sidebarSplitter = document.getElementById('sidebar-splitter');
-        fx_sidebarMenu = document.getElementById('viewSidebarMenu');
-
-        aios_toggleBox = document.getElementById('aios-toggle-toolbox');
-        aios_toggleBar = document.getElementById('aios-toggle-toolbar');
-
-        // broadcaster in aios.xul mit gespeichertem Wunsch-Toolbar-Zustand
-        //  => gespeichert durch onViewToolbarCommand() in tbx.js (AiOS < 0.7.7)
-        //  => gespeichert/gesetzt durch aios_toggleToolbar()
-        aios_toggleSwitchItem = document.getElementById('aios-viewTogglebar');
-        aios_toggleToolbarItem = document.getElementById('aios-viewToolbar');
-
-        aios_toolbar = document.getElementById('aios-toolbar');
-
-        elem_switch = document.getElementById('aios-toggle-button');
-        elem_tbb = document.getElementById('sidebars-togglebutton');
-        elem_key = document.getElementById('aiosKey_sidebar');
-        elem_close = document.getElementById('sidebarclose-button');
-        elem_close2 = document.getElementById('sbh-sidebarclose-button');
-    }
-    catch(e) { }
-}
-
-
-/*
-    Initialisierung
-        => Aufruf durch das onload-Event
-*/
-function aios_initSidebar() {
-    aios_getObjects();
-
-    // Toolbarbuttons in der Sidebarheader Toolbar ohne Button-Gedoens anzeigen
-    /*for(var i = 0; i < document.getElementById('aios-sbhtoolbar').childNodes.length; i++) {
-        aios_stripClass(document.getElementById('aios-sbhtoolbar').childNodes[i], 'toolbarbutton-1');
-    }*/
-
-    // MacOS X => Tastaturkuerzel ersetzen (Strg. wird durch Command ersetzt und Umschalt durch das Symbol dafuer)
-    if(AiOS_HELPER.os == "Darwin") {
-        aios_replaceKey('switch-tooltip-box', 'r2c2', 'command');
-        aios_replaceKey('template-sidebar-tooltip-box', 'r2c2', 'command');
-        aios_replaceKey('template-window-tooltip-box', 'r2c2', 'command');
-        aios_replaceKey('paneltab-tooltip-box', 'r2c2', 'command');
-        aios_replaceKey('paneltab-tooltip-reverse-box', 'r2c2', 'command');
-        aios_replaceKey('sidebarheader-tooltip-box', 'r3c2', 'command');
-
-        aios_replaceKey('switch-tooltip-box', 'r3c2', 'shift');
-        aios_replaceKey('template-sidebar-tooltip-box', 'r3c2', 'shift');
-        aios_replaceKey('template-window-tooltip-box', 'r3c2', 'shift');
-        aios_replaceKey('paneltab-tooltip-box', 'r3c2', 'shift');
-        aios_replaceKey('paneltab-tooltip-reverse-box', 'r3c2', 'shift');
-        aios_replaceKey('sidebarheader-tooltip-box', 'r1c2', 'shift');
-    }
-
-    // Sidebar li. oder re.
-    // Eigenschaftenzuweisung fuer CSS (LTR <=> RTL; Sidebar links <=> rechts)
-    aios_setSidebarOrient();
-
-    // beim ersten Start (bzw. nach loeschen der localstore.rdf) => ...
-    if(!aios_getBoolean(fx_sidebarBox, 'aiosInit')) {
-        // Icongroesse an die der Nav-Toolbar anpassen
-        fx_sidebarBox.setAttribute('aiosInit', true);
-        document.persist(fx_sidebarBox.id, 'aiosInit');
-
-        if(aios_toolbar) aios_toolbar.setAttribute('iconsize', document.getElementById('nav-bar').getAttribute('iconsize'));
-
-        // Sidebar-Breite nach Konfiguration festsetzen
-        aios_setConfSidebarWidth();
-    }
-
-
-    // Sidebarheader-Symbolleiste aus der Navigations-Symbolleiste in den Sidebarheader verschieben
-    // wenn die Symbolleiste gleich im Header waere, wuerden keine Icons angezeigt werden, wenn die Sidebar beim Start geschlossen ist
-    //document.getElementById('aios-sbhtoolbox').appendChild(document.getElementById('aios-sbhtoolbar'));
-
-
-    // legt commands (Ziele) fuer Manager und Fenster lt. Einstellungen fest
-    window.setTimeout(function() {
-        aios_setTargets();
-    }, 50);
-
-    // Autohide-Feature initialisieren
-    aios_initAutohide();
-
-
-    // Sidebar nur zusammenklappen statt schliessen
-    var lp;
-    if(aios_collapseSidebar) {
-
-        // in jedem Fall das Hidden-Attribut zuruecksetzen
-        document.getElementById('sidebar-box').setAttribute('hidden', false);
-
-        // wenn die Sidebar beim Start nicht geoeffnet sein soll
-        // neues bzw. weiteres Fenster
-        if(window.opener) {
-
-            fx_sidebarBox.setAttribute('collapsed', window.opener.document.getElementById('sidebar-box').getAttribute('collapsed'));
-
-            /* CollapseByStyle-Methode
-            if(window.opener.document.getElementById('sidebar-box').getAttribute('style') != "")
-                fx_sidebarBox.setAttribute('style', 'display:none;');
-            else
-                fx_sidebarBox.removeAttribute('style');*/
-
-            aios_toolbar.setAttribute('hidden', window.opener.document.getElementById('aios-toolbar').getAttribute('hidden'));
-        }
-        // Browserstart
-        else {
-            //alert(aios_getBoolean('main-window', 'aiosOpen'));
-            if(!aios_getBoolean('main-window', 'aiosOpen')) {
-                fx_sidebarBox.setAttribute('collapsed', true);
-                // CollapseByStyle-Methode fx_sidebarBox.setAttribute('style', 'display:none;');
-                fx_sidebarSplitter.setAttribute('hidden', true);
-            }
-        }
-
-        // sonst ist nach Deaktivieren/Aktivieren die Sidebar sichtbar aber leer
-        lp = document.getElementById('sidebar-box').getAttribute("aiosLastPanel");
-        if(aios_getBoolean(document.getElementById('main-window'), 'aiosOpen') && lp != "") {
-            toggleSidebar(lp, true);
-            document.getElementById('sidebar-splitter').hidden = false;
-            document.getElementById('sidebar-splitter').setAttribute('state', 'open');
-        }
-    }
-
-    // wenn es keine zuletzt geoeffnete Sidebar gibt oder diese nicht mehr existiert, dann nimm die Bookmarks
-    lp = fx_sidebarBox.getAttribute("aiosLastPanel");
-    if(!lp || (lp && !document.getElementById(lp))) {
-        fx_sidebarBox.setAttribute("aiosLastPanel", "viewBookmarksSidebar");
-        document.persist(fx_sidebarBox.id, "aiosLastPanel");
-    }
-
-    // Sidebar, Toolbar u. Switch beim Start gem. Einstellungen
-    try {
-        var sidebarInit = AiOS_HELPER.prefBranchAiOS.getCharPref('gen.init');
-        var toolbarInit = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.toolbar.init');
-        var switchInit = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.switch.init');
-
-        // Sidebar beim Start oeffnen
-        if(sidebarInit == "open") toggleSidebar(fx_sidebarBox.getAttribute('aiosLastPanel'), true);
-
-        // Sidebar beim Start schliessen
-        if(sidebarInit == "close" && !aios_isSidebarHidden()) {
-            toggleSidebar();
-            if(aios_collapseSidebar) {
-                document.getElementById('sidebar-box').setAttribute('collapsed', true);
-                // CollapseByStyle-Methode document.getElementById('sidebar-box').setAttribute('style', 'display:none;');
-            }
-        }
-
-        // bestimmte Sidebar beim Start oeffnen
-        if(sidebarInit != "rem" && sidebarInit != "open" && sidebarInit != "close") {
-            if(document.getElementById(sidebarInit)) toggleSidebar(sidebarInit, true);
-        }
-
-        if(toolbarInit != 2) aios_toolbar.setAttribute('hidden', !toolbarInit);
-        if(switchInit != 2) aios_toggleBox.setAttribute('hidden', !switchInit);
-    }
-    catch(e) { }
-
-    // bei Doppelklick die Standardgroesse der Sidebar einstellen
-    var fx_sidebarheader = document.getElementsByTagName('sidebarheader')[0];
-    fx_sidebarheader.addEventListener("dblclick", function(e) {
-        aios_setSidebarWidth(e);
-    }, false);
-
-    // Sidebars-Menue ueberwachen - noetig fuer den Fall, dass ein erster Aufruf durch das View-Menue erfolgt
-    //fx_sidebarMenu.addEventListener('popupshowing', aios_modSidebarMenu, false);
-
-    // Sidebar-Ladezustand ueberwachen
-    /*document.getElementById('sidebar').addProgressListener(aiosSBListener, Components.interfaces.nsIWebProgress.NOTIFY_STATE_DOCUMENT);*/
-
-    // Drag&Drop-Funktion fuer den Sidebar-Umschalter deaktivieren?
-    try {
-        var switchDrag = AiOS_HELPER.prefBranchAiOS.getBoolPref("gen.switch.drag");
-        var switchDelay = AiOS_HELPER.prefBranchAiOS.getIntPref("gen.switch.delay");
-
-        if(!switchDrag) elem_switch.removeAttribute('ondragenter');
-    }
-    catch(e) { }
-
-    // Changelog anzeigen?
-    try {
-        var changelog = AiOS_HELPER.prefBranchAiOS.getCharPref('changelog');
-    }
-    catch(e) { }
-
-    // mit einer manuell gesetzten 0 laesst sich das abschalten
-    if(parseFloat(changelog) != 0) {
-
-        Components.utils.import("resource://gre/modules/AddonManager.jsm");
-
-        AddonManager.getAddonByID("{097d3191-e6fa-4728-9826-b533d755359d}", function(addon) {
-            var aiosVersion = addon.version;
-
-            if(aiosVersion && (aiosVersion != changelog)) {
-
-                var aiosUpdated = (changelog != "") ? true : false;
-
-                try {
-                    AiOS_HELPER.prefBranchAiOS.setCharPref('changelog', aiosVersion);
-                    var changelog_new = AiOS_HELPER.prefBranchAiOS.getCharPref('changelog');
-                }
-                catch(e) { }
-
-                // wenn das speichern der aktuellen Version geklappt hat
-                if(changelog_new === aiosVersion && gBrowser) {
-                    var hp = "http://www.exxile.de/aios_installed.htm?v=" + aiosVersion;
-                    if(aiosUpdated) hp = "http://www.exxile.de/aios_updated.htm?v=" + aiosVersion;
-
-                    window.setTimeout(function() {
-                        gBrowser.loadTabs(new Array(hp), false);
-                    }, 500);
-                }
-            }
-        });
-    }
-
-    // vertikale Buttons?
-    try {
-        var vButtons = AiOS_HELPER.prefBranchAiOS.getBoolPref("vbuttons");
-
-        fx_mainWindow.setAttribute('aiosVButtons', 'true');
-        if(!vButtons) fx_mainWindow.setAttribute('aiosVButtons', 'false');
-        document.persist(fx_mainWindow.id, 'aiosVButtons');
-    }
-    catch(e) { }
-
-    // vertikale Bookmarkleiste?
-    // Attribut der Bookmarks-Leiste entfernen. Wenn sie auf der AiOS-Toolbar platziert wird, kann man per CSS die Orientation bestimmen.
-    if(document.getElementById('PlacesToolbarItems')) document.getElementById('PlacesToolbarItems').removeAttribute('orient');
-
-    initialised = true;
-}
-
-
-/*
-    stellt bei Doppelklick auf den Sidebarheader die Standardgroesse der Sidebar wieder her
-        => Aufruf durch EventListener auf dem Header, gesetzt in aios_initSidebar()
-*/
-function aios_setSidebarWidth(event) {
-    aios_getObjects();
-
-    var mode = "def";
-    if(event) {
-        if(event.shiftKey) mode = "min";
-        if(event.ctrlKey || event.metaKey) mode = "max";    // metaKey = Mac
-    }
-
-    try {
-        var sWidthVal = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.width.' + mode + 'Val');
-        var sWidthUnit = AiOS_HELPER.prefBranchAiOS.getCharPref('gen.width.' + mode + 'Unit');
-
-        if(sWidthUnit == "%") {
-            var browserWidth = aios_getBrowserWidth();
-            var compWidth = browserWidth[3];
-
-            sWidthVal = parseInt(Math.round((compWidth * sWidthVal) / 100));
-        }
-
-        // Sidebargoesse einstellen
-        fx_sidebarBox.setAttribute('width', sWidthVal);
-    }
-    catch(e) { }
-}
-
-
-/*
-stellt die Anzeige der Sidebar ein
-        => Aufruf durch aios_initSidebar() und aios_savePrefs() in prefs.js
-        => 1 = links, 2 = rechts
-*/
-function aios_setSidebarOrient() {
-    aios_getObjects();
-
-    try {
-        // Sidebar-Ausrichtung
-        var sidebarOrient = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.orient');
-        fx_mainWindow.setAttribute('aiosOrient', 'left');
-        if(sidebarOrient == 2) fx_mainWindow.setAttribute('aiosOrient', 'right');
-        //document.persist(fx_mainWindow.id, 'aiosOrient');
-
-        // Links-Rechts <=> Rechts-Links
-        //var cStyleWindow = document.defaultView.getComputedStyle(fx_mainWindow, '');
-        fx_mainWindow.setAttribute('aiosMode', 'ltr');
-        //if(typeof cStyleWindow === 'object' && typeof cStyleWindow.direction === 'string' && cStyleWindow.direction == "rtl") fx_mainWindow.setAttribute('aiosMode', 'rtl');
-        //document.persist(fx_mainWindow.id, 'aiosMode');
-
-        // Fix fuer MileWideBack
-        if(document.getElementById('back-strip') && sidebarOrient == 2) {
-            var mwb = document.getElementById('back-strip');
-            var mwbParent = document.getElementById('back-strip').parentNode;
-            mwbParent.removeChild(mwb);
-            mwbParent.appendChild(mwb);
-        }
-    }
-    catch(e) { }
-
-    aios_setToolbarPos();
-}
-
-
-/*
-    Sidebar-Status auf Veraenderungen ueberwachen
-        => Aufruf durch observes-Elemente (hidden und collapsed) in 'sidebar-box'
-*/
-function aios_observeSidebar(mode) {
-    aios_getObjects();
-
-    // fuer den Fall, dass vor dem Oeffnen die Toolbar ausgeblendet wurde (z.B. durch Switch im Opera-Modus)
-    var showToolbar = aios_getBoolean(aios_toggleToolbarItem, 'checked');
-    if(showToolbar && !aios_isSidebarHidden()) aios_toggleToolbar(false);
-
-    // fuer den Fall, dass vor dem Oeffnen der Switch ausgeblendet wurde (z.B. durch Startup-Verhalten)
-    var showSwitch = aios_getBoolean(aios_toggleSwitchItem, 'checked');
-    if(showSwitch && !aios_isSidebarHidden()) aios_toggleBox.setAttribute('hidden', false);
-
-    // Grippy-Status (CSS achtet auf Attribut 'aiosOpen')
-    fx_mainWindow.setAttribute('aiosOpen', !fx_sidebarBox.hidden && !fx_sidebarBox.collapsed);
-    // CollapseByStyle-Methode fx_mainWindow.setAttribute('aiosOpen', !fx_sidebarBox.hidden && fx_sidebarBox.getAttribute('style') == "");
-    document.persist(fx_mainWindow.id, 'aiosOpen');
-
-    // Toggle-Button-Status (Button achtet auf Attribut 'checked')
-    fx_sidebarBox.setAttribute('checked', !fx_sidebarBox.hidden && !fx_sidebarBox.collapsed);
-    // CollapseByStyle-Methode fx_sidebarBox.setAttribute('checked', !fx_sidebarBox.hidden && fx_sidebarBox.getAttribute('style') == "");
-
-    // fuer den Fall, dass vor dem Oeffnen der Grippy benutzt wurde...
-    if(mode == "hidden") {
-        fx_sidebarBox.removeAttribute('collapsed');
-        // CollapseByStyle-Methode fx_sidebarBox.removeAttribute('style');
-        fx_sidebarSplitter.removeAttribute('hidden');
-
-        fx_sidebarSplitter.setAttribute('state', 'open');
-    }
-}
-
-
-/*
-    Letzte Sidebar merken und als persist speichern
-        => Aufruf durch observes-Element in 'sidebar-box' und aios_modSidebarMenu()
-*/
-function aios_remLastSidebar() {
-    aios_getObjects();
-
-    var actSidebar = false;
-
-    // letzte Sidebar merken und speichern
-    var allSidebars = document.getElementsByAttribute('group', 'sidebar');
-    for(var i = 0; i < allSidebars.length; i++) {
-
-        // darf kein Element observen (Menueeintraege usw.), aber muss eine Sidebar-URL haben
-        if(!allSidebars[i].getAttribute('observes') && allSidebars[i].getAttribute('sidebarurl')) {
-
-            // muss eine ID haben und muss "checked" sein
-            if(allSidebars[i].getAttribute('id') && aios_getBoolean(allSidebars[i], 'checked')) {
-
-                // command in der "persist"-var "aiosLastPanel" speichern und zurueckgeben
-                fx_sidebarBox.setAttribute("aiosLastPanel", allSidebars[i].id);
-                document.persist(fx_sidebarBox.id, "aiosLastPanel");
-                actSidebar = allSidebars[i].id;
-
-            //fx_sidebarBox.setAttribute("sidebarcommand", allSidebars[i].id);
-            //document.persist(fx_sidebarBox.id, "sidebarcommand");
-
-            //fx_sidebarBox.setAttribute('src', fx_sidebar.getAttribute('src'));
-            //fx_sidebar.setAttribute('src', fx_sidebarBox.getAttribute('src'));
-            }
-        }
-    }
-
-    return actSidebar;
-}
-
-
-/*
-    toggelt die Sidebar im Opera-Verhalten
-        => Aufruf durch aios_toggleSidebar() fuer Elemente im Opera-Verhalten
-*/
-function aios_toggleOperaMode(aForcePanel, aForceOpen) {
-    aios_getObjects();
-
-    var showToolbar = aios_getBoolean(aios_toggleToolbarItem, 'checked');
-
-    // zu oeffnende Sidebar feststellen
-    var openPanel = fx_sidebarBox.getAttribute('aiosLastPanel');                        // zuletzt geoeffnete Sidebar
-    if(openPanel == "") openPanel = "viewBookmarksSidebar";                             // Lesezeichen wenn keine Sidebar geoeffnet war
-    if(aForcePanel) openPanel = aForcePanel;                                            // bestimmte Sidebar gewuenscht (bei jedem oeffnen)
-
-    // vertikaler Toolbar-Modus
-    if(aios_toolbar.orient == "vertical") {
-
-        // wenn die Toolbar sichtbar ist
-        if(!aios_getBoolean(aios_toolbar, 'hidden')) {
-
-            // wenn die Sidebar sichtbar ist
-            if(!aios_isSidebarHidden() && !aForceOpen) {
-                fx_sidebarBox.setAttribute("aiosShouldOpen", true);                         // Zustand der Sidebar merken (sichtbar)
-                document.persist(fx_sidebarBox.id, 'aiosShouldOpen');
-                toggleSidebar();                                                            // Sidebar ausblenden
-            }
-            else {
-                fx_sidebarBox.setAttribute("aiosShouldOpen", false);                        // Zustand der Sidebar merken (unsichtbar)
-                document.persist(fx_sidebarBox.id, 'aiosShouldOpen');
-            }
-
-            //aios_toolbar.setAttribute('hidden', true);
-            //if(!aForceOpen) onViewToolbarCommand(true);                                   // Toolbar ausblenden
-            if(!aForceOpen) aios_toggleToolbar(true);                                       // Toolbar ausblenden
-        }
-        // wenn die Toolbar nicht sichtbar ist
-        else {
-            if(showToolbar)                                                                 // Toolbar anzeigen?
-                aios_toggleToolbar(false);                                              // Toolbar einblenden
-            //onViewToolbarCommand(false);                                              // Toolbar einblenden
-            //aios_toolbar.setAttribute('hidden', false);
-
-            // wenn Sidebar angezeigt werden soll (Status vor dem letzten Schliessen) oder die Toolbar abgeschaltet wurde
-            if(aios_getBoolean(fx_sidebarBox, 'aiosShouldOpen') || !showToolbar) toggleSidebar(openPanel);
-        }
-    }
-    // horizontaler Toolbar-Modus
-    else {
-        // wenn die Sidebar sichtbar ist
-        if(!aios_isSidebarHidden()) {
-            fx_sidebarBox.setAttribute("aiosShouldOpen", true);                         // Zustand der Sidebar merken (sichtbar)
-            document.persist(fx_sidebarBox.id, 'aiosShouldOpen');
-            toggleSidebar();                                                            // Sidebar ausblenden
-        }
-        else {
-            if(lastPanel == "") toggleSidebar(openPanel);
-
-        //if(showToolbar) aios_toolbar.setAttribute('hidden', false);
-        }
-    }
-
-}
-
-
-/*
-    klont das Firefox-Sidebar-Menue fuer die Sidebars-Buttons
-        => Aufruf durch Menuebutton-Events 'onpopupshowing' aufgerufen
-*/
-function aios_getSidebarMenu(aPopup) {
-
-    aios_getObjects();
-
-    // Menue modifizieren (aktiven Menuepunkt deaktivieren, Ez Sidebar-Fix u.a.)
-    aios_modSidebarMenu();
-
-    /*var aios_sidebarMenu = fx_sidebarMenu.cloneNode(true);
-    aios_sidebarMenu.setAttribute('onpopupshowing', 'aios_getSidebarMenu(this);');
-    aPopup.parentNode.replaceChild(aios_sidebarMenu, aPopup);*/
-
-    while(aPopup.hasChildNodes()) {
-        aPopup.removeChild(aPopup.firstChild);
-    }
-
-    for(var i = 0; i < fx_sidebarMenu.childNodes.length; i++) {
-        aPopup.appendChild(fx_sidebarMenu.childNodes[i].cloneNode(true));
-    }
-}
-
-
-/*
-    schliesst die Sidebar, wenn die Maus den Content-Bereich ueberfaehrt
-        => Aufruf durch mouse-over des 'appcontent' und des Sidebar-Switches (mit Uebergabe von mode)
-
-        => aios_initSidebar() fuegt dem Object "sidebar-box" einen mouse-over-Event hinzu,...
-        => dieser mouse-over-Event fuegt dem "appcontent" einen mouse-over-Event hinzu,...
-        => der diese Funktion aufruft
-*/
-var aios_autoTimeout;
-function aios_autoShowHide(mode) {
-    //try {
-    var autobutton = aios_getBoolean('aios-enableAutohide', 'checked');
-
-    var autoshow = AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.autoshow');
-    var onlymax = AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.onlymax');
-    var delay = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.switch.delay');
-    var hidemethod = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.switch.hidemethod');
-
-    //alert(mode);
-
-    // Feature nicht aktiviert, Feature soll nur bei max. Fenster greifen, Fenster hat nicht den Focus
-    if(!autoshow || !autobutton || (onlymax && !aios_isWinMax()) || !aiosFocus) return false;
-
-    /*
-     *  Ausloesung durch den Umschalter
-     **/
-    if(mode == "switch") {
-        // wenn Sidebar sichtbar und nicht ausgeblendet werden soll => ignorieren
-        if(!aios_isSidebarHidden() && hidemethod == 1) return false;
-
-        // nach bestimmter Zeit ein-/ausblenden
-        aios_autoTimeout = window.setTimeout(function() {
-            aios_toggleSidebar('switch');
-        }, delay);
-
-        // timeout wieder loeschen, wenn die Maus zu kurz auf dem Umschalter war oder geklickt wurde
-        elem_switch.addEventListener("mouseout", function(){
-            window.clearTimeout(aios_autoTimeout);
-        }, true);
-        elem_switch.addEventListener("click", function(){
-            window.clearTimeout(aios_autoTimeout);
-        }, true);
-
-        return true;
-    }
-    /*
-     *  Ausloesung durch den Contentbereich
-     **/
-    else {
-
-        // wenn Sidebar sichtbar und ausgeblendet werden soll
-        // mode.originalTarget.parentNode.id != "" => behebt Kompatibilitaetsproblem mit TabSidebar (Sidebar wird bei Rollover des SidebarTabs ausgeblendet)
-
-        // macht scheinbar Probleme, weil der Event auf appcontent nicht (immer) geloescht wird => TabSidebar wird nicht weiterentwickelt
-        //if(!aios_isSidebarHidden() && hidemethod == 1 && mode.originalTarget.parentNode.id != "") {
-        if(!aios_isSidebarHidden() && hidemethod == 1) {
-
-            // Event auf "appcontent" wieder loeschen, weil sonst die Sidebar wieder eingeblendet wuerde
-            // => mouse-over der Sidebar (in aios_initSidebar()) fuegt dem "appcontent" dieses Feature wieder hinzu
-            document.getElementById('appcontent').removeEventListener("mouseover", aios_autoShowHide, true);
-
-            // nach bestimmter Zeit ausblenden
-            aios_autoTimeout = window.setTimeout(function() {
-                aios_toggleSidebar('switch');
-            }, delay);
-
-            // timeout wieder loeschen, wenn die Maus zurueck in die Sidebar kommt
-            fx_sidebarBox.addEventListener("mouseover", function(){
-                window.clearTimeout(aios_autoTimeout);
-            }, true);
-        }
-    }
-    //}
-    //catch(e) { }
-
-    return true;
-}
-
-
-/*
-    aktiviert/deaktiviert die Sidebar/Toolbar/Switch je nach Element und Einstellungen
-        => Aufruf durch Toggle-Button, Switch, Shortcut, Open/Close-Menuitems, Sidebar-Close-Button
-            => mode 1: nur die Sidebar oeffnen/schliessen
-            => mode 2: Sidebar und Toolbar oeffnen/schliessen
-            => mode 3: Sidebar, Toolbar und Togglebar oeffnen/schliessen
-            => mode 4: Opera-Verhalten
-*/
-function aios_toggleSidebar(aMode, aForceOpen) {
-    aios_getObjects();
-    //aForceOpen = false;           // erlaubt das automatische ein-/ausblenden waehrend Drag auf Sidebar Switch
-
-    var prefstring = "key";
-    if(aMode == elem_switch || aMode == "switch") prefstring = "switch";
-    if(aMode == elem_tbb || aMode == "tbb") prefstring = "tbb";
-    if(aMode == elem_close || aMode == elem_close2 || aMode == "close") prefstring = "close";
-
-    try {
-        var mode = AiOS_HELPER.prefBranchAiOS.getIntPref('cmode.' + prefstring);
-        var toolBox_enabled = aios_getBoolean('aios-viewToolbar', 'checked');
-        var toggleBox_enabled = aios_getBoolean(aios_toggleSwitchItem, 'checked');
-
-        // direkte Uebergabe per JavaScript z.B. per "Custom Buttons"
-        if(aMode === 1) mode = 1;
-        if(aMode === 2) mode = 2;
-        if(aMode === 3) mode = 3;
-        if(aMode === 4) mode = 4;
-
-
-        // bestimmtes Panel laden?
-        var forcePanel;
-        var openPanel = AiOS_HELPER.prefBranchAiOS.getCharPref("gen.open.init");
-        if(openPanel != "rem" && (prefstring == "key" || prefstring == "switch" || prefstring == "tbb")) forcePanel = openPanel;
-        else forcePanel = false;
-
-        if(mode == 4) {
-            aios_toggleOperaMode(forcePanel, aForceOpen);
-        }
-        else {
-            // wenn Sidebar Collpasing aktiviert ist...
-            // ein bestimmtes Panel grundsaetzlich geoeffnet werden soll...
-            // es aber noch nicht geoeffnet ist...
-            // die Sidebar aber noch geoeffnet ist...
-            // dann soll das Panel zwar geladen, die Sidebar aber dennoch geschlossen werden => reiner Performance-Zweck
-            if(aios_collapseSidebar && forcePanel && fx_sidebarBox.getAttribute('aiosLastPanel') != forcePanel && !aios_isSidebarHidden()) var closeNow = true;
-
-            var tmpcmd = (forcePanel) ? forcePanel : fx_sidebarBox.getAttribute('aiosLastPanel');
-            toggleSidebar(tmpcmd, aForceOpen);
-
-            // Sidebar schliessen, wenn die obigen Bedingungen erfuellt sind
-            if(closeNow) toggleSidebar(tmpcmd, aForceOpen);
-
-
-            if((mode == 2 || mode == 3) && toolBox_enabled) {
-                //aios_toolbar.setAttribute('hidden', aios_isSidebarHidden());
-                //onViewToolbarCommand(aios_isSidebarHidden());
-                aios_toggleToolbar(aios_isSidebarHidden());
-            }
-
-            if(mode == 3 && toggleBox_enabled)
-                aios_toggleBox.setAttribute('hidden', aios_isSidebarHidden());
-        }
-    }
-    catch(e) { }
-
-    return true;
-}
-
-
-/*
-    Sidebar-Toggle per collapsed
-        => Aufruf durch den Grippy selbst bei onClick()
-*/
-function aios_useGrippy() {
-    fx_sidebarBox.collapsed = !fx_sidebarBox.collapsed;
-
-    // Fix fuer Win Vista & 7: aiosOpen wird durch fehlenden Aufruf von aios_observeSidebar nicht gesetzt
-    // aios_observeSidebar wird eigentlich durch Observer der sidebar-box aufgerufen, k.A. warum hier nicht
-    if(AiOS_HELPER.os == "WINNT" && AiOS_HELPER.osVersion.indexOf("5.1") == -1) aios_observeSidebar(true);
-
-    /* CollapseByStyle-Methode
-    if(fx_sidebarBox.getAttribute('style') != "") fx_sidebarBox.removeAttribute('style');
-    else fx_sidebarBox.setAttribute('style', 'display:none;')*/
-}
-
-
-/*
-    aktiviert/deaktiviert den schmalen Sidebar-Umschalter
-        => Aufruf durch Event-Listener "onresize", observer (sizemode) in tbx.xul,
-             aios_BrowserFullScreen() und aios_savePrefs() in prefs.js
-*/
-function aios_checkThinSwitch() {
-    if(!initialised) return;
-
-    aios_getObjects();
-
-    var thin_switch, thinmax_switch, switch_width, switch_twidth, athin_switch;
-
-    try {
-        thin_switch = AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.thin');
-        thinmax_switch = AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.thinmax');
-
-        switch_width = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.switch.width');
-        switch_twidth = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.switch.twidth');
-
-        // soll er schmal sein?
-        var thin = thin_switch;
-        if(thin_switch && thinmax_switch && !aios_isWinMax()) thin = false;
-
-        var width_val = (thin) ? switch_twidth : switch_width;
-        var barStyle = "min-width: " + width_val + "px; max-width: " + width_val + "px;";
-
-        if(width_val < 4) elem_switch.setAttribute('style', 'background-image: none;');
-        else elem_switch.setAttribute('style', '');
-
-        if(width_val < 2) barStyle += " border: none;";
-        aios_toggleBar.setAttribute('style', barStyle);
-    }
-    catch(e) { }
-}
-
-
-/*
-  Steuerung der Mausaktionen des Sidebar-Umschalters
-    => Aufruf durch onClick() des Umschalters
-*/
-function aios_controlSwitch(ev, which) {
-
-    // Linksklick => metaKey = Mac
-    if(ev.button == 0 && (!ev.shiftKey && !ev.ctrlKey && !ev.metaKey)) {
-        aios_toggleSidebar(which);
-    }
-
-    // Mittelklick / Ctrl+Linksklick => metaKey = Mac
-    if(ev.button == 1 || (ev.button == 0 && ev.ctrlKey) || (ev.button == 0 && ev.metaKey)) {
-        aios_toggleElement('aios-viewToolbar');
-        aios_toggleToolbar('aios-viewToolbar');
-    }
-
-    // Rechtsklick / Shift+Linksklick
-    if(ev.button == 2 || (ev.button == 0 && ev.shiftKey)) {
-        if(aios_isSidebarHidden()) toggleSidebar(fx_sidebarBox.getAttribute('aiosLastPanel'), true);
-        else toggleSidebar();
-    }
-}
-
-
-/*
-    Erweitert die FF-Funktion BrowserFullScreen() zur Steuerung der AIOS-Elemente
-        => Aufruf durch aios_initSidebar()
-*/
-function aios_BrowserFullScreen() {
-    aios_getObjects();
-
-    try {
-        var enable_restore = AiOS_HELPER.prefBranchAiOS.getBoolPref('fs.restore');
-    }
-    catch(e) {
-        return false;
-    }
-
-    // Fullscreen an
-    //  => Elemente ausblenden
-    if(document.mozFullScreenElement) {
-
-        // Fix für mehrmaliges feuern des mozfullscreenchange events
-        aios_leaveFullScreen = 0;
-        aios_enterFullScreen++;
-        if(aios_enterFullScreen > 1) return;
-
-        try {
-            // Soll-Zustaende
-            var close_switch = AiOS_HELPER.prefBranchAiOS.getBoolPref('fs.switch');
-            var close_toolbar = AiOS_HELPER.prefBranchAiOS.getBoolPref('fs.toolbar');
-            var close_sidebar = AiOS_HELPER.prefBranchAiOS.getBoolPref('fs.sidebar');
-
-            // Ist-Zustaende
-            var rem_switchHidden = aios_getBoolean(aios_toggleBox, 'hidden');
-            var rem_toolbarHidden = aios_getBoolean(aios_toolbar, 'hidden');
-            var rem_sidebarHidden = aios_isSidebarHidden();
-        }
-        catch(e) {
-            return false;
-        }
-
-        // Ist-Zustaende speichern
-        aios_toggleBox.setAttribute('fsSwitch', rem_switchHidden);
-        aios_toggleBox.setAttribute('fsToolbar', rem_toolbarHidden);
-        aios_toggleBox.setAttribute('fsToolbarMode', aios_toolbar.getAttribute("mode"));
-        aios_toggleBox.setAttribute('fsToolbarIconsize', aios_toolbar.getAttribute("iconsize"));
-        aios_toggleBox.setAttribute('fsSidebar', rem_sidebarHidden);
-
-        // Soll-Zustaende herstellen (SidebarSwitch und Toolbar werden standardmaessig ausgeblendet)
-        if(close_sidebar && !rem_sidebarHidden) toggleSidebar();
-
-        aios_toggleBar.setAttribute("moz-collapsed", false);
-        if(close_switch && !rem_switchHidden) aios_toggleBox.hidden = true;
-
-        document.getElementById('aios-sbhtoolbar').setAttribute("moz-collapsed", false);
-
-        aios_toolbar.setAttribute("moz-collapsed", false);
-        //if(close_toolbar && !rem_toolbarHidden) onViewToolbarCommand(true);
-        if(close_toolbar && !rem_toolbarHidden) aios_toggleToolbar(true);
-
-        // Toolbar fuer Fullscreen einstellen (nur ohne die Erweiterung Autohide)
-        if(typeof autoHIDE != "object") {
-            aios_toolbar.setAttribute("mode", "icons");
-            aios_toolbar.setAttribute("iconsize", "small");
-        }
-    }
-    // Fullscreen aus
-    //  => Elemente einblenden
-    else {
-
-        // Fix für mehrmaliges feuern des mozfullscreenchange events
-        aios_enterFullScreen = 0;
-        aios_leaveFullScreen++;
-        if(aios_leaveFullScreen > 1) return;
-
-        // Toolbareinstellungen wiederherstellen (nur ohne die Erweiterung Autohide)
-        if(typeof autoHIDE != "object") {
-            aios_toolbar.setAttribute("mode", aios_toggleBox.getAttribute('fsToolbarMode'));
-            aios_toolbar.setAttribute("iconsize", aios_toggleBox.getAttribute('fsToolbarIconsize'));
-        }
-
-        if(enable_restore) {
-            if(!aios_getBoolean(aios_toggleBox, 'fsSidebar')) toggleSidebar(fx_sidebarBox.getAttribute('aiosLastPanel'), true);
-            else if(!aios_isSidebarHidden()) toggleSidebar();
-
-            //onViewToolbarCommand(aios_getBoolean(aios_toggleBox, 'fsToolbar'));
-            aios_toggleToolbar(aios_getBoolean(aios_toggleBox, 'fsToolbar'));
-            aios_toggleBox.hidden = aios_getBoolean(aios_toggleBox, 'fsSwitch');
-        }
-    }
-
-    // aktiviert/deaktiviert den schmalen Sidebar-Umschalter
-    aios_checkThinSwitch();
-
-    aios_adjustToolboxWidth(false);
-
-    return true;
+
+// dem Sidebarheader eine ID zuweisen => dann per CSS ansprechbar (bei load oder DOMContentLoaded zu spaet)
+//top.document.getElementById("sidebar-throbber").parentNode.setAttribute('id', 'sidebar-header');
+
+window.addEventListener("load", aios_initSidebar, false);
+window.addEventListener("resize", aios_checkThinSwitch, false);
+window.addEventListener("mozfullscreenchange", aios_BrowserFullScreen, false);
+
+// sonst werden neu definierte Shortcuts bei Browser-Neustart zurueckgesetzt
+extLoad.add(30, function() {
+    aiosKeyconfig.loadkeys(aiosKeyconfig.prefService.getCharPref("extensions.aios.keyconf.profile"));
+});
+
+var initialised = false;
+
+var fx_mainWindow, fx_browser, fx_sidebar, fx_sidebarBox, fx_sidebarHeader, fx_sidebarSplitter, fx_sidebarMenu, fx_maximizedWindow;
+var aios_toggleBox, aios_toggleBar, aios_toggleSwitchItem, aios_toggleToolbarItem, aios_toolbar;
+var elem_switch, elem_tbb, elem_key, elem_close, elem_close2;
+
+var aios_enterFullScreen = 0;
+var aios_leaveFullScreen = 0;
+
+// Sidebar nur zusammenklappen statt schliessen
+var aios_collapseSidebar = AiOS_HELPER.prefBranchAiOS.getBoolPref('collapse');
+
+
+function aios_getObjects() {
+    try {
+        fx_mainWindow = document.getElementById('main-window');
+        fx_browser = document.getElementById('browser');
+        fx_sidebar = document.getElementById('sidebar');
+        fx_sidebarBox = document.getElementById('sidebar-box');
+        fx_sidebarHeader = document.getElementById('sidebar-header');
+        fx_sidebarSplitter = document.getElementById('sidebar-splitter');
+        fx_sidebarMenu = document.getElementById('viewSidebarMenu');
+
+        aios_toggleBox = document.getElementById('aios-toggle-toolbox');
+        aios_toggleBar = document.getElementById('aios-toggle-toolbar');
+
+        // broadcaster in aios.xul mit gespeichertem Wunsch-Toolbar-Zustand
+        //  => gespeichert durch onViewToolbarCommand() in tbx.js (AiOS < 0.7.7)
+        //  => gespeichert/gesetzt durch aios_toggleToolbar()
+        aios_toggleSwitchItem = document.getElementById('aios-viewTogglebar');
+        aios_toggleToolbarItem = document.getElementById('aios-viewToolbar');
+
+        aios_toolbar = document.getElementById('aios-toolbar');
+
+        elem_switch = document.getElementById('aios-toggle-button');
+        elem_tbb = document.getElementById('sidebars-togglebutton');
+        elem_key = document.getElementById('aiosKey_sidebar');
+        elem_close = document.getElementById('sidebarclose-button');
+        elem_close2 = document.getElementById('sbh-sidebarclose-button');
+    }
+    catch(e) { }
+}
+
+
+/*
+    Initialisierung
+        => Aufruf durch das onload-Event
+*/
+function aios_initSidebar() {
+    aios_getObjects();
+
+    // Toolbarbuttons in der Sidebarheader Toolbar ohne Button-Gedoens anzeigen
+    /*for(var i = 0; i < document.getElementById('aios-sbhtoolbar').childNodes.length; i++) {
+        aios_stripClass(document.getElementById('aios-sbhtoolbar').childNodes[i], 'toolbarbutton-1');
+    }*/
+
+    // MacOS X => Tastaturkuerzel ersetzen (Strg. wird durch Command ersetzt und Umschalt durch das Symbol dafuer)
+    if(AiOS_HELPER.os == "Darwin") {
+        aios_replaceKey('switch-tooltip-box', 'r2c2', 'command');
+        aios_replaceKey('template-sidebar-tooltip-box', 'r2c2', 'command');
+        aios_replaceKey('template-window-tooltip-box', 'r2c2', 'command');
+        aios_replaceKey('paneltab-tooltip-box', 'r2c2', 'command');
+        aios_replaceKey('paneltab-tooltip-reverse-box', 'r2c2', 'command');
+        aios_replaceKey('sidebarheader-tooltip-box', 'r3c2', 'command');
+
+        aios_replaceKey('switch-tooltip-box', 'r3c2', 'shift');
+        aios_replaceKey('template-sidebar-tooltip-box', 'r3c2', 'shift');
+        aios_replaceKey('template-window-tooltip-box', 'r3c2', 'shift');
+        aios_replaceKey('paneltab-tooltip-box', 'r3c2', 'shift');
+        aios_replaceKey('paneltab-tooltip-reverse-box', 'r3c2', 'shift');
+        aios_replaceKey('sidebarheader-tooltip-box', 'r1c2', 'shift');
+    }
+
+    // Sidebar li. oder re.
+    // Eigenschaftenzuweisung fuer CSS (LTR <=> RTL; Sidebar links <=> rechts)
+    aios_setSidebarOrient();
+
+    // beim ersten Start (bzw. nach loeschen der localstore.rdf) => ...
+    if(!aios_getBoolean(fx_sidebarBox, 'aiosInit')) {
+        // Icongroesse an die der Nav-Toolbar anpassen
+        fx_sidebarBox.setAttribute('aiosInit', true);
+        document.persist(fx_sidebarBox.id, 'aiosInit');
+
+        if(aios_toolbar) aios_toolbar.setAttribute('iconsize', document.getElementById('nav-bar').getAttribute('iconsize'));
+
+        // Sidebar-Breite nach Konfiguration festsetzen
+        aios_setConfSidebarWidth();
+    }
+
+
+    // Sidebarheader-Symbolleiste aus der Navigations-Symbolleiste in den Sidebarheader verschieben
+    // wenn die Symbolleiste gleich im Header waere, wuerden keine Icons angezeigt werden, wenn die Sidebar beim Start geschlossen ist
+    //document.getElementById('aios-sbhtoolbox').appendChild(document.getElementById('aios-sbhtoolbar'));
+
+
+    // legt commands (Ziele) fuer Manager und Fenster lt. Einstellungen fest
+    window.setTimeout(function() {
+        aios_setTargets();
+    }, 50);
+
+    // Autohide-Feature initialisieren
+    aios_initAutohide();
+
+
+    // Sidebar nur zusammenklappen statt schliessen
+    var lp;
+    if(aios_collapseSidebar) {
+
+        // in jedem Fall das Hidden-Attribut zuruecksetzen
+        document.getElementById('sidebar-box').setAttribute('hidden', false);
+
+        // wenn die Sidebar beim Start nicht geoeffnet sein soll
+        // neues bzw. weiteres Fenster
+        if(window.opener) {
+
+            fx_sidebarBox.setAttribute('collapsed', window.opener.document.getElementById('sidebar-box').getAttribute('collapsed'));
+
+            /* CollapseByStyle-Methode
+            if(window.opener.document.getElementById('sidebar-box').getAttribute('style') != "")
+                fx_sidebarBox.setAttribute('style', 'display:none;');
+            else
+                fx_sidebarBox.removeAttribute('style');*/
+
+            aios_toolbar.setAttribute('hidden', window.opener.document.getElementById('aios-toolbar').getAttribute('hidden'));
+        }
+        // Browserstart
+        else {
+            //alert(aios_getBoolean('main-window', 'aiosOpen'));
+            if(!aios_getBoolean('main-window', 'aiosOpen')) {
+                fx_sidebarBox.setAttribute('collapsed', true);
+                // CollapseByStyle-Methode fx_sidebarBox.setAttribute('style', 'display:none;');
+                fx_sidebarSplitter.setAttribute('hidden', true);
+            }
+        }
+
+        // sonst ist nach Deaktivieren/Aktivieren die Sidebar sichtbar aber leer
+        lp = document.getElementById('sidebar-box').getAttribute("aiosLastPanel");
+        if(aios_getBoolean(document.getElementById('main-window'), 'aiosOpen') && lp != "") {
+            toggleSidebar(lp, true);
+            document.getElementById('sidebar-splitter').hidden = false;
+            document.getElementById('sidebar-splitter').setAttribute('state', 'open');
+        }
+    }
+
+    // wenn es keine zuletzt geoeffnete Sidebar gibt oder diese nicht mehr existiert, dann nimm die Bookmarks
+    lp = fx_sidebarBox.getAttribute("aiosLastPanel");
+    if(!lp || (lp && !document.getElementById(lp))) {
+        fx_sidebarBox.setAttribute("aiosLastPanel", "viewBookmarksSidebar");
+        document.persist(fx_sidebarBox.id, "aiosLastPanel");
+    }
+
+    // Sidebar, Toolbar u. Switch beim Start gem. Einstellungen
+    try {
+        var sidebarInit = AiOS_HELPER.prefBranchAiOS.getCharPref('gen.init');
+        var toolbarInit = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.toolbar.init');
+        var switchInit = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.switch.init');
+
+        // Sidebar beim Start oeffnen
+        if(sidebarInit == "open") toggleSidebar(fx_sidebarBox.getAttribute('aiosLastPanel'), true);
+
+        // Sidebar beim Start schliessen
+        if(sidebarInit == "close" && !aios_isSidebarHidden()) {
+            toggleSidebar();
+            if(aios_collapseSidebar) {
+                document.getElementById('sidebar-box').setAttribute('collapsed', true);
+                // CollapseByStyle-Methode document.getElementById('sidebar-box').setAttribute('style', 'display:none;');
+            }
+        }
+
+        // bestimmte Sidebar beim Start oeffnen
+        if(sidebarInit != "rem" && sidebarInit != "open" && sidebarInit != "close") {
+            if(document.getElementById(sidebarInit)) toggleSidebar(sidebarInit, true);
+        }
+
+        if(toolbarInit != 2) aios_toolbar.setAttribute('hidden', !toolbarInit);
+        if(switchInit != 2) aios_toggleBox.setAttribute('hidden', !switchInit);
+    }
+    catch(e) { }
+
+    // bei Doppelklick die Standardgroesse der Sidebar einstellen
+    var fx_sidebarheader = document.getElementsByTagName('sidebarheader')[0];
+    fx_sidebarheader.addEventListener("dblclick", function(e) {
+        aios_setSidebarWidth(e);
+    }, false);
+
+    // Sidebars-Menue ueberwachen - noetig fuer den Fall, dass ein erster Aufruf durch das View-Menue erfolgt
+    //fx_sidebarMenu.addEventListener('popupshowing', aios_modSidebarMenu, false);
+
+    // Sidebar-Ladezustand ueberwachen
+    /*document.getElementById('sidebar').addProgressListener(aiosSBListener, Components.interfaces.nsIWebProgress.NOTIFY_STATE_DOCUMENT);*/
+
+    // Drag&Drop-Funktion fuer den Sidebar-Umschalter deaktivieren?
+    try {
+        var switchDrag = AiOS_HELPER.prefBranchAiOS.getBoolPref("gen.switch.drag");
+        var switchDelay = AiOS_HELPER.prefBranchAiOS.getIntPref("gen.switch.delay");
+
+        if(!switchDrag) elem_switch.removeAttribute('ondragenter');
+    }
+    catch(e) { }
+
+    // Changelog anzeigen?
+    try {
+        var changelog = AiOS_HELPER.prefBranchAiOS.getCharPref('changelog');
+    }
+    catch(e) { }
+
+    // mit einer manuell gesetzten 0 laesst sich das abschalten
+    if(parseFloat(changelog) != 0) {
+
+        Components.utils.import("resource://gre/modules/AddonManager.jsm");
+
+        AddonManager.getAddonByID("{097d3191-e6fa-4728-9826-b533d755359d}", function(addon) {
+            var aiosVersion = addon.version;
+
+            if(aiosVersion && (aiosVersion != changelog)) {
+
+                var aiosUpdated = (changelog != "") ? true : false;
+
+                try {
+                    AiOS_HELPER.prefBranchAiOS.setCharPref('changelog', aiosVersion);
+                    var changelog_new = AiOS_HELPER.prefBranchAiOS.getCharPref('changelog');
+                }
+                catch(e) { }
+
+                // wenn das speichern der aktuellen Version geklappt hat
+                if(changelog_new === aiosVersion && gBrowser) {
+                    var hp = "http://www.exxile.de/aios_installed.htm?v=" + aiosVersion;
+                    if(aiosUpdated) hp = "http://www.exxile.de/aios_updated.htm?v=" + aiosVersion;
+
+                    window.setTimeout(function() {
+                        gBrowser.loadTabs(new Array(hp), false);
+                    }, 500);
+                }
+            }
+        });
+    }
+
+    // vertikale Buttons?
+    try {
+        var vButtons = AiOS_HELPER.prefBranchAiOS.getBoolPref("vbuttons");
+
+        fx_mainWindow.setAttribute('aiosVButtons', 'true');
+        if(!vButtons) fx_mainWindow.setAttribute('aiosVButtons', 'false');
+        document.persist(fx_mainWindow.id, 'aiosVButtons');
+    }
+    catch(e) { }
+
+    // vertikale Bookmarkleiste?
+    // Attribut der Bookmarks-Leiste entfernen. Wenn sie auf der AiOS-Toolbar platziert wird, kann man per CSS die Orientation bestimmen.
+    if(document.getElementById('PlacesToolbarItems')) document.getElementById('PlacesToolbarItems').removeAttribute('orient');
+
+    initialised = true;
+}
+
+
+/*
+    stellt bei Doppelklick auf den Sidebarheader die Standardgroesse der Sidebar wieder her
+        => Aufruf durch EventListener auf dem Header, gesetzt in aios_initSidebar()
+*/
+function aios_setSidebarWidth(event) {
+    aios_getObjects();
+
+    var mode = "def";
+    if(event) {
+        if(event.shiftKey) mode = "min";
+        if(event.ctrlKey || event.metaKey) mode = "max";    // metaKey = Mac
+    }
+
+    try {
+        var sWidthVal = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.width.' + mode + 'Val');
+        var sWidthUnit = AiOS_HELPER.prefBranchAiOS.getCharPref('gen.width.' + mode + 'Unit');
+
+        if(sWidthUnit == "%") {
+            var browserWidth = aios_getBrowserWidth();
+            var compWidth = browserWidth[3];
+
+            sWidthVal = parseInt(Math.round((compWidth * sWidthVal) / 100));
+        }
+
+        // Sidebargoesse einstellen
+        fx_sidebarBox.setAttribute('width', sWidthVal);
+    }
+    catch(e) { }
+}
+
+
+/*
+stellt die Anzeige der Sidebar ein
+        => Aufruf durch aios_initSidebar() und aios_savePrefs() in prefs.js
+        => 1 = links, 2 = rechts
+*/
+function aios_setSidebarOrient() {
+    aios_getObjects();
+
+    try {
+        // Sidebar-Ausrichtung
+        var sidebarOrient = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.orient');
+        fx_mainWindow.setAttribute('aiosOrient', 'left');
+        if(sidebarOrient == 2) fx_mainWindow.setAttribute('aiosOrient', 'right');
+        //document.persist(fx_mainWindow.id, 'aiosOrient');
+
+        // Links-Rechts <=> Rechts-Links
+        //var cStyleWindow = document.defaultView.getComputedStyle(fx_mainWindow, '');
+        fx_mainWindow.setAttribute('aiosMode', 'ltr');
+        //if(typeof cStyleWindow === 'object' && typeof cStyleWindow.direction === 'string' && cStyleWindow.direction == "rtl") fx_mainWindow.setAttribute('aiosMode', 'rtl');
+        //document.persist(fx_mainWindow.id, 'aiosMode');
+
+        // Fix fuer MileWideBack
+        if(document.getElementById('back-strip') && sidebarOrient == 2) {
+            var mwb = document.getElementById('back-strip');
+            var mwbParent = document.getElementById('back-strip').parentNode;
+            mwbParent.removeChild(mwb);
+            mwbParent.appendChild(mwb);
+        }
+    }
+    catch(e) { }
+
+    aios_setToolbarPos();
+}
+
+
+/*
+    Sidebar-Status auf Veraenderungen ueberwachen
+        => Aufruf durch observes-Elemente (hidden und collapsed) in 'sidebar-box'
+*/
+function aios_observeSidebar(mode) {
+    aios_getObjects();
+
+    // fuer den Fall, dass vor dem Oeffnen die Toolbar ausgeblendet wurde (z.B. durch Switch im Opera-Modus)
+    var showToolbar = aios_getBoolean(aios_toggleToolbarItem, 'checked');
+    if(showToolbar && !aios_isSidebarHidden()) aios_toggleToolbar(false);
+
+    // fuer den Fall, dass vor dem Oeffnen der Switch ausgeblendet wurde (z.B. durch Startup-Verhalten)
+    var showSwitch = aios_getBoolean(aios_toggleSwitchItem, 'checked');
+    if(showSwitch && !aios_isSidebarHidden()) aios_toggleBox.setAttribute('hidden', false);
+
+    // Grippy-Status (CSS achtet auf Attribut 'aiosOpen')
+    fx_mainWindow.setAttribute('aiosOpen', !fx_sidebarBox.hidden && !fx_sidebarBox.collapsed);
+    // CollapseByStyle-Methode fx_mainWindow.setAttribute('aiosOpen', !fx_sidebarBox.hidden && fx_sidebarBox.getAttribute('style') == "");
+    document.persist(fx_mainWindow.id, 'aiosOpen');
+
+    // Toggle-Button-Status (Button achtet auf Attribut 'checked')
+    fx_sidebarBox.setAttribute('checked', !fx_sidebarBox.hidden && !fx_sidebarBox.collapsed);
+    // CollapseByStyle-Methode fx_sidebarBox.setAttribute('checked', !fx_sidebarBox.hidden && fx_sidebarBox.getAttribute('style') == "");
+
+    // fuer den Fall, dass vor dem Oeffnen der Grippy benutzt wurde...
+    if(mode == "hidden") {
+        fx_sidebarBox.removeAttribute('collapsed');
+        // CollapseByStyle-Methode fx_sidebarBox.removeAttribute('style');
+        fx_sidebarSplitter.removeAttribute('hidden');
+
+        fx_sidebarSplitter.setAttribute('state', 'open');
+    }
+}
+
+
+/*
+    Letzte Sidebar merken und als persist speichern
+        => Aufruf durch observes-Element in 'sidebar-box' und aios_modSidebarMenu()
+*/
+function aios_remLastSidebar() {
+    aios_getObjects();
+
+    var actSidebar = false;
+
+    // letzte Sidebar merken und speichern
+    var allSidebars = document.getElementsByAttribute('group', 'sidebar');
+    for(var i = 0; i < allSidebars.length; i++) {
+
+        // darf kein Element observen (Menueeintraege usw.), aber muss eine Sidebar-URL haben
+        if(!allSidebars[i].getAttribute('observes') && allSidebars[i].getAttribute('sidebarurl')) {
+
+            // muss eine ID haben und muss "checked" sein
+            if(allSidebars[i].getAttribute('id') && aios_getBoolean(allSidebars[i], 'checked')) {
+
+                // command in der "persist"-var "aiosLastPanel" speichern und zurueckgeben
+                fx_sidebarBox.setAttribute("aiosLastPanel", allSidebars[i].id);
+                document.persist(fx_sidebarBox.id, "aiosLastPanel");
+                actSidebar = allSidebars[i].id;
+
+            //fx_sidebarBox.setAttribute("sidebarcommand", allSidebars[i].id);
+            //document.persist(fx_sidebarBox.id, "sidebarcommand");
+
+            //fx_sidebarBox.setAttribute('src', fx_sidebar.getAttribute('src'));
+            //fx_sidebar.setAttribute('src', fx_sidebarBox.getAttribute('src'));
+            }
+        }
+    }
+
+    return actSidebar;
+}
+
+
+/*
+    toggelt die Sidebar im Opera-Verhalten
+        => Aufruf durch aios_toggleSidebar() fuer Elemente im Opera-Verhalten
+*/
+function aios_toggleOperaMode(aForcePanel, aForceOpen) {
+    aios_getObjects();
+
+    var showToolbar = aios_getBoolean(aios_toggleToolbarItem, 'checked');
+
+    // zu oeffnende Sidebar feststellen
+    var openPanel = fx_sidebarBox.getAttribute('aiosLastPanel');                        // zuletzt geoeffnete Sidebar
+    if(openPanel == "") openPanel = "viewBookmarksSidebar";                             // Lesezeichen wenn keine Sidebar geoeffnet war
+    if(aForcePanel) openPanel = aForcePanel;                                            // bestimmte Sidebar gewuenscht (bei jedem oeffnen)
+
+    // vertikaler Toolbar-Modus
+    if(aios_toolbar.orient == "vertical") {
+
+        // wenn die Toolbar sichtbar ist
+        if(!aios_getBoolean(aios_toolbar, 'hidden')) {
+
+            // wenn die Sidebar sichtbar ist
+            if(!aios_isSidebarHidden() && !aForceOpen) {
+                fx_sidebarBox.setAttribute("aiosShouldOpen", true);                         // Zustand der Sidebar merken (sichtbar)
+                document.persist(fx_sidebarBox.id, 'aiosShouldOpen');
+                toggleSidebar();                                                            // Sidebar ausblenden
+            }
+            else {
+                fx_sidebarBox.setAttribute("aiosShouldOpen", false);                        // Zustand der Sidebar merken (unsichtbar)
+                document.persist(fx_sidebarBox.id, 'aiosShouldOpen');
+            }
+
+            //aios_toolbar.setAttribute('hidden', true);
+            //if(!aForceOpen) onViewToolbarCommand(true);                                   // Toolbar ausblenden
+            if(!aForceOpen) aios_toggleToolbar(true);                                       // Toolbar ausblenden
+        }
+        // wenn die Toolbar nicht sichtbar ist
+        else {
+            if(showToolbar)                                                                 // Toolbar anzeigen?
+                aios_toggleToolbar(false);                                              // Toolbar einblenden
+            //onViewToolbarCommand(false);                                              // Toolbar einblenden
+            //aios_toolbar.setAttribute('hidden', false);
+
+            // wenn Sidebar angezeigt werden soll (Status vor dem letzten Schliessen) oder die Toolbar abgeschaltet wurde
+            if(aios_getBoolean(fx_sidebarBox, 'aiosShouldOpen') || !showToolbar) toggleSidebar(openPanel);
+        }
+    }
+    // horizontaler Toolbar-Modus
+    else {
+        // wenn die Sidebar sichtbar ist
+        if(!aios_isSidebarHidden()) {
+            fx_sidebarBox.setAttribute("aiosShouldOpen", true);                         // Zustand der Sidebar merken (sichtbar)
+            document.persist(fx_sidebarBox.id, 'aiosShouldOpen');
+            toggleSidebar();                                                            // Sidebar ausblenden
+        }
+        else {
+            if(lastPanel == "") toggleSidebar(openPanel);
+
+        //if(showToolbar) aios_toolbar.setAttribute('hidden', false);
+        }
+    }
+
+}
+
+
+/*
+    klont das Firefox-Sidebar-Menue fuer die Sidebars-Buttons
+        => Aufruf durch Menuebutton-Events 'onpopupshowing' aufgerufen
+*/
+function aios_getSidebarMenu(aPopup) {
+
+    aios_getObjects();
+
+    // Menue modifizieren (aktiven Menuepunkt deaktivieren, Ez Sidebar-Fix u.a.)
+    aios_modSidebarMenu();
+
+    /*var aios_sidebarMenu = fx_sidebarMenu.cloneNode(true);
+    aios_sidebarMenu.setAttribute('onpopupshowing', 'aios_getSidebarMenu(this);');
+    aPopup.parentNode.replaceChild(aios_sidebarMenu, aPopup);*/
+
+    while(aPopup.hasChildNodes()) {
+        aPopup.removeChild(aPopup.firstChild);
+    }
+
+    for(var i = 0; i < fx_sidebarMenu.childNodes.length; i++) {
+        aPopup.appendChild(fx_sidebarMenu.childNodes[i].cloneNode(true));
+    }
+}
+
+
+/*
+    schliesst die Sidebar, wenn die Maus den Content-Bereich ueberfaehrt
+        => Aufruf durch mouse-over des 'appcontent' und des Sidebar-Switches (mit Uebergabe von mode)
+
+        => aios_initSidebar() fuegt dem Object "sidebar-box" einen mouse-over-Event hinzu,...
+        => dieser mouse-over-Event fuegt dem "appcontent" einen mouse-over-Event hinzu,...
+        => der diese Funktion aufruft
+*/
+var aios_autoTimeout;
+function aios_autoShowHide(mode) {
+    //try {
+    var autobutton = aios_getBoolean('aios-enableAutohide', 'checked');
+
+    var autoshow = AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.autoshow');
+    var onlymax = AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.onlymax');
+    var delay = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.switch.delay');
+    var hidemethod = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.switch.hidemethod');
+
+    //alert(mode);
+
+    // Feature nicht aktiviert, Feature soll nur bei max. Fenster greifen, Fenster hat nicht den Focus
+    if(!autoshow || !autobutton || (onlymax && !aios_isWinMax()) || !aiosFocus) return false;
+
+    /*
+     *  Ausloesung durch den Umschalter
+     **/
+    if(mode == "switch") {
+        // wenn Sidebar sichtbar und nicht ausgeblendet werden soll => ignorieren
+        if(!aios_isSidebarHidden() && hidemethod == 1) return false;
+
+        // nach bestimmter Zeit ein-/ausblenden
+        aios_autoTimeout = window.setTimeout(function() {
+            aios_toggleSidebar('switch');
+        }, delay);
+
+        // timeout wieder loeschen, wenn die Maus zu kurz auf dem Umschalter war oder geklickt wurde
+        elem_switch.addEventListener("mouseout", function(){
+            window.clearTimeout(aios_autoTimeout);
+        }, true);
+        elem_switch.addEventListener("click", function(){
+            window.clearTimeout(aios_autoTimeout);
+        }, true);
+
+        return true;
+    }
+    /*
+     *  Ausloesung durch den Contentbereich
+     **/
+    else {
+
+        // wenn Sidebar sichtbar und ausgeblendet werden soll
+        // mode.originalTarget.parentNode.id != "" => behebt Kompatibilitaetsproblem mit TabSidebar (Sidebar wird bei Rollover des SidebarTabs ausgeblendet)
+
+        // macht scheinbar Probleme, weil der Event auf appcontent nicht (immer) geloescht wird => TabSidebar wird nicht weiterentwickelt
+        //if(!aios_isSidebarHidden() && hidemethod == 1 && mode.originalTarget.parentNode.id != "") {
+        if(!aios_isSidebarHidden() && hidemethod == 1) {
+
+            // Event auf "appcontent" wieder loeschen, weil sonst die Sidebar wieder eingeblendet wuerde
+            // => mouse-over der Sidebar (in aios_initSidebar()) fuegt dem "appcontent" dieses Feature wieder hinzu
+            document.getElementById('appcontent').removeEventListener("mouseover", aios_autoShowHide, true);
+
+            // nach bestimmter Zeit ausblenden
+            aios_autoTimeout = window.setTimeout(function() {
+                aios_toggleSidebar('switch');
+            }, delay);
+
+            // timeout wieder loeschen, wenn die Maus zurueck in die Sidebar kommt
+            fx_sidebarBox.addEventListener("mouseover", function(){
+                window.clearTimeout(aios_autoTimeout);
+            }, true);
+        }
+    }
+    //}
+    //catch(e) { }
+
+    return true;
+}
+
+
+/*
+    aktiviert/deaktiviert die Sidebar/Toolbar/Switch je nach Element und Einstellungen
+        => Aufruf durch Toggle-Button, Switch, Shortcut, Open/Close-Menuitems, Sidebar-Close-Button
+            => mode 1: nur die Sidebar oeffnen/schliessen
+            => mode 2: Sidebar und Toolbar oeffnen/schliessen
+            => mode 3: Sidebar, Toolbar und Togglebar oeffnen/schliessen
+            => mode 4: Opera-Verhalten
+*/
+function aios_toggleSidebar(aMode, aForceOpen) {
+    aios_getObjects();
+    //aForceOpen = false;           // erlaubt das automatische ein-/ausblenden waehrend Drag auf Sidebar Switch
+
+    var prefstring = "key";
+    if(aMode == elem_switch || aMode == "switch") prefstring = "switch";
+    if(aMode == elem_tbb || aMode == "tbb") prefstring = "tbb";
+    if(aMode == elem_close || aMode == elem_close2 || aMode == "close") prefstring = "close";
+
+    try {
+        var mode = AiOS_HELPER.prefBranchAiOS.getIntPref('cmode.' + prefstring);
+        var toolBox_enabled = aios_getBoolean('aios-viewToolbar', 'checked');
+        var toggleBox_enabled = aios_getBoolean(aios_toggleSwitchItem, 'checked');
+
+        // direkte Uebergabe per JavaScript z.B. per "Custom Buttons"
+        if(aMode === 1) mode = 1;
+        if(aMode === 2) mode = 2;
+        if(aMode === 3) mode = 3;
+        if(aMode === 4) mode = 4;
+
+
+        // bestimmtes Panel laden?
+        var forcePanel;
+        var openPanel = AiOS_HELPER.prefBranchAiOS.getCharPref("gen.open.init");
+        if(openPanel != "rem" && (prefstring == "key" || prefstring == "switch" || prefstring == "tbb")) forcePanel = openPanel;
+        else forcePanel = false;
+
+        if(mode == 4) {
+            aios_toggleOperaMode(forcePanel, aForceOpen);
+        }
+        else {
+            // wenn Sidebar Collpasing aktiviert ist...
+            // ein bestimmtes Panel grundsaetzlich geoeffnet werden soll...
+            // es aber noch nicht geoeffnet ist...
+            // die Sidebar aber noch geoeffnet ist...
+            // dann soll das Panel zwar geladen, die Sidebar aber dennoch geschlossen werden => reiner Performance-Zweck
+            if(aios_collapseSidebar && forcePanel && fx_sidebarBox.getAttribute('aiosLastPanel') != forcePanel && !aios_isSidebarHidden()) var closeNow = true;
+
+            var tmpcmd = (forcePanel) ? forcePanel : fx_sidebarBox.getAttribute('aiosLastPanel');
+            toggleSidebar(tmpcmd, aForceOpen);
+
+            // Sidebar schliessen, wenn die obigen Bedingungen erfuellt sind
+            if(closeNow) toggleSidebar(tmpcmd, aForceOpen);
+
+
+            if((mode == 2 || mode == 3) && toolBox_enabled) {
+                //aios_toolbar.setAttribute('hidden', aios_isSidebarHidden());
+                //onViewToolbarCommand(aios_isSidebarHidden());
+                aios_toggleToolbar(aios_isSidebarHidden());
+            }
+
+            if(mode == 3 && toggleBox_enabled)
+                aios_toggleBox.setAttribute('hidden', aios_isSidebarHidden());
+        }
+    }
+    catch(e) { }
+
+    return true;
+}
+
+
+/*
+    Sidebar-Toggle per collapsed
+        => Aufruf durch den Grippy selbst bei onClick()
+*/
+function aios_useGrippy() {
+    fx_sidebarBox.collapsed = !fx_sidebarBox.collapsed;
+
+    // Fix fuer Win Vista & 7: aiosOpen wird durch fehlenden Aufruf von aios_observeSidebar nicht gesetzt
+    // aios_observeSidebar wird eigentlich durch Observer der sidebar-box aufgerufen, k.A. warum hier nicht
+    if(AiOS_HELPER.os == "WINNT" && AiOS_HELPER.osVersion.indexOf("5.1") == -1) aios_observeSidebar(true);
+
+    /* CollapseByStyle-Methode
+    if(fx_sidebarBox.getAttribute('style') != "") fx_sidebarBox.removeAttribute('style');
+    else fx_sidebarBox.setAttribute('style', 'display:none;')*/
+}
+
+
+/*
+    aktiviert/deaktiviert den schmalen Sidebar-Umschalter
+        => Aufruf durch Event-Listener "onresize", observer (sizemode) in tbx.xul,
+             aios_BrowserFullScreen() und aios_savePrefs() in prefs.js
+*/
+function aios_checkThinSwitch() {
+    if(!initialised) return;
+
+    aios_getObjects();
+
+    var thin_switch, thinmax_switch, switch_width, switch_twidth, athin_switch;
+
+    try {
+        thin_switch = AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.thin');
+        thinmax_switch = AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.thinmax');
+
+        switch_width = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.switch.width');
+        switch_twidth = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.switch.twidth');
+
+        // soll er schmal sein?
+        var thin = thin_switch;
+        if(thin_switch && thinmax_switch && !aios_isWinMax()) thin = false;
+
+        var width_val = (thin) ? switch_twidth : switch_width;
+        var barStyle = "min-width: " + width_val + "px; max-width: " + width_val + "px;";
+
+        if(width_val < 4) elem_switch.setAttribute('style', 'background-image: none;');
+        else elem_switch.setAttribute('style', '');
+
+        if(width_val < 2) barStyle += " border: none;";
+        aios_toggleBar.setAttribute('style', barStyle);
+    }
+    catch(e) { }
+}
+
+
+/*
+  Steuerung der Mausaktionen des Sidebar-Umschalters
+    => Aufruf durch onClick() des Umschalters
+*/
+function aios_controlSwitch(ev, which) {
+
+    // Linksklick => metaKey = Mac
+    if(ev.button == 0 && (!ev.shiftKey && !ev.ctrlKey && !ev.metaKey)) {
+        aios_toggleSidebar(which);
+    }
+
+    // Mittelklick / Ctrl+Linksklick => metaKey = Mac
+    if(ev.button == 1 || (ev.button == 0 && ev.ctrlKey) || (ev.button == 0 && ev.metaKey)) {
+        aios_toggleElement('aios-viewToolbar');
+        aios_toggleToolbar('aios-viewToolbar');
+    }
+
+    // Rechtsklick / Shift+Linksklick
+    if(ev.button == 2 || (ev.button == 0 && ev.shiftKey)) {
+        if(aios_isSidebarHidden()) toggleSidebar(fx_sidebarBox.getAttribute('aiosLastPanel'), true);
+        else toggleSidebar();
+    }
+}
+
+
+/*
+    Erweitert die FF-Funktion BrowserFullScreen() zur Steuerung der AIOS-Elemente
+        => Aufruf durch aios_initSidebar()
+*/
+function aios_BrowserFullScreen() {
+    aios_getObjects();
+
+    try {
+        var enable_restore = AiOS_HELPER.prefBranchAiOS.getBoolPref('fs.restore');
+    }
+    catch(e) {
+        return false;
+    }
+
+    // Fullscreen an
+    //  => Elemente ausblenden
+    if(document.mozFullScreenElement) {
+
+        // Fix für mehrmaliges feuern des mozfullscreenchange events
+        aios_leaveFullScreen = 0;
+        aios_enterFullScreen++;
+        if(aios_enterFullScreen > 1) return;
+
+        try {
+            // Soll-Zustaende
+            var close_switch = AiOS_HELPER.prefBranchAiOS.getBoolPref('fs.switch');
+            var close_toolbar = AiOS_HELPER.prefBranchAiOS.getBoolPref('fs.toolbar');
+            var close_sidebar = AiOS_HELPER.prefBranchAiOS.getBoolPref('fs.sidebar');
+
+            // Ist-Zustaende
+            var rem_switchHidden = aios_getBoolean(aios_toggleBox, 'hidden');
+            var rem_toolbarHidden = aios_getBoolean(aios_toolbar, 'hidden');
+            var rem_sidebarHidden = aios_isSidebarHidden();
+        }
+        catch(e) {
+            return false;
+        }
+
+        // Ist-Zustaende speichern
+        aios_toggleBox.setAttribute('fsSwitch', rem_switchHidden);
+        aios_toggleBox.setAttribute('fsToolbar', rem_toolbarHidden);
+        aios_toggleBox.setAttribute('fsToolbarMode', aios_toolbar.getAttribute("mode"));
+        aios_toggleBox.setAttribute('fsToolbarIconsize', aios_toolbar.getAttribute("iconsize"));
+        aios_toggleBox.setAttribute('fsSidebar', rem_sidebarHidden);
+
+        // Soll-Zustaende herstellen (SidebarSwitch und Toolbar werden standardmaessig ausgeblendet)
+        if(close_sidebar && !rem_sidebarHidden) toggleSidebar();
+
+        aios_toggleBar.setAttribute("moz-collapsed", false);
+        if(close_switch && !rem_switchHidden) aios_toggleBox.hidden = true;
+
+        document.getElementById('aios-sbhtoolbar').setAttribute("moz-collapsed", false);
+
+        aios_toolbar.setAttribute("moz-collapsed", false);
+        //if(close_toolbar && !rem_toolbarHidden) onViewToolbarCommand(true);
+        if(close_toolbar && !rem_toolbarHidden) aios_toggleToolbar(true);
+
+        // Toolbar fuer Fullscreen einstellen (nur ohne die Erweiterung Autohide)
+        if(typeof autoHIDE != "object") {
+            aios_toolbar.setAttribute("mode", "icons");
+            aios_toolbar.setAttribute("iconsize", "small");
+        }
+    }
+    // Fullscreen aus
+    //  => Elemente einblenden
+    else {
+
+        // Fix für mehrmaliges feuern des mozfullscreenchange events
+        aios_enterFullScreen = 0;
+        aios_leaveFullScreen++;
+        if(aios_leaveFullScreen > 1) return;
+
+        // Toolbareinstellungen wiederherstellen (nur ohne die Erweiterung Autohide)
+        if(typeof autoHIDE != "object") {
+            aios_toolbar.setAttribute("mode", aios_toggleBox.getAttribute('fsToolbarMode'));
+            aios_toolbar.setAttribute("iconsize", aios_toggleBox.getAttribute('fsToolbarIconsize'));
+        }
+
+        if(enable_restore) {
+            if(!aios_getBoolean(aios_toggleBox, 'fsSidebar')) toggleSidebar(fx_sidebarBox.getAttribute('aiosLastPanel'), true);
+            else if(!aios_isSidebarHidden()) toggleSidebar();
+
+            //onViewToolbarCommand(aios_getBoolean(aios_toggleBox, 'fsToolbar'));
+            aios_toggleToolbar(aios_getBoolean(aios_toggleBox, 'fsToolbar'));
+            aios_toggleBox.hidden = aios_getBoolean(aios_toggleBox, 'fsSwitch');
+        }
+    }
+
+    // aktiviert/deaktiviert den schmalen Sidebar-Umschalter
+    aios_checkThinSwitch();
+
+    aios_adjustToolboxWidth(false);
+
+    return true;
 }
\ No newline at end of file
diff --git a/content/aios_tbx.js b/content/aios_tbx.js
index 8a19bf1..987ef3d 100644
--- a/content/aios_tbx.js
+++ b/content/aios_tbx.js
@@ -1,323 +1,323 @@
-/*
-    Breite der vertikalen Toolboxen freigeben bzw. festsetzen
-        => Aufruf durch aios_toggleToolbar(), aios_setToolbarView(), aios_setToolbarPos(), aios_customizeToolbar() und aios_BrowserFullScreen()
-        => Aufruf indirekt auch durch aios_initSidebar() => aios_setSidebarOrient() loest aios_setToolbarPos() aus
-        => per JS statt CSS, weil es wegen Themes dynamisch sein muss
- */
-function aios_adjustToolboxWidth(aMode) {
-    aios_getObjects();
-
-    var tboxen = new Array('aios-toolbox-left', 'aios-toolbox-right');
-    var tbox;
-
-    // erstmal alle Festlegungen loeschen
-    for(tbox in tboxen) {
-        aios_gElem(tboxen[tbox]).style.minWidth = "";
-        aios_gElem(tboxen[tbox]).style.width = "";
-        aios_gElem(tboxen[tbox]).style.maxWidth = "";
-        aios_gElem(tboxen[tbox]).removeAttribute('width');
-    }
-
-    // wenn noch keine Festlegungen getroffen werden sollten, diese durch rekursiven Aufruf kurze Zeit spaeter initiieren
-    // verzoegerter Aufruf sichert die einwandfreie Funktion
-    if(!aMode) {
-
-        window.setTimeout(function() {
-            aios_adjustToolboxWidth(true);
-        }, 100);
-
-        return false;
-    }
-
-    // Breiten festlegen...
-    var usedToolbox;
-    var aiosOrient = fx_mainWindow.getAttribute('aiosOrient');
-    var posMode = aios_toolbar.getAttribute('posMode');
-
-    // Toolbox je nach Sidebar-Ausrichtung waehlen
-    if((aiosOrient == "left" && posMode == "1") || (aiosOrient == "right" && posMode == "2")) {
-        usedToolbox = 'aios-toolbox-left';
-    }
-    else if((aiosOrient == "left" && posMode == "2") || (aiosOrient == "right" && posMode == "1")) {
-        usedToolbox = 'aios-toolbox-right';
-    }
-
-    // usedToolbox ist false wenn die Toolbar innerhalb der Sidebar positioniert ist...
-    if(usedToolbox) {
-        var cStyle = document.defaultView.getComputedStyle(aios_gElem(usedToolbox), null);
-        var myWidth = parseInt(cStyle.width) + parseInt(cStyle.paddingLeft) + parseInt(cStyle.paddingRight);
-    }
-
-    for(tbox in tboxen) {
-        // Breite fuer verwendete Toolbox feststzen
-        if(tboxen[tbox] == usedToolbox) {
-            aios_gElem(tboxen[tbox]).style.minWidth = myWidth + "px";
-            aios_gElem(tboxen[tbox]).style.maxWidth = myWidth + "px";
-        }
-        // Breite fuer nicht verwendete Toolbox auf 0px festsetzen => ansonsten skaliert die Toolbox mit der Sidebar-Skalierung
-        else {
-            aios_gElem(tboxen[tbox]).style.minWidth = "0px";
-            aios_gElem(tboxen[tbox]).style.maxWidth = "0px";
-        }
-    }
-
-    return true;
-}
-
-
-/*
-    Ansichtoptionen der Toolbars (AiOS-Toolbar, Sidebarheader-Toolbar) initialisieren
-        => Aufruf durch onpopupshowing-Handler der Kontextmenues in aios.xul
- */
-function aios_onToolbarPopupShowing(aWhich) {
-    aios_getObjects();
-
-    var mode;
-
-    /*
-    AiOS-Toolbar
-     */
-    if(aWhich.id == "aios-toolbar-contextmenu") {
-
-        // Schaltflaechen-Modus
-        mode = aios_toolbar.getAttribute('mode');
-
-        switch(mode) {
-            case "full":
-                document.getElementById('aios-view-mitem1').setAttribute('checked', true);
-                break;
-            case "icons":
-                document.getElementById('aios-view-mitem2').setAttribute('checked', true);
-                break;
-            case "full":
-                document.getElementById('aios-view-mitem3').setAttribute('checked', true);
-                document.getElementById('aios-view-mitem4').setAttribute('disabled', true);
-                break;
-        }
-
-        // Icongroesse
-        document.getElementById('aios-view-mitem4').setAttribute('checked', aios_toolbar.getAttribute('iconsize') == "small");
-
-        // Flexible Schaltflaechen
-        document.getElementById('aios-view-mitem5').setAttribute('checked', aios_toolbar.getAttribute('flexbuttons') == "true");
-
-        /*/ keine Konfigurationsmoeglichkeiten in Mac OS X
-        if(AiOS_HELPER.os == "Darwin") {
-            if(document.getElementById('aios-customize-separator'))
-                document.getElementById('aios-toolbar-contextmenu').removeChild(document.getElementById('aios-customize-separator'));
-
-            if(document.getElementById('aios-customize-mitem'))
-                document.getElementById('aios-toolbar-contextmenu').removeChild(document.getElementById('aios-customize-mitem'));
-        }*/
-    }
-    /*
-    Sidebarheader-Toolbar
-     */
-    else if(aWhich.id == "aios-sbhtoolbar-contextmenu") {
-
-        // Schaltflaechen-Modus => wird fuer CSS-Definitionen benoetigt
-        fx_sidebarHeader.setAttribute('mode', aios_gElem("aios-sbhtoolbar").getAttribute('mode'));
-
-        // Icongroesse
-        document.getElementById('aios-sbhview-mitem4').setAttribute('checked', aios_gElem("aios-sbhtoolbar").getAttribute('iconsize') == "small");
-        fx_sidebarHeader.setAttribute('iconsize', aios_gElem("aios-sbhtoolbar").getAttribute('iconsize'));
-
-        /*/ keine Konfigurationsmoeglichkeiten in Mac OS X
-        if(AiOS_HELPER.os == "Darwin") {
-            if(document.getElementById('aios-sbhcustomize-separator'))
-                document.getElementById('aios-sbhtoolbar-contextmenu').removeChild(document.getElementById('aios-sbhcustomize-separator'));
-
-            if(document.getElementById('aios-sbhcustomize-mitem'))
-                document.getElementById('aios-sbhtoolbar-contextmenu').removeChild(document.getElementById('aios-sbhcustomize-mitem'));
-        }*/
-    }
-}
-
-
-/*
-    positioniert die AiOS- und die Sidebarheader-Toolbar
-        => Aufruf durch die Menueoptionen des Kontextmenues und aios_setSidebarOrient()
-        => Aufruf indirekt auch durch aios_initSidebar() => aios_setSidebarOrient() loest aios_setToolbarPos() aus
-            => posMode 1 = links neben der Sidebar (vertikal)
-            => posMode 2 = rechts neben der Sidebar (vertikal)
-            => posMode 3 = ueber dem Sidebarheader (horizontal)
-            => posMode 4 = unter dem Sidebarheader (horizontal)
-            => posMode 5 = unter der Sidebar (horizontal)
- */
-function aios_setToolbarPos(posMode) {
-    aios_getObjects();
-
-    var tbox, orient, button_flex, separator;
-
-    if(!posMode) posMode = parseInt(aios_toolbar.getAttribute('posMode'));
-
-    try {
-        var sidebarOrient = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.orient');
-    }
-    catch(e) { }
-
-    switch(posMode) {
-        case 1:
-            tbox = (sidebarOrient == 1) ? "aios-toolbox-left" : "aios-toolbox-right";
-            orient = "vertical";
-            break;
-
-        case 2:
-            tbox = (sidebarOrient == 1) ? "aios-toolbox-right" : "aios-toolbox-left";
-            orient = "vertical";
-            break;
-
-        case 3:
-            tbox = "aios-toolbox-sidebartop";
-            orient = "horizontal";
-            break;
-
-        case 4:
-            tbox = "aios-toolbox-sidebartop2";
-            orient = "horizontal";
-            break;
-
-        case 5:
-            tbox = "aios-toolbox-sidebarbottom";
-            orient = "horizontal";
-            break;
-    }
-
-    aios_toolbar.setAttribute('posMode', posMode);
-    aios_toolbar.setAttribute('orient', orient);
-
-    document.getElementById(tbox).appendChild(aios_toolbar);
-
-    aios_adjustToolboxWidth(false);
-
-    document.getElementById('aios-pos-mitem' + posMode).setAttribute('checked', true);
-}
-
-
-/*
-    stellt die Ansichtsoptionen der Symbolleisten ein
-        => Aufruf durch die Menueoptionen der Symbolleisten-Kontextmenues
-            => viewMode 1 = Symbole und Text
-            => viewMode 2 = Symbole
-            => viewMode 3 = Text
-            => viewMode 4 = kleine Symbole an/aus
-            => viewMode 5 = flexible Buttons an/aus
- */
-function aios_setToolbarView(aViewMode, aWhich) {
-    aios_getObjects();
-
-    var viewMode = aViewMode;
-
-
-    // feststellen, welche Toolbar konfiguriert werden soll
-    var elem = aWhich;
-    while(elem.tagName != "menupopup") {
-        elem = elem.parentNode;
-    }
-
-    var tbar, menuid;
-
-    if(elem.id == "aios-toolbar-contextmenu") {
-        tbar = aios_gElem("aios-toolbar");
-        menuid = "view";
-    }
-    else {
-        tbar = aios_gElem("aios-sbhtoolbar");
-        menuid = "sbhview";
-    }
-
-
-    // Einstellungen vornehmen
-    var set_property = "mode";
-    var set_value = "full";
-
-    // Modus: Symbole & Text, Symbole, Text
-    if(viewMode <= 2) {
-        if(viewMode == 2) set_value = "icons";
-        document.getElementById('aios-'+menuid+'-mitem4').setAttribute('disabled', false);
-    }
-    else if(viewMode == 3) {
-        set_value = "text";
-        document.getElementById('aios-'+menuid+'-mitem4').setAttribute('disabled', true);
-    }
-
-    // Icongroesse
-    if(viewMode == 4) {
-        set_property = "iconsize";
-        set_value = (aios_getBoolean('aios-'+menuid+'-mitem4', 'checked')) ? "small" : "large";
-    }
-
-    // Flexible Buttons
-    if(viewMode == 5) {
-        set_property = "flexbuttons";
-        set_value = (aios_getBoolean('aios-'+menuid+'-mitem5', 'checked')) ? "true" : "false";
-    }
-
-    tbar.setAttribute(set_property, set_value);
-
-
-    if(tbar == aios_gElem("aios-toolbar")) aios_adjustToolboxWidth(false);
-    else fx_sidebarHeader.setAttribute(set_property, set_value);
-}
-
-
-/*
-    Aktiviert/Deaktiviert die AiOS-Toolbar
-        => Aufruf durch Menueoption (Ansicht > Symbolleisten)
-        => Aufruf durch aios_observeSidebar(), aios_toggleOperaMode(), aios_toggleSidebar(), aios_controlSwitch(), aios_BrowserFullScreen
- */
-function aios_toggleToolbar(aWhich) {
-    aios_getObjects();
-
-    var mode = (typeof aWhich == "boolean") ? aWhich : !aios_getBoolean(aWhich, 'checked');
-
-    aios_toolbar.hidden = mode;
-
-    // setting (collapsed) aus aelteren Versionen (<= 0.7.8) rueckgaengig machen (war auf persist gesetzt)
-    // wenn die Toolbox 'collapsed' ist (Observer der Toolbar), ist die Sidebargroesse nicht veraenderbar, wenn die Toolbar deaktiviert ist
-    /*if(aios_toolbar.getAttribute('collapsed')) {
-        aios_toolbar.removeAttribute('collapsed');
-        document.persist(aios_toolbar.id, 'collapsed');
-    }*/
-
-    aios_adjustToolboxWidth(false);
-}
-
-
-/*
-    fuegt dem Menue Ansicht > Symbolleisten und dem Kontextmenue der Symbolleisten eine Option hinzu
-        => Aufruf durch onpopupshowing-Handler der Menues in aios.xul
- */
-function aios_addToolbarMitem(aWhich) {
-    aios_getObjects();
-
-    var popup = document.getElementById('viewToolbarsMenu').firstChild;
-    if(aWhich.id == "toolbar-context-menu") popup = document.getElementById('toolbar-context-menu');
-
-    // Menuitem erzeugen
-    var menuItem = document.createElement("menuitem");
-    // toolbarid = TotalToolbar-Fix => ohne wird der Eintrag mehrmals angezeigt, weil das Menue nicht korrekt entleert wird
-    menuItem.setAttribute("toolbarId", 'aios-toolbar');
-    menuItem.setAttribute("observes", "aios-viewToolbar");
-    menuItem.setAttribute("label", aios_toolbar.getAttribute('toolbarname'));
-
-    var mitems = popup.childNodes;
-    for(var i = 0; i < mitems.length; i++) {
-        // TotalToolbar => unnoetige/unerwuenschte Menuitems entfernen
-        if(mitems[i].tagName == "menuitem") {
-            if(mitems[i].getAttribute('toolbarId') == "aios-toolbar") mitems[i].parentNode.removeChild(mitems[i]);
-            if(mitems[i].getAttribute('toolbarId') == "aios-sbhtoolbar") mitems[i].parentNode.removeChild(mitems[i]);
-            if(mitems[i].getAttribute('label') == menuItem.getAttribute("label")) mitems[i].parentNode.removeChild(mitems[i]);
-        }
-
-        // ersten Separator ermitteln, um gleich den Menueeintrag direkt davor einzufuegen
-        if(mitems[i].tagName == "menuseparator" && !aios_context_sep) {
-            var aios_context_sep = mitems[i];
-        }
-    }
-
-    // AiOS-Toolbar einfuegen
-    //popup.insertBefore(menuItem.cloneNode(true), popup.firstChild);
-    //popup.insertBefore(menuItem.cloneNode(true), popup.lastChild.previousSibling);
-    popup.insertBefore(menuItem.cloneNode(true), aios_context_sep);
+/*
+    Breite der vertikalen Toolboxen freigeben bzw. festsetzen
+        => Aufruf durch aios_toggleToolbar(), aios_setToolbarView(), aios_setToolbarPos(), aios_customizeToolbar() und aios_BrowserFullScreen()
+        => Aufruf indirekt auch durch aios_initSidebar() => aios_setSidebarOrient() loest aios_setToolbarPos() aus
+        => per JS statt CSS, weil es wegen Themes dynamisch sein muss
+ */
+function aios_adjustToolboxWidth(aMode) {
+    aios_getObjects();
+
+    var tboxen = new Array('aios-toolbox-left', 'aios-toolbox-right');
+    var tbox;
+
+    // erstmal alle Festlegungen loeschen
+    for(tbox in tboxen) {
+        aios_gElem(tboxen[tbox]).style.minWidth = "";
+        aios_gElem(tboxen[tbox]).style.width = "";
+        aios_gElem(tboxen[tbox]).style.maxWidth = "";
+        aios_gElem(tboxen[tbox]).removeAttribute('width');
+    }
+
+    // wenn noch keine Festlegungen getroffen werden sollten, diese durch rekursiven Aufruf kurze Zeit spaeter initiieren
+    // verzoegerter Aufruf sichert die einwandfreie Funktion
+    if(!aMode) {
+
+        window.setTimeout(function() {
+            aios_adjustToolboxWidth(true);
+        }, 100);
+
+        return false;
+    }
+
+    // Breiten festlegen...
+    var usedToolbox;
+    var aiosOrient = fx_mainWindow.getAttribute('aiosOrient');
+    var posMode = aios_toolbar.getAttribute('posMode');
+
+    // Toolbox je nach Sidebar-Ausrichtung waehlen
+    if((aiosOrient == "left" && posMode == "1") || (aiosOrient == "right" && posMode == "2")) {
+        usedToolbox = 'aios-toolbox-left';
+    }
+    else if((aiosOrient == "left" && posMode == "2") || (aiosOrient == "right" && posMode == "1")) {
+        usedToolbox = 'aios-toolbox-right';
+    }
+
+    // usedToolbox ist false wenn die Toolbar innerhalb der Sidebar positioniert ist...
+    if(usedToolbox) {
+        var cStyle = document.defaultView.getComputedStyle(aios_gElem(usedToolbox), null);
+        var myWidth = parseInt(cStyle.width) + parseInt(cStyle.paddingLeft) + parseInt(cStyle.paddingRight);
+    }
+
+    for(tbox in tboxen) {
+        // Breite fuer verwendete Toolbox feststzen
+        if(tboxen[tbox] == usedToolbox) {
+            aios_gElem(tboxen[tbox]).style.minWidth = myWidth + "px";
+            aios_gElem(tboxen[tbox]).style.maxWidth = myWidth + "px";
+        }
+        // Breite fuer nicht verwendete Toolbox auf 0px festsetzen => ansonsten skaliert die Toolbox mit der Sidebar-Skalierung
+        else {
+            aios_gElem(tboxen[tbox]).style.minWidth = "0px";
+            aios_gElem(tboxen[tbox]).style.maxWidth = "0px";
+        }
+    }
+
+    return true;
+}
+
+
+/*
+    Ansichtoptionen der Toolbars (AiOS-Toolbar, Sidebarheader-Toolbar) initialisieren
+        => Aufruf durch onpopupshowing-Handler der Kontextmenues in aios.xul
+ */
+function aios_onToolbarPopupShowing(aWhich) {
+    aios_getObjects();
+
+    var mode;
+
+    /*
+    AiOS-Toolbar
+     */
+    if(aWhich.id == "aios-toolbar-contextmenu") {
+
+        // Schaltflaechen-Modus
+        mode = aios_toolbar.getAttribute('mode');
+
+        switch(mode) {
+            case "full":
+                document.getElementById('aios-view-mitem1').setAttribute('checked', true);
+                break;
+            case "icons":
+                document.getElementById('aios-view-mitem2').setAttribute('checked', true);
+                break;
+            case "full":
+                document.getElementById('aios-view-mitem3').setAttribute('checked', true);
+                document.getElementById('aios-view-mitem4').setAttribute('disabled', true);
+                break;
+        }
+
+        // Icongroesse
+        document.getElementById('aios-view-mitem4').setAttribute('checked', aios_toolbar.getAttribute('iconsize') == "small");
+
+        // Flexible Schaltflaechen
+        document.getElementById('aios-view-mitem5').setAttribute('checked', aios_toolbar.getAttribute('flexbuttons') == "true");
+
+        /*/ keine Konfigurationsmoeglichkeiten in Mac OS X
+        if(AiOS_HELPER.os == "Darwin") {
+            if(document.getElementById('aios-customize-separator'))
+                document.getElementById('aios-toolbar-contextmenu').removeChild(document.getElementById('aios-customize-separator'));
+
+            if(document.getElementById('aios-customize-mitem'))
+                document.getElementById('aios-toolbar-contextmenu').removeChild(document.getElementById('aios-customize-mitem'));
+        }*/
+    }
+    /*
+    Sidebarheader-Toolbar
+     */
+    else if(aWhich.id == "aios-sbhtoolbar-contextmenu") {
+
+        // Schaltflaechen-Modus => wird fuer CSS-Definitionen benoetigt
+        fx_sidebarHeader.setAttribute('mode', aios_gElem("aios-sbhtoolbar").getAttribute('mode'));
+
+        // Icongroesse
+        document.getElementById('aios-sbhview-mitem4').setAttribute('checked', aios_gElem("aios-sbhtoolbar").getAttribute('iconsize') == "small");
+        fx_sidebarHeader.setAttribute('iconsize', aios_gElem("aios-sbhtoolbar").getAttribute('iconsize'));
+
+        /*/ keine Konfigurationsmoeglichkeiten in Mac OS X
+        if(AiOS_HELPER.os == "Darwin") {
+            if(document.getElementById('aios-sbhcustomize-separator'))
+                document.getElementById('aios-sbhtoolbar-contextmenu').removeChild(document.getElementById('aios-sbhcustomize-separator'));
+
+            if(document.getElementById('aios-sbhcustomize-mitem'))
+                document.getElementById('aios-sbhtoolbar-contextmenu').removeChild(document.getElementById('aios-sbhcustomize-mitem'));
+        }*/
+    }
+}
+
+
+/*
+    positioniert die AiOS- und die Sidebarheader-Toolbar
+        => Aufruf durch die Menueoptionen des Kontextmenues und aios_setSidebarOrient()
+        => Aufruf indirekt auch durch aios_initSidebar() => aios_setSidebarOrient() loest aios_setToolbarPos() aus
+            => posMode 1 = links neben der Sidebar (vertikal)
+            => posMode 2 = rechts neben der Sidebar (vertikal)
+            => posMode 3 = ueber dem Sidebarheader (horizontal)
+            => posMode 4 = unter dem Sidebarheader (horizontal)
+            => posMode 5 = unter der Sidebar (horizontal)
+ */
+function aios_setToolbarPos(posMode) {
+    aios_getObjects();
+
+    var tbox, orient, button_flex, separator;
+
+    if(!posMode) posMode = parseInt(aios_toolbar.getAttribute('posMode'));
+
+    try {
+        var sidebarOrient = AiOS_HELPER.prefBranchAiOS.getIntPref('gen.orient');
+    }
+    catch(e) { }
+
+    switch(posMode) {
+        case 1:
+            tbox = (sidebarOrient == 1) ? "aios-toolbox-left" : "aios-toolbox-right";
+            orient = "vertical";
+            break;
+
+        case 2:
+            tbox = (sidebarOrient == 1) ? "aios-toolbox-right" : "aios-toolbox-left";
+            orient = "vertical";
+            break;
+
+        case 3:
+            tbox = "aios-toolbox-sidebartop";
+            orient = "horizontal";
+            break;
+
+        case 4:
+            tbox = "aios-toolbox-sidebartop2";
+            orient = "horizontal";
+            break;
+
+        case 5:
+            tbox = "aios-toolbox-sidebarbottom";
+            orient = "horizontal";
+            break;
+    }
+
+    aios_toolbar.setAttribute('posMode', posMode);
+    aios_toolbar.setAttribute('orient', orient);
+
+    document.getElementById(tbox).appendChild(aios_toolbar);
+
+    aios_adjustToolboxWidth(false);
+
+    document.getElementById('aios-pos-mitem' + posMode).setAttribute('checked', true);
+}
+
+
+/*
+    stellt die Ansichtsoptionen der Symbolleisten ein
+        => Aufruf durch die Menueoptionen der Symbolleisten-Kontextmenues
+            => viewMode 1 = Symbole und Text
+            => viewMode 2 = Symbole
+            => viewMode 3 = Text
+            => viewMode 4 = kleine Symbole an/aus
+            => viewMode 5 = flexible Buttons an/aus
+ */
+function aios_setToolbarView(aViewMode, aWhich) {
+    aios_getObjects();
+
+    var viewMode = aViewMode;
+
+
+    // feststellen, welche Toolbar konfiguriert werden soll
+    var elem = aWhich;
+    while(elem.tagName != "menupopup") {
+        elem = elem.parentNode;
+    }
+
+    var tbar, menuid;
+
+    if(elem.id == "aios-toolbar-contextmenu") {
+        tbar = aios_gElem("aios-toolbar");
+        menuid = "view";
+    }
+    else {
+        tbar = aios_gElem("aios-sbhtoolbar");
+        menuid = "sbhview";
+    }
+
+
+    // Einstellungen vornehmen
+    var set_property = "mode";
+    var set_value = "full";
+
+    // Modus: Symbole & Text, Symbole, Text
+    if(viewMode <= 2) {
+        if(viewMode == 2) set_value = "icons";
+        document.getElementById('aios-'+menuid+'-mitem4').setAttribute('disabled', false);
+    }
+    else if(viewMode == 3) {
+        set_value = "text";
+        document.getElementById('aios-'+menuid+'-mitem4').setAttribute('disabled', true);
+    }
+
+    // Icongroesse
+    if(viewMode == 4) {
+        set_property = "iconsize";
+        set_value = (aios_getBoolean('aios-'+menuid+'-mitem4', 'checked')) ? "small" : "large";
+    }
+
+    // Flexible Buttons
+    if(viewMode == 5) {
+        set_property = "flexbuttons";
+        set_value = (aios_getBoolean('aios-'+menuid+'-mitem5', 'checked')) ? "true" : "false";
+    }
+
+    tbar.setAttribute(set_property, set_value);
+
+
+    if(tbar == aios_gElem("aios-toolbar")) aios_adjustToolboxWidth(false);
+    else fx_sidebarHeader.setAttribute(set_property, set_value);
+}
+
+
+/*
+    Aktiviert/Deaktiviert die AiOS-Toolbar
+        => Aufruf durch Menueoption (Ansicht > Symbolleisten)
+        => Aufruf durch aios_observeSidebar(), aios_toggleOperaMode(), aios_toggleSidebar(), aios_controlSwitch(), aios_BrowserFullScreen
+ */
+function aios_toggleToolbar(aWhich) {
+    aios_getObjects();
+
+    var mode = (typeof aWhich == "boolean") ? aWhich : !aios_getBoolean(aWhich, 'checked');
+
+    aios_toolbar.hidden = mode;
+
+    // setting (collapsed) aus aelteren Versionen (<= 0.7.8) rueckgaengig machen (war auf persist gesetzt)
+    // wenn die Toolbox 'collapsed' ist (Observer der Toolbar), ist die Sidebargroesse nicht veraenderbar, wenn die Toolbar deaktiviert ist
+    /*if(aios_toolbar.getAttribute('collapsed')) {
+        aios_toolbar.removeAttribute('collapsed');
+        document.persist(aios_toolbar.id, 'collapsed');
+    }*/
+
+    aios_adjustToolboxWidth(false);
+}
+
+
+/*
+    fuegt dem Menue Ansicht > Symbolleisten und dem Kontextmenue der Symbolleisten eine Option hinzu
+        => Aufruf durch onpopupshowing-Handler der Menues in aios.xul
+ */
+function aios_addToolbarMitem(aWhich) {
+    aios_getObjects();
+
+    var popup = document.getElementById('viewToolbarsMenu').firstChild;
+    if(aWhich.id == "toolbar-context-menu") popup = document.getElementById('toolbar-context-menu');
+
+    // Menuitem erzeugen
+    var menuItem = document.createElement("menuitem");
+    // toolbarid = TotalToolbar-Fix => ohne wird der Eintrag mehrmals angezeigt, weil das Menue nicht korrekt entleert wird
+    menuItem.setAttribute("toolbarId", 'aios-toolbar');
+    menuItem.setAttribute("observes", "aios-viewToolbar");
+    menuItem.setAttribute("label", aios_toolbar.getAttribute('toolbarname'));
+
+    var mitems = popup.childNodes;
+    for(var i = 0; i < mitems.length; i++) {
+        // TotalToolbar => unnoetige/unerwuenschte Menuitems entfernen
+        if(mitems[i].tagName == "menuitem") {
+            if(mitems[i].getAttribute('toolbarId') == "aios-toolbar") mitems[i].parentNode.removeChild(mitems[i]);
+            if(mitems[i].getAttribute('toolbarId') == "aios-sbhtoolbar") mitems[i].parentNode.removeChild(mitems[i]);
+            if(mitems[i].getAttribute('label') == menuItem.getAttribute("label")) mitems[i].parentNode.removeChild(mitems[i]);
+        }
+
+        // ersten Separator ermitteln, um gleich den Menueeintrag direkt davor einzufuegen
+        if(mitems[i].tagName == "menuseparator" && !aios_context_sep) {
+            var aios_context_sep = mitems[i];
+        }
+    }
+
+    // AiOS-Toolbar einfuegen
+    //popup.insertBefore(menuItem.cloneNode(true), popup.firstChild);
+    //popup.insertBefore(menuItem.cloneNode(true), popup.lastChild.previousSibling);
+    popup.insertBefore(menuItem.cloneNode(true), aios_context_sep);
 }
\ No newline at end of file
diff --git a/content/console.js b/content/console.js
index b3dbef8..74ceb88 100644
--- a/content/console.js
+++ b/content/console.js
@@ -1,70 +1,70 @@
-
-// Window-Element ermitteln
-var conWindow;
-if(document.getElementById('JSConsoleWindow')) conWindow = document.getElementById('JSConsoleWindow');
-if(document.getElementById('Console2Window')) conWindow = document.getElementById('Console2Window');
-
-
-/*
-    Initialisierung
-        => Aufruf durch onload in console.xul
-*/
-function aios_init() {
-
-    try {
-        var enable_layout = AiOS_HELPER.prefBranchAiOS.getBoolPref("co.layout");
-        var enable_layoutall = AiOS_HELPER.prefBranchAiOS.getBoolPref("co.layoutall");
-
-        var aios_inSidebar = (top.document.getElementById('sidebar-box')) ? true : false;
-    }
-    catch(e) { }
-
-    // Menueleiste unter Mac OS X ausblenden
-    aios_hideMacMenubar();
-
-    // fuer CSS-Zwecke speichern
-    AiOS_HELPER.rememberAppInfo( conWindow );
-
-    // Layout-Optimierungen aktivieren?
-    if((enable_layout && aios_inSidebar) || enable_layoutall) aios_sidebarLayout();
-
-    // Tastaturkuerzel entfernen, um nicht die des Hauptbrowsers zu blockieren
-    if(aios_inSidebar) aios_removeAccesskeys();
-}
-
-
-/*
-    aktiviert das an die Sidebar angepasste Layout
-        => Aufruf durch aios_init()
-*/
-function aios_sidebarLayout() {
-
-    aios_addCSS("console.css", conWindow);
-
-    // Fx-Error-Console
-    if(conWindow.id == "JSConsoleWindow") {
-        // Spacer erzeugen und einfuegen
-        var new_spacer = document.createElement("spacer");
-        new_spacer.setAttribute("flex", 1);
-        var theToolbar = document.getElementById('ToolbarMode');
-        theToolbar.insertBefore(new_spacer, theToolbar.childNodes[theToolbar.childNodes.length - 2]);
-
-        // Toolbarbuttons mit Tooltip
-        if(document.getElementById("ToolbarMode")) {
-            var tbChilds = document.getElementById("ToolbarMode").childNodes;
-            for(var i = 0; i < tbChilds.length; i++) {
-                if(tbChilds[i].tagName == "toolbarbutton") tbChilds[i].setAttribute('tooltiptext', tbChilds[i].getAttribute('label'));
-            }
-        }
-
-        // Label der Buttons unsichtbar machen => nur wenn es Icons gibt
-        var cStyle = document.defaultView.getComputedStyle(document.getElementById('Console:modeAll'), '');
-    }
-    else if (conWindow.id == "Console2Window") {
-        var cStyle = document.defaultView.getComputedStyle(document.getElementById('item_modeAll'), '');
-    }
-
-    if(cStyle && cStyle.listStyleImage && cStyle.listStyleImage != "none") {
-        if(document.getElementById('ToolbarMode')) document.getElementById('ToolbarMode').setAttribute("hideLabel", true);
-    }
+
+// Window-Element ermitteln
+var conWindow;
+if(document.getElementById('JSConsoleWindow')) conWindow = document.getElementById('JSConsoleWindow');
+if(document.getElementById('Console2Window')) conWindow = document.getElementById('Console2Window');
+
+
+/*
+    Initialisierung
+        => Aufruf durch onload in console.xul
+*/
+function aios_init() {
+
+    try {
+        var enable_layout = AiOS_HELPER.prefBranchAiOS.getBoolPref("co.layout");
+        var enable_layoutall = AiOS_HELPER.prefBranchAiOS.getBoolPref("co.layoutall");
+
+        var aios_inSidebar = (top.document.getElementById('sidebar-box')) ? true : false;
+    }
+    catch(e) { }
+
+    // Menueleiste unter Mac OS X ausblenden
+    aios_hideMacMenubar();
+
+    // fuer CSS-Zwecke speichern
+    AiOS_HELPER.rememberAppInfo( conWindow );
+
+    // Layout-Optimierungen aktivieren?
+    if((enable_layout && aios_inSidebar) || enable_layoutall) aios_sidebarLayout();
+
+    // Tastaturkuerzel entfernen, um nicht die des Hauptbrowsers zu blockieren
+    if(aios_inSidebar) aios_removeAccesskeys();
+}
+
+
+/*
+    aktiviert das an die Sidebar angepasste Layout
+        => Aufruf durch aios_init()
+*/
+function aios_sidebarLayout() {
+
+    aios_addCSS("console.css", conWindow);
+
+    // Fx-Error-Console
+    if(conWindow.id == "JSConsoleWindow") {
+        // Spacer erzeugen und einfuegen
+        var new_spacer = document.createElement("spacer");
+        new_spacer.setAttribute("flex", 1);
+        var theToolbar = document.getElementById('ToolbarMode');
+        theToolbar.insertBefore(new_spacer, theToolbar.childNodes[theToolbar.childNodes.length - 2]);
+
+        // Toolbarbuttons mit Tooltip
+        if(document.getElementById("ToolbarMode")) {
+            var tbChilds = document.getElementById("ToolbarMode").childNodes;
+            for(var i = 0; i < tbChilds.length; i++) {
+                if(tbChilds[i].tagName == "toolbarbutton") tbChilds[i].setAttribute('tooltiptext', tbChilds[i].getAttribute('label'));
+            }
+        }
+
+        // Label der Buttons unsichtbar machen => nur wenn es Icons gibt
+        var cStyle = document.defaultView.getComputedStyle(document.getElementById('Console:modeAll'), '');
+    }
+    else if (conWindow.id == "Console2Window") {
+        var cStyle = document.defaultView.getComputedStyle(document.getElementById('item_modeAll'), '');
+    }
+
+    if(cStyle && cStyle.listStyleImage && cStyle.listStyleImage != "none") {
+        if(document.getElementById('ToolbarMode')) document.getElementById('ToolbarMode').setAttribute("hideLabel", true);
+    }
 }
\ No newline at end of file
diff --git a/content/multipanel.js b/content/multipanel.js
index 2a9adeb..c95ba7d 100644
--- a/content/multipanel.js
+++ b/content/multipanel.js
@@ -1,265 +1,265 @@
-
-var aios_inSidebar = (top.document.getElementById('sidebar-box')) ? true : false;
-
-var webPanel;
-if(document.getElementById('web-panels-browser')) webPanel = document.getElementById('web-panels-browser');
-
-
-/*
-    Initialisierung
-        => Aufruf durch onload in console.xul
-*/
-function aios_init() {
-    // Sidebar-/Fenster-Titel setzen
-    aios_setSBLabel();
-
-    // Buttons aktivieren/deaktivieren
-    aios_setOptions();
-
-    window.setTimeout(function() {
-        aios_setSSR();
-    }, 50);
-
-    // fuer CSS-Zwecke speichern
-    AiOS_HELPER.rememberAppInfo( document.getElementById('webpanels-window') );
-}
-
-
-/*
-    modifizierte Original-Ueberwachungsfunktion aus web-panels.js
-*/
-var panelProgressListener = {
-    onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress,
-        aCurTotalProgress, aMaxTotalProgress) {
-    },
-
-    onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
-        if(!aRequest) return;
-
-        // Sidebar-/Fenster-Titel setzen
-        aios_setSBLabel();
-
-        // Small Screen Rendering?
-        //aios_setSSR();
-
-        // Buttons aktivieren/deaktivieren
-        //aios_setOptions();
-
-        //ignore local/resource:/chrome: files
-        if(aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO) return;
-
-        const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
-        const nsIChannel = Components.interfaces.nsIChannel;
-
-        if(aStateFlags & nsIWebProgressListener.STATE_START && aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
-            if(window.parent.document.getElementById('sidebar-throbber'))
-                window.parent.document.getElementById('sidebar-throbber').setAttribute("loading", "true");
-        }
-        else if(aStateFlags & nsIWebProgressListener.STATE_STOP && aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
-            if(window.parent.document.getElementById('sidebar-throbber'))
-                window.parent.document.getElementById('sidebar-throbber').removeAttribute("loading");
-        }
-    },
-
-    onLocationChange: function(aWebProgress, aRequest, aLocation) {
-        // Buttons aktivieren/deaktivieren
-        aios_setOptions();
-    },
-
-    onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {
-        // Small Screen Rendering?
-        aios_setSSR();
-    },
-
-    onSecurityChange: function(aWebProgress, aRequest, aState) {
-    },
-
-    QueryInterface: function(aIID) {
-        if(aIID.equals(Components.interfaces.nsIWebProgressListener) ||
-            aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
-            aIID.equals(Components.interfaces.nsISupports))
-            return this;
-
-        throw Components.results.NS_NOINTERFACE;
-    }
-};
-
-
-/*
-    Oeffnet im MultiPanel die im Browser angezeigte Webseite
-        => Aufruf durch Buttons, aios_panelTab()
-*/
-function aios_setMultiPanel(aMode) {
-    var label, panelLoc;
-    var aios_CONTENT = AiOS_HELPER.mostRecentWindow.document.getElementById('content');
-
-    // about:-Eintraege
-    if(aMode.indexOf("about:") == 0 && aMode != "about:blank") {
-        panelLoc = (aMode == "about:config") ? "chrome://global/content/config.xul" : aMode;
-        label = aMode;
-    }
-    // WebPanel-Page
-    else {
-        try {
-            panelLoc = aios_CONTENT.currentURI.spec;
-            label = aios_CONTENT.selectedTab.label;
-        } catch(e) { }
-
-        // ich bin das MultiPanel im Tab
-        if(top.toString() == "[object Window]" && AiOS_HELPER.mostRecentWindow.aiosLastSelTab) {
-            panelLoc = AiOS_HELPER.mostRecentWindow.aiosLastSelTab.document.location.href;
-        }
-    }
-
-    // wenn auf "Page" geklickt wird, waehrend im Tab das MultiPanel geladen ist
-    if(panelLoc == "chrome://browser/content/web-panels.xul") {
-        panelLoc = aios_CONTENT.contentDocument.getElementById('web-panels-browser').getAttribute('cachedurl');
-    }
-
-    var newLabel = "";
-
-    // MultiPanel oeffnen bzw. Inhalt laden
-    if(top.document.getElementById('sidebar') && top.toString() != "[object Window]")   top.openWebPanel(newLabel, panelLoc);
-    else webPanel.contentDocument.location.href = panelLoc;
-}
-
-
-/*
-    aktiviert/deaktiviert die Toolbarbuttons und Radio-Menuitems (about)
-        => Aufruf durch onLocationChange() wenn sich MultiPanel-URL aendert (panelProgressListener)
-*/
-function aios_setOptions() {
-
-    var mode, i;
-
-    var aboutGroup = document.getElementById('aboutGroup').childNodes;
-    var panelLoc = webPanel.contentDocument.location.href;
-
-    if(panelLoc != "about:blank") {
-        mode = "page";
-        if(panelLoc.indexOf("about:") == 0 && panelLoc != "about:home") mode = "about";
-        if(panelLoc == "chrome://global/content/config.xul") mode = "about";
-    }
-
-    if(!mode) return false;
-
-    if(mode != "page") document.getElementById('page-button').setAttribute('checked', false);
-    if(mode != "about") document.getElementById('about-button').setAttribute('checked', false);
-    document.getElementById(mode + '-button').setAttribute('checked', true);
-
-    if(mode == "page") {
-        for(i = 0; i < aboutGroup.length; i++) {
-            if(aboutGroup[i].tagName == "menuitem") aboutGroup[i].setAttribute('checked', false);
-        }
-    }
-    else {
-        for(i = 0; i < aboutGroup.length; i++) {
-            var label = aboutGroup[i].getAttribute('label');
-            var isActive = label == panelLoc;
-            isActive = (label == "about:config" && panelLoc == "chrome://global/content/config.xul");
-            if(aboutGroup[i].tagName == "menuitem" && isActive) aboutGroup[i].setAttribute('checked', true);
-        }
-    }
-
-    webPanel.setAttribute('cachedurl', panelLoc);
-    document.persist('web-panels-browser', "cachedurl");
-
-    return true;
-}
-
-
-/*
-    Sidebar-Label einstellen
-        => Aufruf durch onload-Event und onStateChange() wenn sich MultiPanel-URL aendert (panelProgressListener)
-*/
-function aios_setSBLabel() {
-    var newLabel = "";
-
-    var mpLabel = AiOS_HELPER.mostRecentWindow.document.getElementById('viewWebPanelsSidebar').getAttribute('label');
-
-    if(webPanel && webPanel.contentDocument) {
-        var loc = webPanel.contentDocument.location.href;
-
-        if(webPanel.contentDocument.title != "") newLabel = newLabel + webPanel.contentDocument.title;
-    }
-
-    if(newLabel != "") newLabel = newLabel + " - " + mpLabel;
-    else newLabel = mpLabel;
-
-    if(top.document.getElementById('sidebar-title'))
-        top.document.getElementById('sidebar-title').setAttribute('value', newLabel);
-
-    if(!top.document.getElementById('sidebar-title')) top.document.title = newLabel;
-}
-
-
-/*
-    Small Screen Rendering ein/aus
-        => Aufruf durch onStateChange() wenn sich MultiPanel-URL aendert (panelProgressListener)
-        Original-Code in Teilen von: Daniel Glazman <glazman at netscape.com>
-*/
-function aios_setSSR() {
-    //if(!aios_getBoolean("ssr-mitem", "checked")) return false;
-
-    var ssrURL = "chrome://aios/skin/css/multipanel_ssr.css";
-
-    try {
-        var doc = webPanel.contentDocument;
-    //var docRoot = doc.documentElement;    // Abfrage verursacht bei einigen Seiten einen groesser skalierten Text ???
-    //var docRootName = docRoot.nodeName.toLowerCase();
-    } catch(e) { }
-
-    //if(!doc || !docRoot || !docRootName || !doc.body || !aios_getBoolean("page-button", "checked")) return false;
-    if(!doc || !doc.body || !aios_getBoolean("page-button", "checked")) return false;
-
-    // is the document using frames ? we don't like frames for the moment
-    //if(docRootName == "html" && doc.body.nodeName.toLowerCase() == "frameset") {
-    if(doc.body.nodeName.toLowerCase() == "frameset") {
-        dump("Small Screen Rendering, No frames allowed");
-        return false;
-    }
-
-    var styleSheets = doc.styleSheets;
-    for(var i = 0; i < styleSheets.length; ++i) {
-        var currentStyleSheet = styleSheets[i];
-
-        if(/multipanel_ssr/.test(currentStyleSheet.href)) {
-            currentStyleSheet.disabled = !aios_getBoolean("ssr-mitem", "checked");
-            var aiosSidebar = aios_getBoolean("ssr-mitem", "checked") && aios_getBoolean("ssrSidebar-mitem", "checked");
-            doc.body.setAttribute('aiosSidebar', aiosSidebar);
-            return true;
-        }
-    }
-
-    // we have to attach the stylesheet to the document...
-    // what's the document root ? html ?
-    //if(docRootName == "html" && aios_getBoolean("ssr-mitem", "checked")) {
-    if(aios_getBoolean("ssr-mitem", "checked")) {
-        // let's create a link element
-        var headElement = doc.getElementsByTagName("head")[0];
-        var linkElement = doc.createElement("link");
-        linkElement.setAttribute("rel", "stylesheet");
-        linkElement.setAttribute("type", "text/css");
-        linkElement.setAttribute("href", ssrURL);
-
-        headElement.appendChild(linkElement);
-    }
-
-    return true;
-}
-
-
-/*
-    MultiPanel-Unload
-*/
-function aios_unloadMultiPanel() {
-    if(webPanel && !aios_getBoolean("aios-remMultiPanel", "checked")) {
-        webPanel.setAttribute('cachedurl', '');
-        document.persist('web-panels-browser', "cachedurl");
-    }
-}
-
-
-function aios_getPageOptions() {
-    document.getElementById('ssrSidebar-mitem').setAttribute('disabled', !aios_getBoolean("ssr-mitem", "checked"));
+
+var aios_inSidebar = (top.document.getElementById('sidebar-box')) ? true : false;
+
+var webPanel;
+if(document.getElementById('web-panels-browser')) webPanel = document.getElementById('web-panels-browser');
+
+
+/*
+    Initialisierung
+        => Aufruf durch onload in console.xul
+*/
+function aios_init() {
+    // Sidebar-/Fenster-Titel setzen
+    aios_setSBLabel();
+
+    // Buttons aktivieren/deaktivieren
+    aios_setOptions();
+
+    window.setTimeout(function() {
+        aios_setSSR();
+    }, 50);
+
+    // fuer CSS-Zwecke speichern
+    AiOS_HELPER.rememberAppInfo( document.getElementById('webpanels-window') );
+}
+
+
+/*
+    modifizierte Original-Ueberwachungsfunktion aus web-panels.js
+*/
+var panelProgressListener = {
+    onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress,
+        aCurTotalProgress, aMaxTotalProgress) {
+    },
+
+    onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
+        if(!aRequest) return;
+
+        // Sidebar-/Fenster-Titel setzen
+        aios_setSBLabel();
+
+        // Small Screen Rendering?
+        //aios_setSSR();
+
+        // Buttons aktivieren/deaktivieren
+        //aios_setOptions();
+
+        //ignore local/resource:/chrome: files
+        if(aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO) return;
+
+        const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
+        const nsIChannel = Components.interfaces.nsIChannel;
+
+        if(aStateFlags & nsIWebProgressListener.STATE_START && aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
+            if(window.parent.document.getElementById('sidebar-throbber'))
+                window.parent.document.getElementById('sidebar-throbber').setAttribute("loading", "true");
+        }
+        else if(aStateFlags & nsIWebProgressListener.STATE_STOP && aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
+            if(window.parent.document.getElementById('sidebar-throbber'))
+                window.parent.document.getElementById('sidebar-throbber').removeAttribute("loading");
+        }
+    },
+
+    onLocationChange: function(aWebProgress, aRequest, aLocation) {
+        // Buttons aktivieren/deaktivieren
+        aios_setOptions();
+    },
+
+    onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {
+        // Small Screen Rendering?
+        aios_setSSR();
+    },
+
+    onSecurityChange: function(aWebProgress, aRequest, aState) {
+    },
+
+    QueryInterface: function(aIID) {
+        if(aIID.equals(Components.interfaces.nsIWebProgressListener) ||
+            aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
+            aIID.equals(Components.interfaces.nsISupports))
+            return this;
+
+        throw Components.results.NS_NOINTERFACE;
+    }
+};
+
+
+/*
+    Oeffnet im MultiPanel die im Browser angezeigte Webseite
+        => Aufruf durch Buttons, aios_panelTab()
+*/
+function aios_setMultiPanel(aMode) {
+    var label, panelLoc;
+    var aios_CONTENT = AiOS_HELPER.mostRecentWindow.document.getElementById('content');
+
+    // about:-Eintraege
+    if(aMode.indexOf("about:") == 0 && aMode != "about:blank") {
+        panelLoc = (aMode == "about:config") ? "chrome://global/content/config.xul" : aMode;
+        label = aMode;
+    }
+    // WebPanel-Page
+    else {
+        try {
+            panelLoc = aios_CONTENT.currentURI.spec;
+            label = aios_CONTENT.selectedTab.label;
+        } catch(e) { }
+
+        // ich bin das MultiPanel im Tab
+        if(top.toString() == "[object Window]" && AiOS_HELPER.mostRecentWindow.aiosLastSelTab) {
+            panelLoc = AiOS_HELPER.mostRecentWindow.aiosLastSelTab.document.location.href;
+        }
+    }
+
+    // wenn auf "Page" geklickt wird, waehrend im Tab das MultiPanel geladen ist
+    if(panelLoc == "chrome://browser/content/web-panels.xul") {
+        panelLoc = aios_CONTENT.contentDocument.getElementById('web-panels-browser').getAttribute('cachedurl');
+    }
+
+    var newLabel = "";
+
+    // MultiPanel oeffnen bzw. Inhalt laden
+    if(top.document.getElementById('sidebar') && top.toString() != "[object Window]")   top.openWebPanel(newLabel, panelLoc);
+    else webPanel.contentDocument.location.href = panelLoc;
+}
+
+
+/*
+    aktiviert/deaktiviert die Toolbarbuttons und Radio-Menuitems (about)
+        => Aufruf durch onLocationChange() wenn sich MultiPanel-URL aendert (panelProgressListener)
+*/
+function aios_setOptions() {
+
+    var mode, i;
+
+    var aboutGroup = document.getElementById('aboutGroup').childNodes;
+    var panelLoc = webPanel.contentDocument.location.href;
+
+    if(panelLoc != "about:blank") {
+        mode = "page";
+        if(panelLoc.indexOf("about:") == 0 && panelLoc != "about:home") mode = "about";
+        if(panelLoc == "chrome://global/content/config.xul") mode = "about";
+    }
+
+    if(!mode) return false;
+
+    if(mode != "page") document.getElementById('page-button').setAttribute('checked', false);
+    if(mode != "about") document.getElementById('about-button').setAttribute('checked', false);
+    document.getElementById(mode + '-button').setAttribute('checked', true);
+
+    if(mode == "page") {
+        for(i = 0; i < aboutGroup.length; i++) {
+            if(aboutGroup[i].tagName == "menuitem") aboutGroup[i].setAttribute('checked', false);
+        }
+    }
+    else {
+        for(i = 0; i < aboutGroup.length; i++) {
+            var label = aboutGroup[i].getAttribute('label');
+            var isActive = label == panelLoc;
+            isActive = (label == "about:config" && panelLoc == "chrome://global/content/config.xul");
+            if(aboutGroup[i].tagName == "menuitem" && isActive) aboutGroup[i].setAttribute('checked', true);
+        }
+    }
+
+    webPanel.setAttribute('cachedurl', panelLoc);
+    document.persist('web-panels-browser', "cachedurl");
+
+    return true;
+}
+
+
+/*
+    Sidebar-Label einstellen
+        => Aufruf durch onload-Event und onStateChange() wenn sich MultiPanel-URL aendert (panelProgressListener)
+*/
+function aios_setSBLabel() {
+    var newLabel = "";
+
+    var mpLabel = AiOS_HELPER.mostRecentWindow.document.getElementById('viewWebPanelsSidebar').getAttribute('label');
+
+    if(webPanel && webPanel.contentDocument) {
+        var loc = webPanel.contentDocument.location.href;
+
+        if(webPanel.contentDocument.title != "") newLabel = newLabel + webPanel.contentDocument.title;
+    }
+
+    if(newLabel != "") newLabel = newLabel + " - " + mpLabel;
+    else newLabel = mpLabel;
+
+    if(top.document.getElementById('sidebar-title'))
+        top.document.getElementById('sidebar-title').setAttribute('value', newLabel);
+
+    if(!top.document.getElementById('sidebar-title')) top.document.title = newLabel;
+}
+
+
+/*
+    Small Screen Rendering ein/aus
+        => Aufruf durch onStateChange() wenn sich MultiPanel-URL aendert (panelProgressListener)
+        Original-Code in Teilen von: Daniel Glazman <glazman at netscape.com>
+*/
+function aios_setSSR() {
+    //if(!aios_getBoolean("ssr-mitem", "checked")) return false;
+
+    var ssrURL = "chrome://aios/skin/css/multipanel_ssr.css";
+
+    try {
+        var doc = webPanel.contentDocument;
+    //var docRoot = doc.documentElement;    // Abfrage verursacht bei einigen Seiten einen groesser skalierten Text ???
+    //var docRootName = docRoot.nodeName.toLowerCase();
+    } catch(e) { }
+
+    //if(!doc || !docRoot || !docRootName || !doc.body || !aios_getBoolean("page-button", "checked")) return false;
+    if(!doc || !doc.body || !aios_getBoolean("page-button", "checked")) return false;
+
+    // is the document using frames ? we don't like frames for the moment
+    //if(docRootName == "html" && doc.body.nodeName.toLowerCase() == "frameset") {
+    if(doc.body.nodeName.toLowerCase() == "frameset") {
+        dump("Small Screen Rendering, No frames allowed");
+        return false;
+    }
+
+    var styleSheets = doc.styleSheets;
+    for(var i = 0; i < styleSheets.length; ++i) {
+        var currentStyleSheet = styleSheets[i];
+
+        if(/multipanel_ssr/.test(currentStyleSheet.href)) {
+            currentStyleSheet.disabled = !aios_getBoolean("ssr-mitem", "checked");
+            var aiosSidebar = aios_getBoolean("ssr-mitem", "checked") && aios_getBoolean("ssrSidebar-mitem", "checked");
+            doc.body.setAttribute('aiosSidebar', aiosSidebar);
+            return true;
+        }
+    }
+
+    // we have to attach the stylesheet to the document...
+    // what's the document root ? html ?
+    //if(docRootName == "html" && aios_getBoolean("ssr-mitem", "checked")) {
+    if(aios_getBoolean("ssr-mitem", "checked")) {
+        // let's create a link element
+        var headElement = doc.getElementsByTagName("head")[0];
+        var linkElement = doc.createElement("link");
+        linkElement.setAttribute("rel", "stylesheet");
+        linkElement.setAttribute("type", "text/css");
+        linkElement.setAttribute("href", ssrURL);
+
+        headElement.appendChild(linkElement);
+    }
+
+    return true;
+}
+
+
+/*
+    MultiPanel-Unload
+*/
+function aios_unloadMultiPanel() {
+    if(webPanel && !aios_getBoolean("aios-remMultiPanel", "checked")) {
+        webPanel.setAttribute('cachedurl', '');
+        document.persist('web-panels-browser', "cachedurl");
+    }
+}
+
+
+function aios_getPageOptions() {
+    document.getElementById('ssrSidebar-mitem').setAttribute('disabled', !aios_getBoolean("ssr-mitem", "checked"));
 }
\ No newline at end of file
diff --git a/content/pageinfo.js b/content/pageinfo.js
index 658db12..f06fc90 100644
--- a/content/pageinfo.js
+++ b/content/pageinfo.js
@@ -1,342 +1,342 @@
-
-var aios_inSidebar = (top.document.getElementById('sidebar-box')) ? true : false;
-var aios_inTab = (AiOS_HELPER.mostRecentWindow.aiosLastSelTab) ? true : false;
-
-// Listener fuer automatische Aktualisierung hinzufuegen u. entfernen
-if(aios_inSidebar) {
-    window.addEventListener("load", function(e) {
-        top.gBrowser.addProgressListener(aiosProgListener);
-    }, false);
-
-    window.addEventListener("unload",function(e) {
-        top.gBrowser.removeProgressListener(aiosProgListener);
-    }, false);
-}
-
-
-
-function aios_init() {
-    // Menueleiste unter Mac OS X ausblenden
-    aios_hideMacMenubar();
-
-    // fuer CSS-Zwecke speichern
-    AiOS_HELPER.rememberAppInfo( document.getElementById('main-window') );
-
-    try {
-        var enable_layout = AiOS_HELPER.prefBranchAiOS.getBoolPref("pi.layout");
-        var enable_layoutall = AiOS_HELPER.prefBranchAiOS.getBoolPref("pi.layoutall");
-        if((enable_layout && aios_inSidebar) || enable_layoutall) aios_sidebarLayout();
-    }
-    catch(e) { }
-
-    // Tastaturkuerzel entfernen, um nicht die des Hauptbrowsers zu blockieren
-    if(aios_inSidebar) aios_removeAccesskeys();
-
-    //alert(document.getElementById('topBar').clientWidth);
-    //document.getElementById('metatree').getElementsByTagName('treechildren')[0].style.maxWidth = document.getElementById('topBar').clientWidth + "px";
-}
-
-
-function aios_sidebarLayout() {
-    var vbox;
-
-    // CSS fuer Sidebar-Optimierungen aktivieren
-    aios_addCSS("pageinfo.css", "main-window");
-
-    // Label der Radio-Buttons unsichtbar machen => nur wenn es Icons gibt
-    var cStyle = document.defaultView.getComputedStyle(document.getElementById('generalTab'), '');
-    if(cStyle.listStyleImage && cStyle.listStyleImage != "none") {
-        if(document.getElementById('viewGroup')) document.getElementById('viewGroup').setAttribute("hideLabel", true);
-    }
-
-    // Radio-Buttons mit Tooltip
-    if(document.getElementById('viewGroup')) {
-        var radioChilds = document.getElementById('viewGroup').childNodes;
-        for(var i = 0; i < radioChilds.length; i++) {
-            if(radioChilds[i].tagName == "radio") radioChilds[i].setAttribute('tooltiptext', radioChilds[i].label);
-        }
-    }
-
-    // Media-Panel: Save as... button umbrechen
-    var hbox = document.getElementById('mediaPreviewBox').getElementsByTagName('hbox')[0];
-    hbox.setAttribute('align', 'start');
-    hbox.setAttribute('orient', 'vertical');
-    hbox.removeChild(hbox.getElementsByTagName('spacer')[0]);
-    hbox.appendChild(hbox.getElementsByTagName('vbox')[0]);
-
-    // Security-Panel: Texte und Buttons umbrechen
-    // Identity
-    var groupbox = document.getElementById('security-identity-groupbox');
-    groupbox.removeChild(groupbox.getElementsByTagName('spacer')[0]);
-    groupbox.getElementsByTagName('hbox')[0].setAttribute('orient', 'vertical');
-    groupbox.getElementsByTagName('hbox')[0].setAttribute('align', 'start');
-
-    // History
-    var historyrow = document.getElementById('security-privacy-history-label').parentNode;
-    vbox = document.createElement("vbox");
-    while(historyrow.childNodes.length != 0) {
-        vbox.appendChild(historyrow.firstChild);
-    }
-    vbox.setAttribute('flex', '100');
-    historyrow.appendChild(vbox);
-
-    // Cookies
-    var cookierow = document.getElementById('security-privacy-cookies-label').parentNode;
-    vbox = document.createElement("vbox");
-    while(cookierow.childNodes.length != 0) {
-        vbox.appendChild(cookierow.firstChild);
-    }
-    vbox.setAttribute('flex', '100');
-    cookierow.appendChild(vbox);
-
-    // Passwords
-    var pwdrow = document.getElementById('security-privacy-passwords-label').parentNode;
-    vbox = document.createElement("vbox");
-    while(pwdrow.childNodes.length != 0) {
-        vbox.appendChild(pwdrow.firstChild);
-    }
-    vbox.setAttribute('flex', '100');
-    pwdrow.appendChild(vbox);
-}
-
-
-// automatische Aktualisierung => Aufruf durch aiosProgListener (_helper.js)
-function aios_onLocationChange() {
-    if(aios_inSidebar) {
-        aios_persistSelTab();
-        location.reload();
-    }
-}
-
-
-function aios_onStateChange() {
-    aios_onLocationChange();
-}
-
-
-// letzten selektierten Tab merken
-function aios_persistSelTab() {
-    document.getElementById('main-window').setAttribute("seltab", document.getElementById('viewGroup').selectedIndex);
-}
-
-
-/* Called when PageInfo window is loaded.  Arguments are:
- *  window.arguments[0] - (optional) an object consisting of
- *                         - doc: (optional) document to use for source. if not provided,
- *                                the calling window's document will be used
- *                         - initialTab: (optional) id of the inital tab to display
- */
-function onLoadPageInfo() {
-    gBundle = document.getElementById("pageinfobundle");
-    gStrings.unknown = gBundle.getString("unknown");
-    gStrings.notSet = gBundle.getString("notset");
-    gStrings.mediaImg = gBundle.getString("mediaImg");
-    gStrings.mediaBGImg = gBundle.getString("mediaBGImg");
-    gStrings.mediaObject = gBundle.getString("mediaObject");
-    gStrings.mediaEmbed = gBundle.getString("mediaEmbed");
-    gStrings.mediaLink = gBundle.getString("mediaLink");
-    gStrings.mediaInput = gBundle.getString("mediaInput");
-    //@line 292 "e:\builds\moz2_slave\rel-cen-w32-bld\build\browser\base\content\pageinfo\pageInfo.js"
-    gStrings.mediaVideo = gBundle.getString("mediaVideo");
-    gStrings.mediaAudio = gBundle.getString("mediaAudio");
-    //@line 295 "e:\builds\moz2_slave\rel-cen-w32-bld\build\browser\base\content\pageinfo\pageInfo.js"
-
-    var args = "arguments" in window &&
-    window.arguments.length >= 1 &&
-    window.arguments[0];
-
-    // mod by eXXile
-    if(aios_inSidebar) {
-        var aios_sidebar = top.document.getElementById('sidebar-box');
-        var aios_window = document.getElementById('main-window');
-
-        gDocument = AiOS_HELPER.mostRecentWindow.content.document;
-        gWindow = AiOS_HELPER.mostRecentWindow.content.window;
-    }
-    else if(aios_inTab) {
-
-        gDocument = AiOS_HELPER.mostRecentWindow.aiosLastSelTab.document;
-        gWindow = AiOS_HELPER.mostRecentWindow.content.window;
-    }
-    // Original-FF-Teil
-    else {
-        if (!args || !args.doc) {
-            gWindow = window.opener.content;
-            gDocument = gWindow.document;
-        }
-    }
-
-    // init media view
-    var imageTree = document.getElementById("imagetree");
-    imageTree.view = gImageView;
-
-    /* Select the requested tab, if the name is specified */
-    loadTab(args);
-    Components.classes["@mozilla.org/observer-service;1"]
-    .getService(Components.interfaces.nsIObserverService)
-    .notifyObservers(window, "page-info-dialog-loaded", null);
-}
-
-
-var security = {
-    // Display the server certificate (static)
-    viewCert : function () {
-        var cert = security._cert;
-        //viewCertHelper(window, cert);
-
-        // mod by eXXile
-        if(aios_inSidebar) viewCertHelper(AiOS_HELPER.mostRecentWindow.content.window, cert);
-        else if(aios_inTab) viewCertHelper(AiOS_HELPER.mostRecentWindow.aiosLastSelTab.window, cert);
-        else viewCertHelper(window, cert);
-    // endmod by eXXile
-    },
-
-    _getSecurityInfo : function() {
-        const nsIX509Cert = Components.interfaces.nsIX509Cert;
-        //mod by exxile const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
-        const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
-        const nsISSLStatusProvider = Components.interfaces.nsISSLStatusProvider;
-        const nsISSLStatus = Components.interfaces.nsISSLStatus;
-
-        // We don't have separate info for a frame, return null until further notice
-        // (see bug 138479)
-        if (gWindow != gWindow.top)
-            return null;
-
-        var hName = null;
-        try {
-            hName = gWindow.location.host;
-        }
-        catch (exception) { }
-
-        var ui = security._getSecurityUI();
-        if (!ui)
-            return null;
-
-        var isBroken =
-        (ui.state & Components.interfaces.nsIWebProgressListener.STATE_IS_BROKEN);
-        var isInsecure =
-        (ui.state & Components.interfaces.nsIWebProgressListener.STATE_IS_INSECURE);
-        var isEV =
-        (ui.state & Components.interfaces.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL);
-        ui.QueryInterface(nsISSLStatusProvider);
-        var status = ui.SSLStatus;
-
-        if (!isInsecure && status) {
-            status.QueryInterface(nsISSLStatus);
-            var cert = status.serverCert;
-            var issuerName =
-            this.mapIssuerOrganization(cert.issuerOrganization) || cert.issuerName;
-
-            var retval = {
-                hostName : hName,
-                cAName : issuerName,
-                encryptionAlgorithm : undefined,
-                encryptionStrength : undefined,
-                isBroken : isBroken,
-                isEV : isEV,
-                cert : cert,
-                fullLocation : gWindow.location
-            };
-
-            try {
-                retval.encryptionAlgorithm = status.cipherName;
-                retval.encryptionStrength = status.secretKeyLength;
-            }
-            catch (e) {
-            }
-
-            return retval;
-        } else {
-            return {
-                hostName : hName,
-                cAName : "",
-                encryptionAlgorithm : "",
-                encryptionStrength : 0,
-                isBroken : isBroken,
-                isEV : isEV,
-                cert : null,
-                fullLocation : gWindow.location
-            };
-        }
-    },
-
-    // Find the secureBrowserUI object (if present)
-    _getSecurityUI : function() {
-        // mod by eXXile
-        if(aios_inSidebar) {
-            if("gBrowser" in top) return top.gBrowser.securityUI;
-            return null;
-        }
-        else if(aios_inTab) {
-            return AiOS_HELPER.mostRecentWindow.aiosLastSelTab.securityUI;
-        }
-        // Original-FF-Teil
-        else {
-            if (window.opener.gBrowser) return window.opener.gBrowser.securityUI;
-            return null;
-        }
-    },
-
-    // Interface for mapping a certificate issuer organization to
-    // the value to be displayed.
-    // Bug 82017 - this implementation should be moved to pipnss C++ code
-    mapIssuerOrganization: function(name) {
-        if (!name) return null;
-
-        if (name == "RSA Data Security, Inc.") return "Verisign, Inc.";
-
-        // No mapping required
-        return name;
-    },
-
-    /**
-   * Open the cookie manager window
-   */
-    viewCookies : function() {
-        var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
-        var win = wm.getMostRecentWindow("Browser:Cookies");
-        var eTLDService = Components.classes["@mozilla.org/network/effective-tld-service;1"].
-        getService(Components.interfaces.nsIEffectiveTLDService);
-
-        var eTLD;
-        var uri = gDocument.documentURIObject;
-        try {
-            eTLD = eTLDService.getBaseDomain(uri);
-        }
-        catch (e) {
-            // getBaseDomain will fail if the host is an IP address or is empty
-            eTLD = uri.asciiHost;
-        }
-
-        if (win) {
-            win.gCookiesWindow.setFilter(eTLD);
-            win.focus();
-        }
-        else
-            window.openDialog("chrome://browser/content/preferences/cookies.xul",
-                "Browser:Cookies", "", {
-                    filterString : eTLD
-                });
-    },
-
-    /**
-   * Open the login manager window
-   */
-    viewPasswords : function() {
-        var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
-        var win = wm.getMostRecentWindow("Toolkit:PasswordManager");
-        if (win) {
-            win.setFilter(this._getSecurityInfo().hostName);
-            win.focus();
-        }
-        else
-            window.openDialog("chrome://passwordmgr/content/passwordManager.xul",
-                "Toolkit:PasswordManager", "",
-                {
-                    filterString : this._getSecurityInfo().hostName
-                });
-    },
-
-    _cert : null
+
+var aios_inSidebar = (top.document.getElementById('sidebar-box')) ? true : false;
+var aios_inTab = (AiOS_HELPER.mostRecentWindow.aiosLastSelTab) ? true : false;
+
+// Listener fuer automatische Aktualisierung hinzufuegen u. entfernen
+if(aios_inSidebar) {
+    window.addEventListener("load", function(e) {
+        top.gBrowser.addProgressListener(aiosProgListener);
+    }, false);
+
+    window.addEventListener("unload",function(e) {
+        top.gBrowser.removeProgressListener(aiosProgListener);
+    }, false);
+}
+
+
+
+function aios_init() {
+    // Menueleiste unter Mac OS X ausblenden
+    aios_hideMacMenubar();
+
+    // fuer CSS-Zwecke speichern
+    AiOS_HELPER.rememberAppInfo( document.getElementById('main-window') );
+
+    try {
+        var enable_layout = AiOS_HELPER.prefBranchAiOS.getBoolPref("pi.layout");
+        var enable_layoutall = AiOS_HELPER.prefBranchAiOS.getBoolPref("pi.layoutall");
+        if((enable_layout && aios_inSidebar) || enable_layoutall) aios_sidebarLayout();
+    }
+    catch(e) { }
+
+    // Tastaturkuerzel entfernen, um nicht die des Hauptbrowsers zu blockieren
+    if(aios_inSidebar) aios_removeAccesskeys();
+
+    //alert(document.getElementById('topBar').clientWidth);
+    //document.getElementById('metatree').getElementsByTagName('treechildren')[0].style.maxWidth = document.getElementById('topBar').clientWidth + "px";
+}
+
+
+function aios_sidebarLayout() {
+    var vbox;
+
+    // CSS fuer Sidebar-Optimierungen aktivieren
+    aios_addCSS("pageinfo.css", "main-window");
+
+    // Label der Radio-Buttons unsichtbar machen => nur wenn es Icons gibt
+    var cStyle = document.defaultView.getComputedStyle(document.getElementById('generalTab'), '');
+    if(cStyle.listStyleImage && cStyle.listStyleImage != "none") {
+        if(document.getElementById('viewGroup')) document.getElementById('viewGroup').setAttribute("hideLabel", true);
+    }
+
+    // Radio-Buttons mit Tooltip
+    if(document.getElementById('viewGroup')) {
+        var radioChilds = document.getElementById('viewGroup').childNodes;
+        for(var i = 0; i < radioChilds.length; i++) {
+            if(radioChilds[i].tagName == "radio") radioChilds[i].setAttribute('tooltiptext', radioChilds[i].label);
+        }
+    }
+
+    // Media-Panel: Save as... button umbrechen
+    var hbox = document.getElementById('mediaPreviewBox').getElementsByTagName('hbox')[0];
+    hbox.setAttribute('align', 'start');
+    hbox.setAttribute('orient', 'vertical');
+    hbox.removeChild(hbox.getElementsByTagName('spacer')[0]);
+    hbox.appendChild(hbox.getElementsByTagName('vbox')[0]);
+
+    // Security-Panel: Texte und Buttons umbrechen
+    // Identity
+    var groupbox = document.getElementById('security-identity-groupbox');
+    groupbox.removeChild(groupbox.getElementsByTagName('spacer')[0]);
+    groupbox.getElementsByTagName('hbox')[0].setAttribute('orient', 'vertical');
+    groupbox.getElementsByTagName('hbox')[0].setAttribute('align', 'start');
+
+    // History
+    var historyrow = document.getElementById('security-privacy-history-label').parentNode;
+    vbox = document.createElement("vbox");
+    while(historyrow.childNodes.length != 0) {
+        vbox.appendChild(historyrow.firstChild);
+    }
+    vbox.setAttribute('flex', '100');
+    historyrow.appendChild(vbox);
+
+    // Cookies
+    var cookierow = document.getElementById('security-privacy-cookies-label').parentNode;
+    vbox = document.createElement("vbox");
+    while(cookierow.childNodes.length != 0) {
+        vbox.appendChild(cookierow.firstChild);
+    }
+    vbox.setAttribute('flex', '100');
+    cookierow.appendChild(vbox);
+
+    // Passwords
+    var pwdrow = document.getElementById('security-privacy-passwords-label').parentNode;
+    vbox = document.createElement("vbox");
+    while(pwdrow.childNodes.length != 0) {
+        vbox.appendChild(pwdrow.firstChild);
+    }
+    vbox.setAttribute('flex', '100');
+    pwdrow.appendChild(vbox);
+}
+
+
+// automatische Aktualisierung => Aufruf durch aiosProgListener (_helper.js)
+function aios_onLocationChange() {
+    if(aios_inSidebar) {
+        aios_persistSelTab();
+        location.reload();
+    }
+}
+
+
+function aios_onStateChange() {
+    aios_onLocationChange();
+}
+
+
+// letzten selektierten Tab merken
+function aios_persistSelTab() {
+    document.getElementById('main-window').setAttribute("seltab", document.getElementById('viewGroup').selectedIndex);
+}
+
+
+/* Called when PageInfo window is loaded.  Arguments are:
+ *  window.arguments[0] - (optional) an object consisting of
+ *                         - doc: (optional) document to use for source. if not provided,
+ *                                the calling window's document will be used
+ *                         - initialTab: (optional) id of the inital tab to display
+ */
+function onLoadPageInfo() {
+    gBundle = document.getElementById("pageinfobundle");
+    gStrings.unknown = gBundle.getString("unknown");
+    gStrings.notSet = gBundle.getString("notset");
+    gStrings.mediaImg = gBundle.getString("mediaImg");
+    gStrings.mediaBGImg = gBundle.getString("mediaBGImg");
+    gStrings.mediaObject = gBundle.getString("mediaObject");
+    gStrings.mediaEmbed = gBundle.getString("mediaEmbed");
+    gStrings.mediaLink = gBundle.getString("mediaLink");
+    gStrings.mediaInput = gBundle.getString("mediaInput");
+    //@line 292 "e:\builds\moz2_slave\rel-cen-w32-bld\build\browser\base\content\pageinfo\pageInfo.js"
+    gStrings.mediaVideo = gBundle.getString("mediaVideo");
+    gStrings.mediaAudio = gBundle.getString("mediaAudio");
+    //@line 295 "e:\builds\moz2_slave\rel-cen-w32-bld\build\browser\base\content\pageinfo\pageInfo.js"
+
+    var args = "arguments" in window &&
+    window.arguments.length >= 1 &&
+    window.arguments[0];
+
+    // mod by eXXile
+    if(aios_inSidebar) {
+        var aios_sidebar = top.document.getElementById('sidebar-box');
+        var aios_window = document.getElementById('main-window');
+
+        gDocument = AiOS_HELPER.mostRecentWindow.content.document;
+        gWindow = AiOS_HELPER.mostRecentWindow.content.window;
+    }
+    else if(aios_inTab) {
+
+        gDocument = AiOS_HELPER.mostRecentWindow.aiosLastSelTab.document;
+        gWindow = AiOS_HELPER.mostRecentWindow.content.window;
+    }
+    // Original-FF-Teil
+    else {
+        if (!args || !args.doc) {
+            gWindow = window.opener.content;
+            gDocument = gWindow.document;
+        }
+    }
+
+    // init media view
+    var imageTree = document.getElementById("imagetree");
+    imageTree.view = gImageView;
+
+    /* Select the requested tab, if the name is specified */
+    loadTab(args);
+    Components.classes["@mozilla.org/observer-service;1"]
+    .getService(Components.interfaces.nsIObserverService)
+    .notifyObservers(window, "page-info-dialog-loaded", null);
+}
+
+
+var security = {
+    // Display the server certificate (static)
+    viewCert : function () {
+        var cert = security._cert;
+        //viewCertHelper(window, cert);
+
+        // mod by eXXile
+        if(aios_inSidebar) viewCertHelper(AiOS_HELPER.mostRecentWindow.content.window, cert);
+        else if(aios_inTab) viewCertHelper(AiOS_HELPER.mostRecentWindow.aiosLastSelTab.window, cert);
+        else viewCertHelper(window, cert);
+    // endmod by eXXile
+    },
+
+    _getSecurityInfo : function() {
+        const nsIX509Cert = Components.interfaces.nsIX509Cert;
+        //mod by exxile const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
+        const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
+        const nsISSLStatusProvider = Components.interfaces.nsISSLStatusProvider;
+        const nsISSLStatus = Components.interfaces.nsISSLStatus;
+
+        // We don't have separate info for a frame, return null until further notice
+        // (see bug 138479)
+        if (gWindow != gWindow.top)
+            return null;
+
+        var hName = null;
+        try {
+            hName = gWindow.location.host;
+        }
+        catch (exception) { }
+
+        var ui = security._getSecurityUI();
+        if (!ui)
+            return null;
+
+        var isBroken =
+        (ui.state & Components.interfaces.nsIWebProgressListener.STATE_IS_BROKEN);
+        var isInsecure =
+        (ui.state & Components.interfaces.nsIWebProgressListener.STATE_IS_INSECURE);
+        var isEV =
+        (ui.state & Components.interfaces.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL);
+        ui.QueryInterface(nsISSLStatusProvider);
+        var status = ui.SSLStatus;
+
+        if (!isInsecure && status) {
+            status.QueryInterface(nsISSLStatus);
+            var cert = status.serverCert;
+            var issuerName =
+            this.mapIssuerOrganization(cert.issuerOrganization) || cert.issuerName;
+
+            var retval = {
+                hostName : hName,
+                cAName : issuerName,
+                encryptionAlgorithm : undefined,
+                encryptionStrength : undefined,
+                isBroken : isBroken,
+                isEV : isEV,
+                cert : cert,
+                fullLocation : gWindow.location
+            };
+
+            try {
+                retval.encryptionAlgorithm = status.cipherName;
+                retval.encryptionStrength = status.secretKeyLength;
+            }
+            catch (e) {
+            }
+
+            return retval;
+        } else {
+            return {
+                hostName : hName,
+                cAName : "",
+                encryptionAlgorithm : "",
+                encryptionStrength : 0,
+                isBroken : isBroken,
+                isEV : isEV,
+                cert : null,
+                fullLocation : gWindow.location
+            };
+        }
+    },
+
+    // Find the secureBrowserUI object (if present)
+    _getSecurityUI : function() {
+        // mod by eXXile
+        if(aios_inSidebar) {
+            if("gBrowser" in top) return top.gBrowser.securityUI;
+            return null;
+        }
+        else if(aios_inTab) {
+            return AiOS_HELPER.mostRecentWindow.aiosLastSelTab.securityUI;
+        }
+        // Original-FF-Teil
+        else {
+            if (window.opener.gBrowser) return window.opener.gBrowser.securityUI;
+            return null;
+        }
+    },
+
+    // Interface for mapping a certificate issuer organization to
+    // the value to be displayed.
+    // Bug 82017 - this implementation should be moved to pipnss C++ code
+    mapIssuerOrganization: function(name) {
+        if (!name) return null;
+
+        if (name == "RSA Data Security, Inc.") return "Verisign, Inc.";
+
+        // No mapping required
+        return name;
+    },
+
+    /**
+   * Open the cookie manager window
+   */
+    viewCookies : function() {
+        var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
+        var win = wm.getMostRecentWindow("Browser:Cookies");
+        var eTLDService = Components.classes["@mozilla.org/network/effective-tld-service;1"].
+        getService(Components.interfaces.nsIEffectiveTLDService);
+
+        var eTLD;
+        var uri = gDocument.documentURIObject;
+        try {
+            eTLD = eTLDService.getBaseDomain(uri);
+        }
+        catch (e) {
+            // getBaseDomain will fail if the host is an IP address or is empty
+            eTLD = uri.asciiHost;
+        }
+
+        if (win) {
+            win.gCookiesWindow.setFilter(eTLD);
+            win.focus();
+        }
+        else
+            window.openDialog("chrome://browser/content/preferences/cookies.xul",
+                "Browser:Cookies", "", {
+                    filterString : eTLD
+                });
+    },
+
+    /**
+   * Open the login manager window
+   */
+    viewPasswords : function() {
+        var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
+        var win = wm.getMostRecentWindow("Toolkit:PasswordManager");
+        if (win) {
+            win.setFilter(this._getSecurityInfo().hostName);
+            win.focus();
+        }
+        else
+            window.openDialog("chrome://passwordmgr/content/passwordManager.xul",
+                "Toolkit:PasswordManager", "",
+                {
+                    filterString : this._getSecurityInfo().hostName
+                });
+    },
+
+    _cert : null
 };
\ No newline at end of file
diff --git a/content/prefs/_keyconfig.js b/content/prefs/_keyconfig.js
index c6272b9..11ba93f 100644
--- a/content/prefs/_keyconfig.js
+++ b/content/prefs/_keyconfig.js
@@ -1,421 +1,421 @@
-//mod by exxile
-var target = AiOS_HELPER.mostRecentWindow;
-if(target) {
-    var gPrefService = target.aiosKeyconfig.prefService;
-    var gProfile = target.aiosKeyconfig.profile;
-    var gDocument = target.document;
-    var gRemovedKeys = target.aiosKeyconfig.removedKeys;
-}
-// end mod by exxile
-
-var gAtomService = Components.classes["@mozilla.org/atom-service;1"].getService(Components.interfaces.nsIAtomService);
-var gUnicodeConverter = Components.classes['@mozilla.org/intl/scriptableunicodeconverter']
-.createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
-var gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
-.getService(Components.interfaces.nsIClipboardHelper);
-var gLocation, gKeys, gUsedKeys;
-
-var gExtra2, keyTree, gEditbox, gEdit, gModified;
-
-var gLocaleKeys;
-var gPlatformKeys = new Object();
-var gVKNames = [];
-var gReverseNames;
-
-function aios_initKeys() {
-    //mod by exxile
-    if(!target) return;
-
-    if(!gPrefService.prefHasUserValue("extensions.aios.keyconf.version"))
-        gPrefService.setIntPref("extensions.aios.keyconf.version","1");
-    gUnicodeConverter.charset = "UTF-8";
-
-    //mod by exxile
-    //gExtra2 = document.documentElement.getButton("extra2");
-    keyTree = document.getElementById("key-tree");
-    gEditbox = document.getElementById("editbox");
-    gEdit = document.getElementById("edit");
-    gLocaleKeys = document.getElementById("localeKeys");
-
-    var platformKeys = document.getElementById("platformKeys");
-    gPlatformKeys.shift = platformKeys.getString("VK_SHIFT");
-    gPlatformKeys.meta  = platformKeys.getString("VK_META");
-    gPlatformKeys.alt   = platformKeys.getString("VK_ALT");
-    gPlatformKeys.ctrl  = platformKeys.getString("VK_CONTROL");
-    gPlatformKeys.sep   = platformKeys.getString("MODIFIER_SEPARATOR");
-    switch (gPrefService.getIntPref("ui.key.accelKey")){
-        case 17:  gPlatformKeys.accel = gPlatformKeys.ctrl; break;
-        case 18:  gPlatformKeys.accel = gPlatformKeys.alt; break;
-        case 224: gPlatformKeys.accel = gPlatformKeys.meta; break;
-        default:  gPlatformKeys.accel = (window.navigator.platform.search("Mac") == 0 ? gPlatformKeys.meta : gPlatformKeys.ctrl);
-    }
-
-    for (var property in KeyEvent) {
-        gVKNames[KeyEvent[property]] = property.replace("DOM_","");
-    }
-    gVKNames[8] = "VK_BACK";
-
-    var isThunderbird;
-    if(Components.interfaces.nsIXULAppInfo) {
-        var XULAppInfo = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo);
-        isThunderbird = XULAppInfo.name == "Thunderbird";
-    } else {
-        isThunderbird = window.navigator.vendor == "Thunderbird";
-    }
-
-    gReverseNames = isThunderbird ^ gPrefService.getBoolPref("extensions.aios.keyconf.nicenames.reverse_order");
-
-    if(gPrefService.getBoolPref("extensions.aios.keyconf.devmode")){ this.getFormattedKey = function(a,b,c) {return a+"+"+b+c;}; }
-
-    //mod by exxile
-    init(target);
-}
-
-function init(target) {
-    if(!target) return;
-
-    gDocument = target.document;
-    gLocation = gDocument.location.href;
-
-    gKeys = [];
-    gRemovedKeys = target.aiosKeyconfig.removedKeys;
-
-    //mod by exxile
-    //document.title = gStrings.title + " - " + gLocation;
-
-    var keys = gDocument.getElementsByTagName("key");
-
-    //mod by exxile
-    //for(var i = 0, l = keys.length; i < l; i++) gKeys.push(new Key(keys[i]));
-    for(var i = 0, l = keys.length; i < l; i++) {
-        var aiosKey = keys[i].id;
-        if(aiosKey.indexOf('aiosKey') == 0) gKeys.push(new Key(keys[i]));
-    }
-
-    for(i = 0, l = gRemovedKeys.childNodes.length; i < l; i++) gKeys.push(new Key(gRemovedKeys.childNodes[i]));
-
-    detectUsedKeys();
-
-    var elem = keyTree.getElementsByAttribute("sortActive","true")[0];
-
-    gKeys.sort(sorter[elem.id]);
-    if(elem.getAttribute("sortDirection") == "descending") gKeys.reverse();
-
-    keyTree.view = keyView;
-
-    keyTree.view.selection.select(-1);
-    //mod by exxile
-    //gExtra2.label = gStrings.add;
-    gEditbox.setAttribute("disabled","true");
-    gEdit.value = "";
-    gEdit.keys = ["!","",""];
-}
-
-function onOK() { //mod by exxile
-    //if(gModified && gPrefService.getBoolPref("extensions.aios.keyconf.warnOnClose")) alert(gStrings.warn);
-}
-
-function getFormattedKey(modifiers,key,keycode) {
-    var val = "";
-    if(modifiers) val = modifiers
-    .replace(/ $/,"")
-    .replace(" ",",")
-    .replace(",,",",")
-    .replace(",",gPlatformKeys.sep)
-    .replace("alt",gPlatformKeys.alt)
-    .replace("shift",gPlatformKeys.shift)
-    .replace("control",gPlatformKeys.ctrl)
-    .replace("meta",gPlatformKeys.meta)
-    .replace("accel",gPlatformKeys.accel)
-        +gPlatformKeys.sep;
-    if(key)
-        val += key;
-    if(keycode) try {
-        val += gLocaleKeys.getString(keycode);
-    } catch(e){val += gStrings.unrecognized.replace("$1",keycode);}
-
-    return val;
-}
-
-function getNameForKey(aKey) {
-    var val;
-
-    if(aKey.hasAttribute("label")) return aKey.getAttribute("label");
-
-    if(aKey.hasAttribute("command") || aKey.hasAttribute("observes")) {
-        var command = aKey.getAttribute("command") || aKey.getAttribute("observes");
-        var node = gDocument.getElementById(command);
-        if(node && node.hasAttribute("label")) return node.getAttribute("label");
-        val = getLabel("command", command);
-        if(!val) val = getLabel("observes", command);
-    }
-
-    if(!val) val = getLabel("key", aKey.id);
-
-    if(val) return val;
-
-    var id = aKey.id.replace(/xxx_key.+?_/,"");
-    try {id = gUnicodeConverter.ConvertToUnicode(id);} catch(err) { gUnicodeConverter.charset = "UTF-8"; }
-
-    if(keyname[id]) {
-        var key = gDocument.getElementById(keyname[id]);
-        if(!key) key = gRemovedKeys.getElementsByAttribute("id",keyname[id])[0];
-        if(key) return getNameForKey(key);
-        return keyname[id];
-    }
-
-    return id;
-}
-
-function getLabel(attr, value) {
-    var Users = gDocument.getElementsByAttribute(attr,value);
-    var User;
-
-    for(var i = 0, l = Users.length; i < l; i++)
-        if(Users[i].hasAttribute("label") && (!User || User.localName == "menuitem")) User = Users[i];
-
-    if(!User) return null;
-
-    if(User.localName == "menuitem" && User.parentNode.parentNode.parentNode.localName == "menupopup") {
-        if(gReverseNames) return User.parentNode.parentNode.getAttribute("label") + " > " + User.getAttribute("label");
-        else return User.getAttribute("label") + " [" + User.parentNode.parentNode.getAttribute("label") + "]";
-    } else return User.getAttribute("label");
-}
-
-function Recognize(event) {
-    event.preventDefault();
-    event.stopPropagation();
-
-    var modifiers = [];
-    if(event.altKey) modifiers.push("alt");
-    if(event.ctrlKey) modifiers.push("control");
-    if(event.metaKey) modifiers.push("meta");
-    if(event.shiftKey) modifiers.push("shift");
-
-    modifiers = modifiers.join(" ");
-
-    var key = ""; var keycode = "";
-    if(event.charCode) key = String.fromCharCode(event.charCode).toUpperCase();
-    else { keycode = gVKNames[event.keyCode]; if(!keycode) return;}
-
-    gEdit.value = getFormattedKey(modifiers,key,keycode);
-    gEdit.keys = [modifiers,key,keycode];
-
-    if(gPrefService.getBoolPref("extensions.aios.keyconf.warnOnDuplicate") && gEdit.value != gEdit.key.shortcut && gUsedKeys[gEdit.value])
-        alert(gStrings.used.replace("$1",gUsedKeys[gEdit.value].join("\n")));
-
-    gEdit.select();
-}
-
-function Apply() {
-    var key = gKeys[keyTree.currentIndex];
-    var node = key.node;
-
-    if(key.shortcut == gEdit.value) return;
-
-    key.shortcut = gEdit.value;
-    key.pref.splice(0,3,gEdit.keys[0],gEdit.keys[1],gEdit.keys[2]);
-
-    gModified = true;
-    detectUsedKeys();
-
-    var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
-    str.data = key.pref.join("][");
-    gPrefService.setComplexValue(gProfile+node.id, Components.interfaces.nsISupportsString, str);
-
-    node.removeAttribute("modifiers"); node.removeAttribute("key"); node.removeAttribute("keycode");
-    node.removeAttribute("charcode");
-    node.removeAttribute("aiosKeyconfig");
-
-    if(key.pref[0] == "!") gRemovedKeys.appendChild(node);
-
-    if(key.pref[0] && key.pref[0] != "!") node.setAttribute("modifiers",key.pref[0]);
-    if(key.pref[1]) node.setAttribute("key",key.pref[1]);
-    if(key.pref[2]) node.setAttribute("keycode",key.pref[2]);
-
-    keyTree.treeBoxObject.invalidate();
-}
-
-function Disable() {
-    gEdit.value = "";
-    gEdit.keys = ["!","",""];
-    Apply();
-}
-
-function Reset() {
-    var key = gKeys[keyTree.currentIndex];
-    var node = key.node;
-
-    try{ gPrefService.clearUserPref(gProfile+node.id); }catch(err){}
-
-    key.pref = [];
-    key.shortcut = gEdit.value = gStrings.onreset;
-    gEdit.keys = ["!","",""];
-
-    //mod by exxile
-    //gExtra2.label = gStrings.add;
-    node.setAttribute("aiosKeyconfig","resetted");
-
-    gModified = true;
-    detectUsedKeys();
-
-    keyTree.treeBoxObject.invalidate();
-}
-
-function Key(aKey) {
-    this.node = aKey;
-    this.name = getNameForKey(aKey);
-    this.shortcut = getFormattedKey(
-    aKey.getAttribute("modifiers"),
-    aKey.getAttribute("key").toUpperCase() || aKey.getAttribute("charcode").toUpperCase(),
-    aKey.getAttribute("keycode")
-);
-    this.id = aKey.id;
-    if(aKey.getAttribute("aiosKeyconfig") == "resetted") this.shortcut = gStrings.onreset;
-
-    try {
-        this.pref = gPrefService.getComplexValue(gProfile+aKey.id, Components.interfaces.nsISupportsString).data.split("][");
-    } catch(err) { this.pref = []; }
-
-    if(!aKey.hasAttribute("command") && !aKey.hasAttribute("oncommand")) this.hardcoded = true;
-}
-
-var sorter = {
-    name: function(a,b) { return a.name.localeCompare(b.name); },
-    id: function(a,b) { return a.id.localeCompare(b.id); },
-    shortcut: function(a,b) {
-        if(a.shortcut == b.shortcut) return 0;
-        if(!a.shortcut) return 1;
-        if(!b.shortcut) return -1;
-        if(a.shortcut > b.shortcut) return 1;
-        return -1;
-    }
-};
-
-function detectUsedKeys() {
-    gUsedKeys = [];
-
-    for(var i = 0, l = gKeys.length; i < l; i++) {
-        if(gUsedKeys[gKeys[i].shortcut])
-            gUsedKeys[gKeys[i].shortcut].push(gKeys[i].name);
-        else
-            gUsedKeys[gKeys[i].shortcut]=[gKeys[i].name];
-    }
-
-    gUsedKeys[""] = gUsedKeys[gStrings.onreset] = {length: 0};
-}
-
-function openEditor() { //mod by exxile
-    //openDialog('chrome://keyconfig/content/edit.xul', 'keyconfig-edit', 'resizable,modal');
-}
-
-function closeEditor(fields) {
-    gModified = true;
-    var key;
-
-    if(fields.key) {
-        key = fields.key;
-        gPrefService.clearUserPref(gProfile+key.node.id);
-    } else {
-        key = {node: document.createElement("key"), shortcut: "", pref: ["!",,,";"]};
-        gKeys.push(key);
-        gRemovedKeys.appendChild(key.node);
-        keyTree.treeBoxObject.rowCountChanged(keyTree.view.rowCount-1,1);
-        keyTree.view.selection.select(keyTree.view.rowCount-1);
-        keyTree.treeBoxObject.ensureRowIsVisible(keyTree.view.rowCount-1);
-    }
-
-    key.name = fields.name.value || "key"+Date.now();
-
-    try { key.id = key.node.id = "xxx_key__" + gUnicodeConverter.ConvertFromUnicode(key.name); }
-    catch(err){ gUnicodeConverter.charset = "UTF-8"; }
-
-    fields.code.value = fields.code.value.replace("][","] [");
-    key.node.setAttribute("oncommand",fields.code.value || " ");
-    key.pref[3] = fields.code.value || " ";
-
-    key.pref[4] = fields.global.checked ? "" : gLocation;
-
-    var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
-    str.data = key.pref.join("][");
-    gPrefService.setComplexValue(gProfile+key.node.id, Components.interfaces.nsISupportsString, str);
-
-    keyTree.treeBoxObject.invalidateRow(keyTree.currentIndex);
-}
-
-var keyView = {
-    get rowCount() { return gKeys.length; },
-    getCellText : function(row,col){ return gKeys[row][col.id || col];},
-    setTree: function(treebox) { this.treebox=treebox; },
-    isContainer: function() { return false; },
-    isSeparator: function() { return false; },
-    isSorted: function() { return false; },
-    getLevel: function() { return 0; },
-    getImageSrc: function() { return null; },
-    getRowProperties: function() {},
-    canDropBeforeAfter: function() { return false; },
-    canDrop: function() { return false; },
-    getParentIndex: function() { return -1; },
-
-    getCellProperties: function(row,col,props) {
-        var key = gKeys[row];
-        if(key.hardcoded) props.AppendElement(gAtomService.getAtom("hardcoded"));
-        if(key.pref[0] == "!") props.AppendElement(gAtomService.getAtom("disabled"));
-        if(key.pref[3]) props.AppendElement(gAtomService.getAtom("custom"));
-        if(key.pref.length) props.AppendElement(gAtomService.getAtom("user"));
-        if((col.id || col) == "shortcut" && gUsedKeys[key.shortcut].length > 1)
-            props.AppendElement(gAtomService.getAtom("duplicate"));
-    },
-    getColumnProperties: function(){},
-    selectionChanged: function() {
-        var key = gKeys[this.selection.currentIndex];
-
-        if(!key) return;
-
-        //mod by exxile
-        //gExtra2.label = key.pref[3] ? gStrings.edit : gStrings.add;
-        if(gEditbox.hasAttribute("disabled")) gEditbox.removeAttribute("disabled");
-        gEdit.key = key;
-        gEdit.value = key.shortcut;
-    },
-    cycleHeader: function cycleHeader(col, elem) {
-        if(col.id) elem = col.element;
-
-        var direction = elem.getAttribute("sortDirection") == "ascending" ? "descending" : "ascending";
-        var columns = this.treebox.firstChild.childNodes;
-        for(var i = 0, l = columns.length; i < l; i++) {
-            columns[i].setAttribute("sortDirection","none");
-            columns[i].setAttribute("sortActive",false);
-        }
-
-        elem.setAttribute("sortDirection",direction);
-        elem.setAttribute("sortActive",true);
-
-        var currentRow = gKeys[this.selection.currentIndex];
-
-        gKeys.sort(sorter[col.id || col]);
-        if(direction == "descending") gKeys.reverse();
-
-        this.treebox.invalidate();
-        if(currentRow) {
-            i = -1;
-            do { i++; } while(currentRow != gKeys[i]);
-            this.selection.select(i);
-            this.treebox.ensureRowIsVisible(i);
-        }
-    }
-}
-
-function switchWindow(event) {
-    var mediator = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"].getService();
-    mediator.QueryInterface(Components.interfaces.nsIWindowDataSource);
-
-    var target = mediator.getWindowForResource(event.target.getAttribute('id'));
-
-    if (target) init(target);
-}
-
-function copyID() {
-    var key = gKeys[keyTree.currentIndex];
-    if(key) gClipboardHelper.copyString(key.id);
+//mod by exxile
+var target = AiOS_HELPER.mostRecentWindow;
+if(target) {
+    var gPrefService = target.aiosKeyconfig.prefService;
+    var gProfile = target.aiosKeyconfig.profile;
+    var gDocument = target.document;
+    var gRemovedKeys = target.aiosKeyconfig.removedKeys;
+}
+// end mod by exxile
+
+var gAtomService = Components.classes["@mozilla.org/atom-service;1"].getService(Components.interfaces.nsIAtomService);
+var gUnicodeConverter = Components.classes['@mozilla.org/intl/scriptableunicodeconverter']
+.createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
+var gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
+.getService(Components.interfaces.nsIClipboardHelper);
+var gLocation, gKeys, gUsedKeys;
+
+var gExtra2, keyTree, gEditbox, gEdit, gModified;
+
+var gLocaleKeys;
+var gPlatformKeys = new Object();
+var gVKNames = [];
+var gReverseNames;
+
+function aios_initKeys() {
+    //mod by exxile
+    if(!target) return;
+
+    if(!gPrefService.prefHasUserValue("extensions.aios.keyconf.version"))
+        gPrefService.setIntPref("extensions.aios.keyconf.version","1");
+    gUnicodeConverter.charset = "UTF-8";
+
+    //mod by exxile
+    //gExtra2 = document.documentElement.getButton("extra2");
+    keyTree = document.getElementById("key-tree");
+    gEditbox = document.getElementById("editbox");
+    gEdit = document.getElementById("edit");
+    gLocaleKeys = document.getElementById("localeKeys");
+
+    var platformKeys = document.getElementById("platformKeys");
+    gPlatformKeys.shift = platformKeys.getString("VK_SHIFT");
+    gPlatformKeys.meta  = platformKeys.getString("VK_META");
+    gPlatformKeys.alt   = platformKeys.getString("VK_ALT");
+    gPlatformKeys.ctrl  = platformKeys.getString("VK_CONTROL");
+    gPlatformKeys.sep   = platformKeys.getString("MODIFIER_SEPARATOR");
+    switch (gPrefService.getIntPref("ui.key.accelKey")){
+        case 17:  gPlatformKeys.accel = gPlatformKeys.ctrl; break;
+        case 18:  gPlatformKeys.accel = gPlatformKeys.alt; break;
+        case 224: gPlatformKeys.accel = gPlatformKeys.meta; break;
+        default:  gPlatformKeys.accel = (window.navigator.platform.search("Mac") == 0 ? gPlatformKeys.meta : gPlatformKeys.ctrl);
+    }
+
+    for (var property in KeyEvent) {
+        gVKNames[KeyEvent[property]] = property.replace("DOM_","");
+    }
+    gVKNames[8] = "VK_BACK";
+
+    var isThunderbird;
+    if(Components.interfaces.nsIXULAppInfo) {
+        var XULAppInfo = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo);
+        isThunderbird = XULAppInfo.name == "Thunderbird";
+    } else {
+        isThunderbird = window.navigator.vendor == "Thunderbird";
+    }
+
+    gReverseNames = isThunderbird ^ gPrefService.getBoolPref("extensions.aios.keyconf.nicenames.reverse_order");
+
+    if(gPrefService.getBoolPref("extensions.aios.keyconf.devmode")){ this.getFormattedKey = function(a,b,c) {return a+"+"+b+c;}; }
+
+    //mod by exxile
+    init(target);
+}
+
+function init(target) {
+    if(!target) return;
+
+    gDocument = target.document;
+    gLocation = gDocument.location.href;
+
+    gKeys = [];
+    gRemovedKeys = target.aiosKeyconfig.removedKeys;
+
+    //mod by exxile
+    //document.title = gStrings.title + " - " + gLocation;
+
+    var keys = gDocument.getElementsByTagName("key");
+
+    //mod by exxile
+    //for(var i = 0, l = keys.length; i < l; i++) gKeys.push(new Key(keys[i]));
+    for(var i = 0, l = keys.length; i < l; i++) {
+        var aiosKey = keys[i].id;
+        if(aiosKey.indexOf('aiosKey') == 0) gKeys.push(new Key(keys[i]));
+    }
+
+    for(i = 0, l = gRemovedKeys.childNodes.length; i < l; i++) gKeys.push(new Key(gRemovedKeys.childNodes[i]));
+
+    detectUsedKeys();
+
+    var elem = keyTree.getElementsByAttribute("sortActive","true")[0];
+
+    gKeys.sort(sorter[elem.id]);
+    if(elem.getAttribute("sortDirection") == "descending") gKeys.reverse();
+
+    keyTree.view = keyView;
+
+    keyTree.view.selection.select(-1);
+    //mod by exxile
+    //gExtra2.label = gStrings.add;
+    gEditbox.setAttribute("disabled","true");
+    gEdit.value = "";
+    gEdit.keys = ["!","",""];
+}
+
+function onOK() { //mod by exxile
+    //if(gModified && gPrefService.getBoolPref("extensions.aios.keyconf.warnOnClose")) alert(gStrings.warn);
+}
+
+function getFormattedKey(modifiers,key,keycode) {
+    var val = "";
+    if(modifiers) val = modifiers
+    .replace(/ $/,"")
+    .replace(" ",",")
+    .replace(",,",",")
+    .replace(",",gPlatformKeys.sep)
+    .replace("alt",gPlatformKeys.alt)
+    .replace("shift",gPlatformKeys.shift)
+    .replace("control",gPlatformKeys.ctrl)
+    .replace("meta",gPlatformKeys.meta)
+    .replace("accel",gPlatformKeys.accel)
+        +gPlatformKeys.sep;
+    if(key)
+        val += key;
+    if(keycode) try {
+        val += gLocaleKeys.getString(keycode);
+    } catch(e){val += gStrings.unrecognized.replace("$1",keycode);}
+
+    return val;
+}
+
+function getNameForKey(aKey) {
+    var val;
+
+    if(aKey.hasAttribute("label")) return aKey.getAttribute("label");
+
+    if(aKey.hasAttribute("command") || aKey.hasAttribute("observes")) {
+        var command = aKey.getAttribute("command") || aKey.getAttribute("observes");
+        var node = gDocument.getElementById(command);
+        if(node && node.hasAttribute("label")) return node.getAttribute("label");
+        val = getLabel("command", command);
+        if(!val) val = getLabel("observes", command);
+    }
+
+    if(!val) val = getLabel("key", aKey.id);
+
+    if(val) return val;
+
+    var id = aKey.id.replace(/xxx_key.+?_/,"");
+    try {id = gUnicodeConverter.ConvertToUnicode(id);} catch(err) { gUnicodeConverter.charset = "UTF-8"; }
+
+    if(keyname[id]) {
+        var key = gDocument.getElementById(keyname[id]);
+        if(!key) key = gRemovedKeys.getElementsByAttribute("id",keyname[id])[0];
+        if(key) return getNameForKey(key);
+        return keyname[id];
+    }
+
+    return id;
+}
+
+function getLabel(attr, value) {
+    var Users = gDocument.getElementsByAttribute(attr,value);
+    var User;
+
+    for(var i = 0, l = Users.length; i < l; i++)
+        if(Users[i].hasAttribute("label") && (!User || User.localName == "menuitem")) User = Users[i];
+
+    if(!User) return null;
+
+    if(User.localName == "menuitem" && User.parentNode.parentNode.parentNode.localName == "menupopup") {
+        if(gReverseNames) return User.parentNode.parentNode.getAttribute("label") + " > " + User.getAttribute("label");
+        else return User.getAttribute("label") + " [" + User.parentNode.parentNode.getAttribute("label") + "]";
+    } else return User.getAttribute("label");
+}
+
+function Recognize(event) {
+    event.preventDefault();
+    event.stopPropagation();
+
+    var modifiers = [];
+    if(event.altKey) modifiers.push("alt");
+    if(event.ctrlKey) modifiers.push("control");
+    if(event.metaKey) modifiers.push("meta");
+    if(event.shiftKey) modifiers.push("shift");
+
+    modifiers = modifiers.join(" ");
+
+    var key = ""; var keycode = "";
+    if(event.charCode) key = String.fromCharCode(event.charCode).toUpperCase();
+    else { keycode = gVKNames[event.keyCode]; if(!keycode) return;}
+
+    gEdit.value = getFormattedKey(modifiers,key,keycode);
+    gEdit.keys = [modifiers,key,keycode];
+
+    if(gPrefService.getBoolPref("extensions.aios.keyconf.warnOnDuplicate") && gEdit.value != gEdit.key.shortcut && gUsedKeys[gEdit.value])
+        alert(gStrings.used.replace("$1",gUsedKeys[gEdit.value].join("\n")));
+
+    gEdit.select();
+}
+
+function Apply() {
+    var key = gKeys[keyTree.currentIndex];
+    var node = key.node;
+
+    if(key.shortcut == gEdit.value) return;
+
+    key.shortcut = gEdit.value;
+    key.pref.splice(0,3,gEdit.keys[0],gEdit.keys[1],gEdit.keys[2]);
+
+    gModified = true;
+    detectUsedKeys();
+
+    var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
+    str.data = key.pref.join("][");
+    gPrefService.setComplexValue(gProfile+node.id, Components.interfaces.nsISupportsString, str);
+
+    node.removeAttribute("modifiers"); node.removeAttribute("key"); node.removeAttribute("keycode");
+    node.removeAttribute("charcode");
+    node.removeAttribute("aiosKeyconfig");
+
+    if(key.pref[0] == "!") gRemovedKeys.appendChild(node);
+
+    if(key.pref[0] && key.pref[0] != "!") node.setAttribute("modifiers",key.pref[0]);
+    if(key.pref[1]) node.setAttribute("key",key.pref[1]);
+    if(key.pref[2]) node.setAttribute("keycode",key.pref[2]);
+
+    keyTree.treeBoxObject.invalidate();
+}
+
+function Disable() {
+    gEdit.value = "";
+    gEdit.keys = ["!","",""];
+    Apply();
+}
+
+function Reset() {
+    var key = gKeys[keyTree.currentIndex];
+    var node = key.node;
+
+    try{ gPrefService.clearUserPref(gProfile+node.id); }catch(err){}
+
+    key.pref = [];
+    key.shortcut = gEdit.value = gStrings.onreset;
+    gEdit.keys = ["!","",""];
+
+    //mod by exxile
+    //gExtra2.label = gStrings.add;
+    node.setAttribute("aiosKeyconfig","resetted");
+
+    gModified = true;
+    detectUsedKeys();
+
+    keyTree.treeBoxObject.invalidate();
+}
+
+function Key(aKey) {
+    this.node = aKey;
+    this.name = getNameForKey(aKey);
+    this.shortcut = getFormattedKey(
+    aKey.getAttribute("modifiers"),
+    aKey.getAttribute("key").toUpperCase() || aKey.getAttribute("charcode").toUpperCase(),
+    aKey.getAttribute("keycode")
+);
+    this.id = aKey.id;
+    if(aKey.getAttribute("aiosKeyconfig") == "resetted") this.shortcut = gStrings.onreset;
+
+    try {
+        this.pref = gPrefService.getComplexValue(gProfile+aKey.id, Components.interfaces.nsISupportsString).data.split("][");
+    } catch(err) { this.pref = []; }
+
+    if(!aKey.hasAttribute("command") && !aKey.hasAttribute("oncommand")) this.hardcoded = true;
+}
+
+var sorter = {
+    name: function(a,b) { return a.name.localeCompare(b.name); },
+    id: function(a,b) { return a.id.localeCompare(b.id); },
+    shortcut: function(a,b) {
+        if(a.shortcut == b.shortcut) return 0;
+        if(!a.shortcut) return 1;
+        if(!b.shortcut) return -1;
+        if(a.shortcut > b.shortcut) return 1;
+        return -1;
+    }
+};
+
+function detectUsedKeys() {
+    gUsedKeys = [];
+
+    for(var i = 0, l = gKeys.length; i < l; i++) {
+        if(gUsedKeys[gKeys[i].shortcut])
+            gUsedKeys[gKeys[i].shortcut].push(gKeys[i].name);
+        else
+            gUsedKeys[gKeys[i].shortcut]=[gKeys[i].name];
+    }
+
+    gUsedKeys[""] = gUsedKeys[gStrings.onreset] = {length: 0};
+}
+
+function openEditor() { //mod by exxile
+    //openDialog('chrome://keyconfig/content/edit.xul', 'keyconfig-edit', 'resizable,modal');
+}
+
+function closeEditor(fields) {
+    gModified = true;
+    var key;
+
+    if(fields.key) {
+        key = fields.key;
+        gPrefService.clearUserPref(gProfile+key.node.id);
+    } else {
+        key = {node: document.createElement("key"), shortcut: "", pref: ["!",,,";"]};
+        gKeys.push(key);
+        gRemovedKeys.appendChild(key.node);
+        keyTree.treeBoxObject.rowCountChanged(keyTree.view.rowCount-1,1);
+        keyTree.view.selection.select(keyTree.view.rowCount-1);
+        keyTree.treeBoxObject.ensureRowIsVisible(keyTree.view.rowCount-1);
+    }
+
+    key.name = fields.name.value || "key"+Date.now();
+
+    try { key.id = key.node.id = "xxx_key__" + gUnicodeConverter.ConvertFromUnicode(key.name); }
+    catch(err){ gUnicodeConverter.charset = "UTF-8"; }
+
+    fields.code.value = fields.code.value.replace("][","] [");
+    key.node.setAttribute("oncommand",fields.code.value || " ");
+    key.pref[3] = fields.code.value || " ";
+
+    key.pref[4] = fields.global.checked ? "" : gLocation;
+
+    var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
+    str.data = key.pref.join("][");
+    gPrefService.setComplexValue(gProfile+key.node.id, Components.interfaces.nsISupportsString, str);
+
+    keyTree.treeBoxObject.invalidateRow(keyTree.currentIndex);
+}
+
+var keyView = {
+    get rowCount() { return gKeys.length; },
+    getCellText : function(row,col){ return gKeys[row][col.id || col];},
+    setTree: function(treebox) { this.treebox=treebox; },
+    isContainer: function() { return false; },
+    isSeparator: function() { return false; },
+    isSorted: function() { return false; },
+    getLevel: function() { return 0; },
+    getImageSrc: function() { return null; },
+    getRowProperties: function() {},
+    canDropBeforeAfter: function() { return false; },
+    canDrop: function() { return false; },
+    getParentIndex: function() { return -1; },
+
+    getCellProperties: function(row,col,props) {
+        var key = gKeys[row];
+        if(key.hardcoded) props.AppendElement(gAtomService.getAtom("hardcoded"));
+        if(key.pref[0] == "!") props.AppendElement(gAtomService.getAtom("disabled"));
+        if(key.pref[3]) props.AppendElement(gAtomService.getAtom("custom"));
+        if(key.pref.length) props.AppendElement(gAtomService.getAtom("user"));
+        if((col.id || col) == "shortcut" && gUsedKeys[key.shortcut].length > 1)
+            props.AppendElement(gAtomService.getAtom("duplicate"));
+    },
+    getColumnProperties: function(){},
+    selectionChanged: function() {
+        var key = gKeys[this.selection.currentIndex];
+
+        if(!key) return;
+
+        //mod by exxile
+        //gExtra2.label = key.pref[3] ? gStrings.edit : gStrings.add;
+        if(gEditbox.hasAttribute("disabled")) gEditbox.removeAttribute("disabled");
+        gEdit.key = key;
+        gEdit.value = key.shortcut;
+    },
+    cycleHeader: function cycleHeader(col, elem) {
+        if(col.id) elem = col.element;
+
+        var direction = elem.getAttribute("sortDirection") == "ascending" ? "descending" : "ascending";
+        var columns = this.treebox.firstChild.childNodes;
+        for(var i = 0, l = columns.length; i < l; i++) {
+            columns[i].setAttribute("sortDirection","none");
+            columns[i].setAttribute("sortActive",false);
+        }
+
+        elem.setAttribute("sortDirection",direction);
+        elem.setAttribute("sortActive",true);
+
+        var currentRow = gKeys[this.selection.currentIndex];
+
+        gKeys.sort(sorter[col.id || col]);
+        if(direction == "descending") gKeys.reverse();
+
+        this.treebox.invalidate();
+        if(currentRow) {
+            i = -1;
+            do { i++; } while(currentRow != gKeys[i]);
+            this.selection.select(i);
+            this.treebox.ensureRowIsVisible(i);
+        }
+    }
+}
+
+function switchWindow(event) {
+    var mediator = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"].getService();
+    mediator.QueryInterface(Components.interfaces.nsIWindowDataSource);
+
+    var target = mediator.getWindowForResource(event.target.getAttribute('id'));
+
+    if (target) init(target);
+}
+
+function copyID() {
+    var key = gKeys[keyTree.currentIndex];
+    if(key) gClipboardHelper.copyString(key.id);
 }
\ No newline at end of file
diff --git a/content/prefs/_overlay.js b/content/prefs/_overlay.js
index 2900f50..ec0faeb 100644
--- a/content/prefs/_overlay.js
+++ b/content/prefs/_overlay.js
@@ -1,60 +1,60 @@
-
-if(!window.extLoad) var extLoad = {
-    loaders: [],
-    add: function(index,func){
-        this.loaders.push([index,func]);
-    },
-    init: function() {
-        extLoad.loaders.sort(function(a,b){
-            return a[0]-b[0];
-        });
-        for(var loader in extLoad.loaders) if(extLoad.loaders[loader][1]) extLoad.loaders[loader][1]();
-        extLoad.loaders = null;
-    }
-};
-
-window.addEventListener("load", extLoad.init, false);
-
-var aiosKeyconfig = {
-    prefService: Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch(null),
-    removedKeys: document.createElement("keyset"),
-    loadkeys: function(name){
-        this.profile = "extensions.aios.keyconf." + name + ".";
-
-        var nodes = document.getElementsByTagName("key");
-        for(var i = 0; i < nodes.length; i++) if(!nodes[i].id)
-            nodes[i].id = "xxx_key"+i+"_"+nodes[i].getAttribute("command")+nodes[i].getAttribute("oncommand");
-
-        this.keys = this.prefService.getChildList(this.profile, {});
-
-        for(i = 0; i < this.keys.length; i++) {
-            var key;
-            try{
-                key = this.prefService.getCharPref(this.keys[i]).split("][");
-            }catch(e){
-                continue;
-            }
-            /* mod by eXXile
-            if(key[3] && (!key[4] || key[4] == document.location)) {
-                var nKey = document.getElementsByTagName("keyset")[0].appendChild(document.createElement("key"));
-                nKey.id=this.keys[i].split(this.profile)[1];
-                nKey.setAttribute("on//command",key[3]);
-            }
-            */
-            var node = document.getElementById(this.keys[i].split(this.profile)[1]);
-            if(!node) continue;
-
-            node.removeAttribute("modifiers");
-            node.removeAttribute("key");
-            node.removeAttribute("keycode");
-            if(key[0] == "!") {
-                this.removedKeys.appendChild(node);
-                continue;
-            }
-
-            if(key[0]) node.setAttribute("modifiers",key[0]);
-            if(key[1]) node.setAttribute("key",key[1]);
-            if(key[2]) node.setAttribute("keycode",key[2]);
-        }
-    }
+
+if(!window.extLoad) var extLoad = {
+    loaders: [],
+    add: function(index,func){
+        this.loaders.push([index,func]);
+    },
+    init: function() {
+        extLoad.loaders.sort(function(a,b){
+            return a[0]-b[0];
+        });
+        for(var loader in extLoad.loaders) if(extLoad.loaders[loader][1]) extLoad.loaders[loader][1]();
+        extLoad.loaders = null;
+    }
+};
+
+window.addEventListener("load", extLoad.init, false);
+
+var aiosKeyconfig = {
+    prefService: Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch(null),
+    removedKeys: document.createElement("keyset"),
+    loadkeys: function(name){
+        this.profile = "extensions.aios.keyconf." + name + ".";
+
+        var nodes = document.getElementsByTagName("key");
+        for(var i = 0; i < nodes.length; i++) if(!nodes[i].id)
+            nodes[i].id = "xxx_key"+i+"_"+nodes[i].getAttribute("command")+nodes[i].getAttribute("oncommand");
+
+        this.keys = this.prefService.getChildList(this.profile, {});
+
+        for(i = 0; i < this.keys.length; i++) {
+            var key;
+            try{
+                key = this.prefService.getCharPref(this.keys[i]).split("][");
+            }catch(e){
+                continue;
+            }
+            /* mod by eXXile
+            if(key[3] && (!key[4] || key[4] == document.location)) {
+                var nKey = document.getElementsByTagName("keyset")[0].appendChild(document.createElement("key"));
+                nKey.id=this.keys[i].split(this.profile)[1];
+                nKey.setAttribute("on//command",key[3]);
+            }
+            */
+            var node = document.getElementById(this.keys[i].split(this.profile)[1]);
+            if(!node) continue;
+
+            node.removeAttribute("modifiers");
+            node.removeAttribute("key");
+            node.removeAttribute("keycode");
+            if(key[0] == "!") {
+                this.removedKeys.appendChild(node);
+                continue;
+            }
+
+            if(key[0]) node.setAttribute("modifiers",key[0]);
+            if(key[1]) node.setAttribute("key",key[1]);
+            if(key[2]) node.setAttribute("keycode",key[2]);
+        }
+    }
 };
\ No newline at end of file
diff --git a/content/prefs/general.js b/content/prefs/general.js
index 608feb1..8514945 100644
--- a/content/prefs/general.js
+++ b/content/prefs/general.js
@@ -1,173 +1,173 @@
-
-/*
-    Liste der zur Verfuegung stehenden Sidebars erstellen
-        => Aufruf durch aios_initPane()
-*/
-function aios_genSidebarList() {
-
-    if(!document.getElementById('sidebarInitPopup') || !document.getElementById('panelInitPopup')) return false;
-
-    var strings = document.getElementById("aiosStrings");
-    //if(!confirm(strings.getString('prefs.confirm'))) return false;
-
-    var sidebarInit = document.getElementById('sidebarInitPopup');
-    var panelInit = document.getElementById('panelInitPopup');
-    var allSidebars = AiOS_HELPER.mostRecentWindow.document.getElementsByAttribute('group', 'sidebar');
-
-    var cnt = 0;
-    var initID = null;
-    var sidebarPrefInit = "";
-    var panelPrefInit = "";
-    try {
-        sidebarPrefInit = AiOS_HELPER.prefBranchAiOS.getCharPref("gen.init");
-        panelPrefInit = AiOS_HELPER.prefBranchAiOS.getCharPref("gen.open.init");
-    } catch(e) { }
-
-    for(var i = 0; i < allSidebars.length; i++) {
-        var xulElem = null;
-
-        // muss eine ID haben, darf keinen observer haben (Menueeintraege usw.) und muss eine Sidebar-URL haben
-        if(allSidebars[i].id && !allSidebars[i].getAttribute('observes') && allSidebars[i].getAttribute('sidebarurl')) {
-
-            var separator = document.createElement("menuseparator");
-            if(cnt == 0) {
-                sidebarInit.appendChild(separator);
-                panelInit.appendChild(separator.cloneNode(true));
-            }
-
-            if(allSidebars[i].id != "extensionsEMbSidebar" && allSidebars[i].id != "themesEMbSidebar") {
-                xulElem = document.createElement("menuitem");
-                xulElem.setAttribute('label', strings.getString('prefs.openpanel') + " " + allSidebars[i].getAttribute('label'));
-                xulElem.setAttribute('value', allSidebars[i].id);
-
-                if(allSidebars[i].getAttribute('tooltiptext'))
-                    xulElem.setAttribute('tooltiptext', allSidebars[i].getAttribute('tooltiptext'));
-
-                sidebarInit.appendChild(xulElem);
-                panelInit.appendChild(xulElem.cloneNode(true));
-            }
-
-            cnt++;
-        }
-    }
-
-    sidebarInit.parentNode.value = sidebarPrefInit;
-    panelInit.parentNode.value = panelPrefInit;
-    return true;
-}
-
-
-/*
-    Werte der aktuellen Sidebarbreite einsetzen
-        => Aufruf durch oncommand() der drei <toolbarbutton>
-*/
-function aios_setWidthVal(mode) {
-    var browserWidth = aios_getBrowserWidth();
-    var widthSidebar = browserWidth[0];
-    var widthContent = browserWidth[1] + browserWidth[2];
-    var compWidth = browserWidth[3];
-
-    var percent = parseInt(Math.round((widthSidebar * 100) / compWidth));
-    var theUnit = document.getElementById('obj-' + mode + 'WidthUnit').value;
-
-    if(theUnit == "px") {
-        document.getElementById('obj-' + mode + 'WidthVal').value = widthSidebar;
-        document.getElementById(mode + 'WidthVal').value = widthSidebar;
-    }
-    else if(theUnit == "%") {
-        document.getElementById('obj-' + mode + 'WidthVal').value = percent;
-        document.getElementById(mode + 'WidthVal').value = percent;
-    }
-}
-
-
-/*
-    Breitenangaben bei Aenderung der Masseinheit umrechnen und ausgeben
-        => Aufruf durch ValueChange-Listener, initiert in aios_initPrefs()
-*/
-function aios_changeWidthUnit(mode) {
-    var elem = document.getElementById('obj-' + mode + 'WidthVal');
-    var elemPref = document.getElementById(mode + 'WidthVal');
-    var theUnit = document.getElementById('obj-' + mode + 'WidthUnit').value;
-
-    var browserWidth = aios_getBrowserWidth();
-    var compWidth = browserWidth[3];
-
-    if(theUnit == "px") elem.value = parseInt((parseInt(elem.value) * compWidth) / 100);
-    else elem.value = parseInt((parseInt(elem.value) * 100) / compWidth);
-
-    // preference auch aendern, da sonst der neue Wert des Textfeldes nicht gespeichert wird
-    elemPref.value = elem.value;
-
-    // Kontrolle
-    aios_checkWidthVal(mode);
-}
-
-
-/*
-    Angaben zur Sidebarbreite pruefen
-        => Aufruf durch onBlur() der drei Textfelder, aios_changeWidthUnit(), aios_setConfSidebarWidth()
-*/
-function aios_checkWidthVal(mode) {
-    var elem = document.getElementById('obj-' + mode + 'WidthVal');
-    var theUnit = document.getElementById('obj-' + mode + 'WidthUnit').value;
-
-    elem.value = parseInt(elem.value);
-
-    // Kontrolle
-    if(mode == "max") {
-        if(theUnit == "px" && elem.value < 100) elem.value = 100;
-        else if(theUnit == "%" && elem.value < 10) elem.value = 10;
-    }
-}
-
-
-/*
-    stellt die Groesse der Sidebar ein
-        => Aufruf durch aios_savePrefs() in prefs.js und aios_initSidebar() in aios.js
-*/
-function aios_setConfSidebarWidth() {
-    var elem, theUnit, theValue;
-    var widthStyle = "";
-    var modes = new Array('min', 'def', 'max');
-
-    var browserWidth = aios_getBrowserWidth();
-    var compWidth = browserWidth[3];
-
-    for(var i = 0; i < modes.length; i++) {
-
-        // Aufruf aus dem Options-Dialog => die Eingabefelder als Werte verwenden
-        if(document.getElementById('obj-minWidthVal')) {
-            elem = document.getElementById('obj-' + modes[i] + 'WidthVal');
-            theValue = elem.value;
-            theUnit = document.getElementById('obj-' + modes[i] + 'WidthUnit').value;
-
-            // Kontrolle
-            aios_checkWidthVal(modes[i]);
-        }
-        // Aufruf durch aios_initSidebar() => die abgespeicherten Werte verwenden
-        else {
-            elem = AiOS_HELPER.prefBranchAiOS.getIntPref("gen.width." + modes[i] + "Val");
-            theValue = elem;
-            theUnit = AiOS_HELPER.prefBranchAiOS.getCharPref("gen.width." + modes[i] + "Unit");
-        }
-
-        // Prozente in Px umrechnen (Angaben in % funktionieren hier nicht??)
-        if(theUnit == "%") theValue = parseInt((compWidth * theValue) / 100);
-
-        switch(modes[i]) {
-            case "min":
-                widthStyle+= 'min-width: ' + theValue + 'px !important; ';
-                break;
-            case "def":
-                widthStyle+= 'width: ' + theValue + 'px !important; ';
-                break;
-            case "max":
-                widthStyle+= 'max-width: ' + theValue + 'px !important; ';
-                break;
-        }
-    }
-
-    AiOS_HELPER.mostRecentWindow.document.getElementById('sidebar').setAttribute('style', widthStyle);
-    AiOS_HELPER.mostRecentWindow.document.persist('sidebar', 'style');
+
+/*
+    Liste der zur Verfuegung stehenden Sidebars erstellen
+        => Aufruf durch aios_initPane()
+*/
+function aios_genSidebarList() {
+
+    if(!document.getElementById('sidebarInitPopup') || !document.getElementById('panelInitPopup')) return false;
+
+    var strings = document.getElementById("aiosStrings");
+    //if(!confirm(strings.getString('prefs.confirm'))) return false;
+
+    var sidebarInit = document.getElementById('sidebarInitPopup');
+    var panelInit = document.getElementById('panelInitPopup');
+    var allSidebars = AiOS_HELPER.mostRecentWindow.document.getElementsByAttribute('group', 'sidebar');
+
+    var cnt = 0;
+    var initID = null;
+    var sidebarPrefInit = "";
+    var panelPrefInit = "";
+    try {
+        sidebarPrefInit = AiOS_HELPER.prefBranchAiOS.getCharPref("gen.init");
+        panelPrefInit = AiOS_HELPER.prefBranchAiOS.getCharPref("gen.open.init");
+    } catch(e) { }
+
+    for(var i = 0; i < allSidebars.length; i++) {
+        var xulElem = null;
+
+        // muss eine ID haben, darf keinen observer haben (Menueeintraege usw.) und muss eine Sidebar-URL haben
+        if(allSidebars[i].id && !allSidebars[i].getAttribute('observes') && allSidebars[i].getAttribute('sidebarurl')) {
+
+            var separator = document.createElement("menuseparator");
+            if(cnt == 0) {
+                sidebarInit.appendChild(separator);
+                panelInit.appendChild(separator.cloneNode(true));
+            }
+
+            if(allSidebars[i].id != "extensionsEMbSidebar" && allSidebars[i].id != "themesEMbSidebar") {
+                xulElem = document.createElement("menuitem");
+                xulElem.setAttribute('label', strings.getString('prefs.openpanel') + " " + allSidebars[i].getAttribute('label'));
+                xulElem.setAttribute('value', allSidebars[i].id);
+
+                if(allSidebars[i].getAttribute('tooltiptext'))
+                    xulElem.setAttribute('tooltiptext', allSidebars[i].getAttribute('tooltiptext'));
+
+                sidebarInit.appendChild(xulElem);
+                panelInit.appendChild(xulElem.cloneNode(true));
+            }
+
+            cnt++;
+        }
+    }
+
+    sidebarInit.parentNode.value = sidebarPrefInit;
+    panelInit.parentNode.value = panelPrefInit;
+    return true;
+}
+
+
+/*
+    Werte der aktuellen Sidebarbreite einsetzen
+        => Aufruf durch oncommand() der drei <toolbarbutton>
+*/
+function aios_setWidthVal(mode) {
+    var browserWidth = aios_getBrowserWidth();
+    var widthSidebar = browserWidth[0];
+    var widthContent = browserWidth[1] + browserWidth[2];
+    var compWidth = browserWidth[3];
+
+    var percent = parseInt(Math.round((widthSidebar * 100) / compWidth));
+    var theUnit = document.getElementById('obj-' + mode + 'WidthUnit').value;
+
+    if(theUnit == "px") {
+        document.getElementById('obj-' + mode + 'WidthVal').value = widthSidebar;
+        document.getElementById(mode + 'WidthVal').value = widthSidebar;
+    }
+    else if(theUnit == "%") {
+        document.getElementById('obj-' + mode + 'WidthVal').value = percent;
+        document.getElementById(mode + 'WidthVal').value = percent;
+    }
+}
+
+
+/*
+    Breitenangaben bei Aenderung der Masseinheit umrechnen und ausgeben
+        => Aufruf durch ValueChange-Listener, initiert in aios_initPrefs()
+*/
+function aios_changeWidthUnit(mode) {
+    var elem = document.getElementById('obj-' + mode + 'WidthVal');
+    var elemPref = document.getElementById(mode + 'WidthVal');
+    var theUnit = document.getElementById('obj-' + mode + 'WidthUnit').value;
+
+    var browserWidth = aios_getBrowserWidth();
+    var compWidth = browserWidth[3];
+
+    if(theUnit == "px") elem.value = parseInt((parseInt(elem.value) * compWidth) / 100);
+    else elem.value = parseInt((parseInt(elem.value) * 100) / compWidth);
+
+    // preference auch aendern, da sonst der neue Wert des Textfeldes nicht gespeichert wird
+    elemPref.value = elem.value;
+
+    // Kontrolle
+    aios_checkWidthVal(mode);
+}
+
+
+/*
+    Angaben zur Sidebarbreite pruefen
+        => Aufruf durch onBlur() der drei Textfelder, aios_changeWidthUnit(), aios_setConfSidebarWidth()
+*/
+function aios_checkWidthVal(mode) {
+    var elem = document.getElementById('obj-' + mode + 'WidthVal');
+    var theUnit = document.getElementById('obj-' + mode + 'WidthUnit').value;
+
+    elem.value = parseInt(elem.value);
+
+    // Kontrolle
+    if(mode == "max") {
+        if(theUnit == "px" && elem.value < 100) elem.value = 100;
+        else if(theUnit == "%" && elem.value < 10) elem.value = 10;
+    }
+}
+
+
+/*
+    stellt die Groesse der Sidebar ein
+        => Aufruf durch aios_savePrefs() in prefs.js und aios_initSidebar() in aios.js
+*/
+function aios_setConfSidebarWidth() {
+    var elem, theUnit, theValue;
+    var widthStyle = "";
+    var modes = new Array('min', 'def', 'max');
+
+    var browserWidth = aios_getBrowserWidth();
+    var compWidth = browserWidth[3];
+
+    for(var i = 0; i < modes.length; i++) {
+
+        // Aufruf aus dem Options-Dialog => die Eingabefelder als Werte verwenden
+        if(document.getElementById('obj-minWidthVal')) {
+            elem = document.getElementById('obj-' + modes[i] + 'WidthVal');
+            theValue = elem.value;
+            theUnit = document.getElementById('obj-' + modes[i] + 'WidthUnit').value;
+
+            // Kontrolle
+            aios_checkWidthVal(modes[i]);
+        }
+        // Aufruf durch aios_initSidebar() => die abgespeicherten Werte verwenden
+        else {
+            elem = AiOS_HELPER.prefBranchAiOS.getIntPref("gen.width." + modes[i] + "Val");
+            theValue = elem;
+            theUnit = AiOS_HELPER.prefBranchAiOS.getCharPref("gen.width." + modes[i] + "Unit");
+        }
+
+        // Prozente in Px umrechnen (Angaben in % funktionieren hier nicht??)
+        if(theUnit == "%") theValue = parseInt((compWidth * theValue) / 100);
+
+        switch(modes[i]) {
+            case "min":
+                widthStyle+= 'min-width: ' + theValue + 'px !important; ';
+                break;
+            case "def":
+                widthStyle+= 'width: ' + theValue + 'px !important; ';
+                break;
+            case "max":
+                widthStyle+= 'max-width: ' + theValue + 'px !important; ';
+                break;
+        }
+    }
+
+    AiOS_HELPER.mostRecentWindow.document.getElementById('sidebar').setAttribute('style', widthStyle);
+    AiOS_HELPER.mostRecentWindow.document.persist('sidebar', 'style');
 }
\ No newline at end of file
diff --git a/content/prefs/keys.xul b/content/prefs/keys.xul
index de2a219..145bf43 100644
--- a/content/prefs/keys.xul
+++ b/content/prefs/keys.xul
@@ -1,78 +1,78 @@
-<?xml version="1.0"?>
-
-<!-- locale -->
-<!DOCTYPE prefwindow [
-    <!ENTITY % prefsDTD SYSTEM "chrome://aios/locale/prefs.dtd"> %prefsDTD;
-]>
-
-<overlay id="aiosKeysPaneOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-    <prefpane id="aiosKeys" onpaneload="aios_initKeys();">
-
-        <script type="application/x-javascript" src="chrome://aios/content/_helper.js" />
-        <script type="application/x-javascript" src="chrome://aios/content/prefs/_keyconfig.js"/>
-
-        <script>
-            <![CDATA[
-
-            var gStrings = {
-
-                warn: "&keyconfig.warn;",
-                used: "&keyconfig.used;",
-                onreset: "&keyconfig.onreset;",
-                unrecognized: "&keyconfig.unrecognized;"
-            }
-
-            var keyname = {
-                "BrowserReload();": "key_reload",
-                cmd_handleBackspace: "goBackKb"
-            }
-
-            ]]>
-        </script>
-
-        <stringbundleset>
-            <stringbundle id="platformKeys" src="chrome://global-platform/locale/platformKeys.properties"/>
-            <stringbundle id="localeKeys" src="chrome://global/locale/keys.properties"/>
-        </stringbundleset>
-
-
-        <preferences>
-
-        </preferences>
-
-
-        <tree id="key-tree" flex="1" enableColumnDrag="true" seltype="single" onselect="keyView.selectionChanged();" style="min-height: 150px;">
-
-            <treecols>
-
-                <treecol id="name" label="&keyconfig.keyid;" flex="1" sortDirection="ascending" sortActive="true"
-                    persist="width,ordinal,sortDirection,sortActive,hidden" />
-
-                <splitter class="tree-splitter" />
-
-                <treecol id="shortcut" label="&tab.keys;" flex="1"
-                    persist="width,ordinal,sortDirection,sortActive,hidden" />
-
-                <splitter class="tree-splitter" />
-
-                <treecol id="id" label="&keyconfig.id;" flex="1" hidden="true"
-                    persist="width,ordinal,sortDirection,sortActive,hidden" />
-
-            </treecols>
-
-            <treechildren alternatingbackground="true" context="mainPopup" />
-
-        </tree>
-
-        <groupbox id="editbox" orient="horizontal" disabled="true">
-            <textbox id="edit" observes="editbox" flex="1" onclick="this.select();" onkeypress="Recognize(event);" />
-            <button observes="editbox" label="&keyconfig.apply;" oncommand="Apply();" />
-            <button observes="editbox" label="&keyconfig.disable;" oncommand="Disable();" />
-            <button observes="editbox" label="&keyconfig.reset;" oncommand="Reset();" />
-        </groupbox>
-
-        <description value="&keyconfig.warn;" />
-
-    </prefpane>
+<?xml version="1.0"?>
+
+<!-- locale -->
+<!DOCTYPE prefwindow [
+    <!ENTITY % prefsDTD SYSTEM "chrome://aios/locale/prefs.dtd"> %prefsDTD;
+]>
+
+<overlay id="aiosKeysPaneOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+    <prefpane id="aiosKeys" onpaneload="aios_initKeys();">
+
+        <script type="application/x-javascript" src="chrome://aios/content/_helper.js" />
+        <script type="application/x-javascript" src="chrome://aios/content/prefs/_keyconfig.js"/>
+
+        <script>
+            <![CDATA[
+
+            var gStrings = {
+
+                warn: "&keyconfig.warn;",
+                used: "&keyconfig.used;",
+                onreset: "&keyconfig.onreset;",
+                unrecognized: "&keyconfig.unrecognized;"
+            }
+
+            var keyname = {
+                "BrowserReload();": "key_reload",
+                cmd_handleBackspace: "goBackKb"
+            }
+
+            ]]>
+        </script>
+
+        <stringbundleset>
+            <stringbundle id="platformKeys" src="chrome://global-platform/locale/platformKeys.properties"/>
+            <stringbundle id="localeKeys" src="chrome://global/locale/keys.properties"/>
+        </stringbundleset>
+
+
+        <preferences>
+
+        </preferences>
+
+
+        <tree id="key-tree" flex="1" enableColumnDrag="true" seltype="single" onselect="keyView.selectionChanged();" style="min-height: 150px;">
+
+            <treecols>
+
+                <treecol id="name" label="&keyconfig.keyid;" flex="1" sortDirection="ascending" sortActive="true"
+                    persist="width,ordinal,sortDirection,sortActive,hidden" />
+
+                <splitter class="tree-splitter" />
+
+                <treecol id="shortcut" label="&tab.keys;" flex="1"
+                    persist="width,ordinal,sortDirection,sortActive,hidden" />
+
+                <splitter class="tree-splitter" />
+
+                <treecol id="id" label="&keyconfig.id;" flex="1" hidden="true"
+                    persist="width,ordinal,sortDirection,sortActive,hidden" />
+
+            </treecols>
+
+            <treechildren alternatingbackground="true" context="mainPopup" />
+
+        </tree>
+
+        <groupbox id="editbox" orient="horizontal" disabled="true">
+            <textbox id="edit" observes="editbox" flex="1" onclick="this.select();" onkeypress="Recognize(event);" />
+            <button observes="editbox" label="&keyconfig.apply;" oncommand="Apply();" />
+            <button observes="editbox" label="&keyconfig.disable;" oncommand="Disable();" />
+            <button observes="editbox" label="&keyconfig.reset;" oncommand="Reset();" />
+        </groupbox>
+
+        <description value="&keyconfig.warn;" />
+
+    </prefpane>
 </overlay>
\ No newline at end of file
diff --git a/content/prefs/prefs.js b/content/prefs/prefs.js
index ca50f7d..99dfa78 100644
--- a/content/prefs/prefs.js
+++ b/content/prefs/prefs.js
@@ -1,689 +1,689 @@
-
-/*
-    Initialisierung
-        => Aufruf durch onload im <prefwindow>
-*/
-function aios_initPrefs() {
-    // speziellen Tab oeffnen, wenn einer als Argument uebergeben wurde (aus den Standard-Optionen heraus)
-    if(window.arguments) {
-        if(window.arguments[0] == "dwn") {
-            // Panels-Radio-Button aktivieren
-            var clickEvent = document.createEvent("MouseEvent");
-            clickEvent.initEvent("command", false, true);
-
-            var radiogroup = document.getAnonymousElementByAttribute(document.getElementById('aiosPreferences'), "anonid", "selector");
-            radiogroup.childNodes[1].dispatchEvent(clickEvent);
-
-            // Download-Tab aktivieren
-            var tabbox = document.getElementById('aiosTabboxPanels');
-            if(tabbox.childNodes[0].tagName == "tabs") tabbox.childNodes[0].selectedIndex = 1;
-            if(tabbox.childNodes[1].tagName == "tabs") tabbox.childNodes[1].selectedIndex = 1;
-        }
-    }
-
-    // Apply-Button deaktivieren
-    aios_disableApplyButton(true);
-
-    // Settings-Button
-    if(document.documentElement.getButton('extra2')) {
-        var extra2 = document.documentElement.getButton('extra2');
-        extra2.setAttribute('id', 'aios-settings-button');
-        extra2.setAttribute('popup', 'aios-settings-popup');
-        extra2.setAttribute('dir', 'reverse');
-    }
-
-    // abhaengige Elemente aktivieren oder deaktivieren
-    aios_checkDependent();
-
-    // Advanced Mode aktivieren/deaktivieren
-    aios_advancedMode();
-
-    // Masseinheiten zur Sidebarbreite auf Anderungen ueberwachen
-    document.getElementById('obj-minWidthUnit').addEventListener("ValueChange", function(e) {
-        aios_changeWidthUnit('min');
-    }, false);
-
-    document.getElementById('obj-defWidthUnit').addEventListener("ValueChange", function(e) {
-        aios_changeWidthUnit('def');
-    }, false);
-
-    document.getElementById('obj-maxWidthUnit').addEventListener("ValueChange", function(e) {
-        aios_changeWidthUnit('max');
-    }, false);
-
-    // Prefs merken, wird fuer den Apply-Button benoetigt => aios_checkApply()
-    aios_rememberOldPrefs();
-
-    // alte Prefs loeschen
-    aios_deleteOldPrefs();
-}
-
-
-function aios_initPane(mode) {
-    AiOS_HELPER.rememberAppInfo( document.getElementById("aiosPreferences") );
-
-    // zuletzt gewaehlten Tab wieder selektieren
-    var tabbox = null;
-    switch(mode) {
-        case "general":
-            tabbox = document.getElementById('aiosTabboxGeneral');
-            break;
-        case "panels":
-            tabbox = document.getElementById('aiosTabboxPanels');
-            break;
-        case "menus":
-            tabbox = document.getElementById('aiosTabboxMenus');
-            break;
-    }
-
-    var seltab = tabbox.parentNode.getAttribute('seltab');
-    if(tabbox.childNodes[0].tagName == "tabs") tabbox.childNodes[0].selectedIndex = seltab;
-    if(tabbox.childNodes[1].tagName == "tabs") tabbox.childNodes[1].selectedIndex = seltab;
-
-    // Liste der zur Verfuegung stehenden Sidebars erstellen
-    if(mode == "general") aios_genSidebarList();
-}
-
-
-/*
-    Standardeinstellungen zuruecksetzen
-        => Aufruf durch <menuitem> in prefs.xul
-*/
-function aios_defaultSettings() {
-    var strings = document.getElementById("aiosStrings");
-    if(!confirm(strings.getString('prefs.confirm'))) return false;
-
-    var count = {
-        value : 0
-    };
-    var childList = AiOS_HELPER.prefBranchAiOS.getChildList("", count);
-
-    for(var i = 0; i < count.value; i++) {
-        if(AiOS_HELPER.prefBranchAiOS.prefHasUserValue(childList[i]) && childList[i] != "changelog") {
-            AiOS_HELPER.prefBranchAiOS.clearUserPref(childList[i]);
-        }
-    }
-
-    // GUI-Elemente zuruecksetzen
-    aios_synchElements();
-
-    // abhaengige Elemente aktivieren oder deaktivieren
-    aios_checkDependent();
-
-    return true;
-}
-
-
-/*
-    Einstellungen in die Zwischenablage kopieren oder als Textdatei speichern
-        => Aufruf durch <menuitem> in prefs.xul
-*/
-function aios_exportSettings(aMode) {
-    var strings = document.getElementById("aiosStrings");
-
-    var now = new Date();
-    var sDate = aios_extendInt(now.getMonth() + 1) + "/" + aios_extendInt(now.getDate()) + "/" + now.getFullYear();
-    var sTtime = aios_extendInt(now.getHours()) + ":" + aios_extendInt(now.getMinutes()) + ":" + aios_extendInt(now.getSeconds());
-    var sGMT = now.toGMTString();
-
-    var aiosExport = new Array;
-    aiosExport[0] = "-----------------------------------------------------------------------\n";
-    aiosExport[0]+= "                     All-in-One Sidebar - Settings\n";
-    aiosExport[0]+= "-----------------------------------------------------------------------\n";
-    aiosExport[0]+= "          " + sDate + ", " + sTtime + " (" + sGMT + ")\n";
-    aiosExport[0]+= "          AiOS " + AiOS_HELPER.prefBranchAiOS.getCharPref('changelog') + ", " + AiOS_HELPER.appInfo.vendor + " " + AiOS_HELPER.appInfo.version + ", " + AiOS_HELPER.os + ", " + AiOS_HELPER.prefBranch.getCharPref('general.skins.selectedSkin') + "\n";
-    aiosExport[0]+= "-----------------------------------------------------------------------";
-
-    var count = {
-        value : 0
-    };
-    var childList = AiOS_HELPER.prefBranchAiOS.getChildList("", count);
-
-    for(var i = 0; i < count.value; i++) {
-        try {
-            switch(AiOS_HELPER.prefBranchAiOS.getPrefType(childList[i])) {
-                case    AiOS_HELPER.prefInterface.PREF_BOOL:
-                    aiosExport[i+1] = childList[i] + '=' + AiOS_HELPER.prefBranchAiOS.getBoolPref(childList[i]);
-                    break;
-
-                case    AiOS_HELPER.prefInterface.PREF_INT:
-                    aiosExport[i+1] = childList[i] + '=' + AiOS_HELPER.prefBranchAiOS.getIntPref(childList[i]);
-                    break;
-
-                case    AiOS_HELPER.prefInterface.PREF_STRING:
-                    aiosExport[i+1] = childList[i] + '=' + AiOS_HELPER.prefBranchAiOS.getCharPref(childList[i]);
-                    break;
-            }
-        }
-        catch(e) { }
-    }
-
-    // Einstellungen alphabetisch sortieren
-    aiosExport.sort();
-
-    // String erzeugen
-    var aiosExportString = "";
-    for(var i = 0; i < aiosExport.length; i++) {
-        aiosExportString+= aiosExport[i] + "\n";
-    }
-
-    // String in die Zwischenablage kopieren
-    if(aMode == "copy") {
-        var gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);
-        gClipboardHelper.copyString(aiosExportString);
-
-        alert(strings.getString('prefs.copy'));
-    }
-    // String in einer Textdatei speichern (thanks to adblock & Tab Mix Plus :-))
-    else if(aMode == "save") {
-        var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
-        var stream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
-
-        fp.init(window, strings.getString('prefs.save'), fp.modeSave);
-        fp.defaultExtension = 'txt';
-        fp.defaultString = 'AiOS-Settings';
-        fp.appendFilters(fp.filterText);
-
-        if(fp.show() != fp.returnCancel) {
-
-            if(fp.file.exists()) fp.file.remove(true);
-            fp.file.create(fp.file.NORMAL_FILE_TYPE, 0666);
-            stream.init(fp.file, 0x02, 0x200, null);
-
-            stream.write(aiosExportString, aiosExportString.length);
-            stream.close();
-        }
-    }
-}
-
-
-/*
-    Einstellungen aus Textdatei importieren
-        => Aufruf durch <menuitem> in prefs.xul
-*/
-function aios_importSettings() {
-    var strings = document.getElementById("aiosStrings");
-
-    var pattern = aios_loadFromFile();
-
-    if(!pattern) return false;
-
-    var i;
-    var aiosImport = new Array;
-    var appendFilters = null;
-
-    if(pattern[1].indexOf("All-in-One Sidebar - Settings") < 0 && pattern[1].indexOf("All-In-One Sidebar - Settings") < 0) {
-        alert(strings.getString('prefs.invalid'));
-        return false;
-    }
-
-    if(!confirm(strings.getString('prefs.import'))) return false;
-
-    for(i = 6; i < pattern.length; i++) {
-        var index = pattern[i].indexOf("=");
-
-        if(index > 0) {
-            aiosImport[i] = [];
-            aiosImport[i].push(pattern[i].substring(0, index));
-            aiosImport[i].push(pattern[i].substring(index + 1, pattern[i].length));
-        }
-    }
-
-    if(pattern[1].indexOf("All-in-One Sidebar - Settings") >= 0 || pattern[1].indexOf("All-In-One Sidebar - Settings") >= 0) {
-        for(i = 6; i < aiosImport.length; i++) {
-            try {
-                switch(AiOS_HELPER.prefBranchAiOS.getPrefType(aiosImport[i][0])) {
-                    case    AiOS_HELPER.prefInterface.PREF_BOOL:
-                        AiOS_HELPER.prefBranchAiOS.setBoolPref(aiosImport[i][0],/true/i.test(aiosImport[i][1]));
-                        break;
-
-                    case    AiOS_HELPER.prefInterface.PREF_INT:
-                        AiOS_HELPER.prefBranchAiOS.setIntPref(aiosImport[i][0], aiosImport[i][1]);
-                        break;
-
-                    case    AiOS_HELPER.prefInterface.PREF_STRING:
-                        var pref = aiosImport[i][1];
-                        if(pref.indexOf('"') == 0) // in prev version we use " " for string
-                            pref = pref.substring(1,pref.length - 1);
-                        AiOS_HELPER.prefBranchAiOS.setCharPref(aiosImport[i][0], pref);
-                        break;
-                }
-            }
-            catch(e) { }
-        }
-
-        // GUI-Elemente zuruecksetzen
-        aios_synchElements();
-
-        // abhaengige Elemente aktivieren oder deaktivieren
-        aios_checkDependent();
-
-        return true;
-    }
-
-    alert(strings.getString('prefs.failed'));
-    return false;
-}
-
-
-/*
-    Textdatei in ein Array einlesen (thanks to adblock & Tab Mix Plus :-))
-        => Aufruf durch aios_importSettings()
-*/
-function aios_loadFromFile() {
-    var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
-    var stream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
-    var streamIO = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
-
-    var strings = document.getElementById("aiosStrings");
-
-    fp.init(window, strings.getString('prefs.open'), fp.modeOpen);
-    fp.defaultExtension = 'txt';
-    fp.appendFilters(fp.filterText);
-
-    if(fp.show() != fp.returnCancel) {
-
-        stream.init(fp.file, 0x01, 0444, null);
-        streamIO.init(stream);
-
-        var input = streamIO.read(stream.available());
-        streamIO.close();
-        stream.close();
-
-        var linebreak = input.match(/(((\n+)|(\r+))+)/m)[1]; // first: whole match -- second: backref-1 -- etc..
-        return input.split(linebreak);
-    }
-
-    return null;
-}
-
-
-/*
-    auf abhaengige Elemente pruefen
-        => Aufruf durch aios_initPrefs(), aios_defaultPrefs() und aios_importSettings()
-*/
-function aios_checkDependent() {
-    var childObserver = document.getElementsByAttribute('oncommand', 'aios_checkboxObserver(this);');
-
-    for(var i = 0; i < childObserver.length; i++) {
-        aios_checkboxObserver(childObserver[i]);
-    }
-}
-
-
-/*
-    abhaengige Checkboxen aktivieren oder deaktivieren
-        Aufruf durch die Eltern-Checkbox und aios_checkDependent()
-*/
-function aios_checkboxObserver(which) {
-    var observe = which.getAttribute('aiosChilds');
-    var allChilds = observe.split(",");
-
-    for(var i = 0; i < allChilds.length; i++) {
-        var childPref = allChilds[i].replace(/ /, "");
-
-        var child = document.getElementsByAttribute('preference', childPref);
-        if(child.length == 0) child = document.getElementsByAttribute('id', childPref);
-
-        //if(child[0]) child[0].setAttribute('disabled', !aios_getBoolean(which, 'checked') || aios_getBoolean(which, 'disabled'));
-
-        if(child[0]) {
-            if(!aios_getBoolean(which, 'checked') || aios_getBoolean(which, 'disabled')) child[0].setAttribute('disabled', true);
-            else child[0].removeAttribute('disabled');
-        }
-    }
-}
-
-
-/*
-    Advanced-Mode aktivieren/deaktivieren und Elemente und ein-/ausblenden
-        => Aufruf durch aios_initPrefs() und das <menuitem> des Setting buttons
-*/
-function aios_advancedMode(trigger) {
-
-    /*if(trigger) {
-        var heightBefore = aios_getSizeBoxHeight();
-    }*/
-
-    var advanced = aios_getBoolean('aios-advanced', 'checked');
-
-    // Advanced-Elemente durchlaufen und ein-/ausblenden
-    var advElems = document.getElementsByAttribute('aiosAdvanced', 'true');
-    for(var i = 0; i < advElems.length; i++) {
-
-        // wenn das Element ein Tab-Container ist
-        if(advElems[i].localName == "tabs") {
-
-            var tabChild = advElems[i].selectedIndex;
-            var tabChildClass = advElems[i].childNodes[tabChild].getAttribute('class');
-
-            // vorherigen Tab aktivieren, wenn ein advanced Tab gewaehlt ist und der Advanced Mode deaktiviert wird
-            if(!advanced && tabChildClass == "aiosAdvanced") {
-                advElems[i].parentNode.childNodes[0].selectedIndex = advElems[i].selectedIndex - 1;
-                advElems[i].parentNode.childNodes[1].selectedIndex = advElems[i].selectedIndex - 1;
-
-                // noch einmal vorherigen Tab aktivieren, wenn der neue Tab auch ein advanced Tab ist
-                tabChild = advElems[i].selectedIndex;
-                tabChildClass = advElems[i].childNodes[tabChild].getAttribute('class');
-                if(tabChildClass == "aiosAdvanced") {
-                    advElems[i].parentNode.childNodes[0].selectedIndex = advElems[i].selectedIndex - 1;
-                    advElems[i].parentNode.childNodes[1].selectedIndex = advElems[i].selectedIndex - 1;
-                }
-
-                // selektierten Tab merken (in prefpane)
-                advElems[i].parentNode.parentNode.setAttribute('seltab', advElems[i].selectedIndex);
-            }
-
-            // welcher Tab-Container ist sichtbar?
-            advElems[i].parentNode.childNodes[0].setAttribute('hidden', advanced);
-            advElems[i].parentNode.childNodes[1].setAttribute('hidden', !advanced);
-            if(advanced) advElems[i].parentNode.childNodes[1].style.visibility = 'visible';
-        }
-        // andere Elemente
-        else {
-            advElems[i].setAttribute('hidden', !advanced);
-            if(advanced) advElems[i].style.visibility = 'visible';
-        }
-    }
-
-    // variierende Style-Angaben im normalen und erweiterten Modus
-    var advStyleElems = document.getElementsByAttribute('aiosAdvancedStyle', 'true');
-    for(var s = 0; s < advStyleElems.length; s++) {
-
-        var sStyle = advStyleElems[s].getAttribute('aiosNorStyle');
-        if(advanced) sStyle = advStyleElems[s].getAttribute('aiosAdvStyle');
-
-        advStyleElems[s].setAttribute('style', sStyle);
-    }
-
-    /*// Fenster vergroessern/verkleinern bei Mode-Umschaltung
-    if(trigger) {
-        var heightAfter = aios_getSizeBoxHeight();
-
-        //alert("heightBefore: " + heightBefore + " heightAfter: " + heightAfter);
-
-        var diff = heightBefore - heightAfter;
-        if(heightAfter > heightBefore) diff = diff - 10;
-        window.resizeTo(window.outerWidth, window.outerHeight - diff);
-    }*/
-
-    window.sizeToContent();
-}
-
-
-/*
-    Hoehe der Boxen zum Aktivieren/Deaktivieren des Advanced-Modes ermitteln
-        => Aufruf durch aios_advancedMode()
-*/
-function aios_getSizeBoxHeight() {
-    var theHeight = 0;
-    var sizeBoxen = document.getElementsByAttribute('class', 'aiosSizeBox');
-
-    for(var i = 0; i < sizeBoxen.length; i++) {
-        var h = sizeBoxen[i].boxObject.height;
-
-        if(sizeBoxen[i].getAttribute('restart')) h = h + 30;
-
-        if(h > theHeight) theHeight = h;
-    }
-
-    return theHeight;
-}
-
-
-/*
-    Zahlen mit fuehrender Null zurueckgeben
-        => Aufruf durch aios_exportSettings()
-*/
-function aios_extendInt(aInput) {
-    if(aInput < 10) return "0" + aInput.toString();
-    else return aInput;
-}
-
-
-/*
-    synchronisiert jeweils die beiden Tab-Container, die abwechselnd angezeigt werden (normal und advanced)
-        => Aufruf durch die beiden Tab-Container (General und Misc)
-*/
-function aios_synchTabs(which) {
-    var tabs0 = which.parentNode.childNodes[0];
-    var tabs1 = which.parentNode.childNodes[1];
-
-    if(tabs0.tagName == "tabs") tabs0.selectedIndex = which.selectedIndex;
-    if(tabs1.tagName == "tabs") tabs1.selectedIndex = which.selectedIndex;
-
-    // selektierten Tab merken (in prefpane)
-    which.parentNode.parentNode.setAttribute('seltab', which.selectedIndex);
-}
-
-
-/*
-    GUI-Elemente zuruecksetzen
-        => Aufruf durch aios_defaultSettings() und aios_importSettings()
-*/
-function aios_synchElements() {
-    var val;
-    var prefs = document.getElementsByTagName('preference');
-
-    for(var i = 0; i < prefs.length; i++) {
-
-        var prefID = prefs[i].getAttribute('id');
-        var prefType = prefs[i].getAttribute('type');
-        var prefName = prefs[i].getAttribute('name').replace(/extensions.aios./, "");
-
-        var elem = document.getElementsByAttribute('preference', prefID)[0];
-
-        switch(prefType) {
-            case "int":
-                val = AiOS_HELPER.prefBranchAiOS.getIntPref(prefName);
-                break;
-            case "string":
-                val = AiOS_HELPER.prefBranchAiOS.getCharPref(prefName);
-                break;
-            case "bool":
-                val = AiOS_HELPER.prefBranchAiOS.getBoolPref(prefName);
-                break;
-        }
-
-        if(elem) {
-            switch(elem.tagName) {
-                case "checkbox":
-                    elem.checked = val;
-                    break;
-                case "textbox":
-                    elem.value = val;
-                    break;
-                case "menulist":
-                    elem.value = val;
-                    break;
-            }
-        }
-    }
-}
-
-
-/*
-    Einstellungen einiger Optionen direkt uebernehmen
-        => Aufruf durch button "accept" und aios_applyPrefs()
-*/
-
-function aios_savePrefs() {
-    aios_setConfSidebarWidth();
-
-    // Tooltip fuer PanelTab-Button festlegen
-    if(AiOS_HELPER.mostRecentWindow.document.getElementById('paneltab-button')) {
-        var ptReverse = AiOS_HELPER.prefBranchAiOS.getBoolPref("paneltab.reverse");
-        var ptTooltip = (ptReverse) ? 'paneltab-tooltip-reverse' : 'paneltab-tooltip';
-        AiOS_HELPER.mostRecentWindow.document.getElementById('paneltab-button').setAttribute('tooltip', ptTooltip);
-    }
-
-    if(AiOS_HELPER.mostRecentWindow.aios_setTargets) AiOS_HELPER.mostRecentWindow.aios_setTargets();
-
-    AiOS_HELPER.mostRecentWindow.aios_checkThinSwitch();
-    if(AiOS_HELPER.mostRecentWindow.aios_setSidebarOrient) AiOS_HELPER.mostRecentWindow.aios_setSidebarOrient();
-    if(AiOS_HELPER.mostRecentWindow.aios_initAutohide) AiOS_HELPER.mostRecentWindow.aios_initAutohide();
-
-    // Bugfix...
-    // sonst wird das Kontextmenue der Erweiterung angezeigt,
-    // wenn die Optionen ueber Rechtsklick geoeffnet wurden und der Apply-Button geklickt wird
-    if(opener.document.getElementById('extensionContextMenu'))
-        opener.document.getElementById('extensionContextMenu').hidePopup();
-}
-
-
-/*
-    Einstellungen uebernehmen ohne den Dialog zu schliessen
-        => Aufruf durch button "extra1"
-*/
-function aios_applyPrefs() {
-    var pID, pType, pName, pValue;
-
-    // Prefs direkt speichern
-    var allPrefs = document.getElementsByTagName('preference');
-    for(var i = 0; i < allPrefs.length; i++) {
-        pID = allPrefs[i].getAttribute('id');
-        pType = allPrefs[i].getAttribute('type');
-        pName = allPrefs[i].getAttribute('name');
-        pValue = allPrefs[i].value;
-
-        switch(pType) {
-            case "string":
-                AiOS_HELPER.prefService.setCharPref(pName, pValue);
-                break;
-            case "bool":
-                AiOS_HELPER.prefService.setBoolPref(pName, pValue);
-                break;
-            case "int":
-                AiOS_HELPER.prefService.setIntPref(pName, pValue);
-                break;
-        }
-    }
-
-    // zusaetzliche Optionen
-    aios_savePrefs();
-
-    // Apply-Button deaktivieren
-    aios_disableApplyButton(true);
-
-    // Prefs merken, wird fuer den Apply-Button benoetigt => aios_checkApply()
-    aios_rememberOldPrefs();
-
-    // Prefs direkt in Datei speichern
-    AiOS_HELPER.prefService.savePrefFile(null);
-}
-
-
-/*
-    Apply-Button aktivieren/deaktivieren
-        => Aufruf durch aios_initPrefs(), aios_applyPrefs() und aios_checkApply()
-*/
-function aios_disableApplyButton(aDis) {
-
-    if(document.documentElement.getButton('extra1')) {
-        document.documentElement.getButton('extra1').setAttribute('disabled', aDis);
-    }
-
-    if(aDis) couldApply = "";
-}
-
-
-/*
-    Prefs merken, bevor sie veraendert werden => wird fuer den Apply-Button benoetigt
-        => Aufruf durch aios_initPrefs() und aios_applyPrefs()
-*/
-function aios_rememberOldPrefs() {
-    var allPrefs = document.getElementsByTagName('preference');
-    for(var i = 0; i < allPrefs.length; i++) {
-        allPrefs[i].setAttribute('oldValue', allPrefs[i].value);
-
-        // Change-Listener hinzufuegen
-        if(!allPrefs[i].getAttribute('data-changed')) {
-
-            allPrefs[i].addEventListener("change", function() {
-                aios_checkApply(this);
-            });
-
-            allPrefs[i].setAttribute('data-changed', true)
-
-        }
-    }
-}
-
-
-/*
-    Ueberpruefung auf zu speichernde Optionen => Apply-Button deaktivieren/aktivieren
-        Aufruf durch alle Checkboxen, Selcts, Textboxen usw durch onchange-Handler - gesetzt durch aios_rememberOldPrefs()
-*/
-var couldApply = "";
-function aios_checkApply(aPref) {
-    if(typeof aPref == "object") {
-
-        var oldPref, newPref;
-        var pID = aPref.id;
-
-        // gemerkte und neue Einstellungen in richtiges Format konvertieren
-        switch(aPref.getAttribute('type')) {
-            case "string":
-                oldPref = aPref.getAttribute('oldValue');
-                newPref = aPref.value;
-                break;
-
-            case "bool":
-                oldPref = aios_getBoolean(aPref, 'oldValue');
-                newPref = aPref.value;
-                break;
-
-            case "int":
-                oldPref = aPref.getAttribute('oldValue') * 1;
-                newPref = aPref.value * 1;
-                break;
-        }
-
-        // wenn die Aenderung der alten Einstellung entspricht,...
-        if(oldPref === newPref) {
-
-            // enspr. String loeschen
-            if(couldApply.indexOf(pID) >= 0) {
-                var t1 = couldApply.substr(0, couldApply.indexOf(pID));
-                if(t1.indexOf(",") == 0) t1 = t1.substr(1, t1.length);                  // Komma am Anfang loeschen
-                if(t1.lastIndexOf(",") == t1.length - 1) t1 = t1.substr(0, t1.length - 1);      // Komma am Ende loeschen
-
-                var t2 = couldApply.substr(couldApply.indexOf(pID) + pID.length, couldApply.length);
-                if(t2.indexOf(",") == 0) t2 = t2.substr(1, t2.length);                  // Komma am Anfang loeschen
-                if(t2.lastIndexOf(",") == t2.length - 1) t2 = t2.substr(0, t2.length - 1);      // Komma am Ende loeschen
-
-                if(t2.length > 0) t1+= ",";                                                     // mit Komma verbinden
-                couldApply = t1 + t2;
-            }
-        //alert("keine Aenderung: " + couldApply);
-        }
-        // wenn die Aenderung _nicht_ der alten Einstellung entspricht,...
-        else {
-            // enspr. String erweitern
-            if(couldApply.length > 0) couldApply+= ",";                                         // mit Komma verbinden
-            couldApply+= pID;
-        //alert("Aenderung: " + couldApply);
-        }
-
-        // Apply-Button deaktivieren/aktivieren
-        if(couldApply.length == 0) aios_disableApplyButton(true);
-        else aios_disableApplyButton(false);
-    }
-}
-
-
-/*
-    Optionen aus aelteren Versionen loeschen
-        => Aufruf durch aios_initPrefs()
-*/
-function aios_deleteOldPrefs() {
-
-    var oldPrefs = new Array('em.layout', 'em.layoutall', 'em.slim', 'em.colors', 'dm.slim', 'dm.colors', 'co.slim', 'co.colors', 'bm.layout', 'bm.layoutall', 'hi.layout', 'hi.layoutall');
-
-    for(var i = 0; i < oldPrefs.length; i++) {
-        try {
-            AiOS_HELPER.prefBranchAiOS.clearUserPref(oldPrefs[i]);
-        }
-        catch(e) { }
-    }
+
+/*
+    Initialisierung
+        => Aufruf durch onload im <prefwindow>
+*/
+function aios_initPrefs() {
+    // speziellen Tab oeffnen, wenn einer als Argument uebergeben wurde (aus den Standard-Optionen heraus)
+    if(window.arguments) {
+        if(window.arguments[0] == "dwn") {
+            // Panels-Radio-Button aktivieren
+            var clickEvent = document.createEvent("MouseEvent");
+            clickEvent.initEvent("command", false, true);
+
+            var radiogroup = document.getAnonymousElementByAttribute(document.getElementById('aiosPreferences'), "anonid", "selector");
+            radiogroup.childNodes[1].dispatchEvent(clickEvent);
+
+            // Download-Tab aktivieren
+            var tabbox = document.getElementById('aiosTabboxPanels');
+            if(tabbox.childNodes[0].tagName == "tabs") tabbox.childNodes[0].selectedIndex = 1;
+            if(tabbox.childNodes[1].tagName == "tabs") tabbox.childNodes[1].selectedIndex = 1;
+        }
+    }
+
+    // Apply-Button deaktivieren
+    aios_disableApplyButton(true);
+
+    // Settings-Button
+    if(document.documentElement.getButton('extra2')) {
+        var extra2 = document.documentElement.getButton('extra2');
+        extra2.setAttribute('id', 'aios-settings-button');
+        extra2.setAttribute('popup', 'aios-settings-popup');
+        extra2.setAttribute('dir', 'reverse');
+    }
+
+    // abhaengige Elemente aktivieren oder deaktivieren
+    aios_checkDependent();
+
+    // Advanced Mode aktivieren/deaktivieren
+    aios_advancedMode();
+
+    // Masseinheiten zur Sidebarbreite auf Anderungen ueberwachen
+    document.getElementById('obj-minWidthUnit').addEventListener("ValueChange", function(e) {
+        aios_changeWidthUnit('min');
+    }, false);
+
+    document.getElementById('obj-defWidthUnit').addEventListener("ValueChange", function(e) {
+        aios_changeWidthUnit('def');
+    }, false);
+
+    document.getElementById('obj-maxWidthUnit').addEventListener("ValueChange", function(e) {
+        aios_changeWidthUnit('max');
+    }, false);
+
+    // Prefs merken, wird fuer den Apply-Button benoetigt => aios_checkApply()
+    aios_rememberOldPrefs();
+
+    // alte Prefs loeschen
+    aios_deleteOldPrefs();
+}
+
+
+function aios_initPane(mode) {
+    AiOS_HELPER.rememberAppInfo( document.getElementById("aiosPreferences") );
+
+    // zuletzt gewaehlten Tab wieder selektieren
+    var tabbox = null;
+    switch(mode) {
+        case "general":
+            tabbox = document.getElementById('aiosTabboxGeneral');
+            break;
+        case "panels":
+            tabbox = document.getElementById('aiosTabboxPanels');
+            break;
+        case "menus":
+            tabbox = document.getElementById('aiosTabboxMenus');
+            break;
+    }
+
+    var seltab = tabbox.parentNode.getAttribute('seltab');
+    if(tabbox.childNodes[0].tagName == "tabs") tabbox.childNodes[0].selectedIndex = seltab;
+    if(tabbox.childNodes[1].tagName == "tabs") tabbox.childNodes[1].selectedIndex = seltab;
+
+    // Liste der zur Verfuegung stehenden Sidebars erstellen
+    if(mode == "general") aios_genSidebarList();
+}
+
+
+/*
+    Standardeinstellungen zuruecksetzen
+        => Aufruf durch <menuitem> in prefs.xul
+*/
+function aios_defaultSettings() {
+    var strings = document.getElementById("aiosStrings");
+    if(!confirm(strings.getString('prefs.confirm'))) return false;
+
+    var count = {
+        value : 0
+    };
+    var childList = AiOS_HELPER.prefBranchAiOS.getChildList("", count);
+
+    for(var i = 0; i < count.value; i++) {
+        if(AiOS_HELPER.prefBranchAiOS.prefHasUserValue(childList[i]) && childList[i] != "changelog") {
+            AiOS_HELPER.prefBranchAiOS.clearUserPref(childList[i]);
+        }
+    }
+
+    // GUI-Elemente zuruecksetzen
+    aios_synchElements();
+
+    // abhaengige Elemente aktivieren oder deaktivieren
+    aios_checkDependent();
+
+    return true;
+}
+
+
+/*
+    Einstellungen in die Zwischenablage kopieren oder als Textdatei speichern
+        => Aufruf durch <menuitem> in prefs.xul
+*/
+function aios_exportSettings(aMode) {
+    var strings = document.getElementById("aiosStrings");
+
+    var now = new Date();
+    var sDate = aios_extendInt(now.getMonth() + 1) + "/" + aios_extendInt(now.getDate()) + "/" + now.getFullYear();
+    var sTtime = aios_extendInt(now.getHours()) + ":" + aios_extendInt(now.getMinutes()) + ":" + aios_extendInt(now.getSeconds());
+    var sGMT = now.toGMTString();
+
+    var aiosExport = new Array;
+    aiosExport[0] = "-----------------------------------------------------------------------\n";
+    aiosExport[0]+= "                     All-in-One Sidebar - Settings\n";
+    aiosExport[0]+= "-----------------------------------------------------------------------\n";
+    aiosExport[0]+= "          " + sDate + ", " + sTtime + " (" + sGMT + ")\n";
+    aiosExport[0]+= "          AiOS " + AiOS_HELPER.prefBranchAiOS.getCharPref('changelog') + ", " + AiOS_HELPER.appInfo.vendor + " " + AiOS_HELPER.appInfo.version + ", " + AiOS_HELPER.os + ", " + AiOS_HELPER.prefBranch.getCharPref('general.skins.selectedSkin') + "\n";
+    aiosExport[0]+= "-----------------------------------------------------------------------";
+
+    var count = {
+        value : 0
+    };
+    var childList = AiOS_HELPER.prefBranchAiOS.getChildList("", count);
+
+    for(var i = 0; i < count.value; i++) {
+        try {
+            switch(AiOS_HELPER.prefBranchAiOS.getPrefType(childList[i])) {
+                case    AiOS_HELPER.prefInterface.PREF_BOOL:
+                    aiosExport[i+1] = childList[i] + '=' + AiOS_HELPER.prefBranchAiOS.getBoolPref(childList[i]);
+                    break;
+
+                case    AiOS_HELPER.prefInterface.PREF_INT:
+                    aiosExport[i+1] = childList[i] + '=' + AiOS_HELPER.prefBranchAiOS.getIntPref(childList[i]);
+                    break;
+
+                case    AiOS_HELPER.prefInterface.PREF_STRING:
+                    aiosExport[i+1] = childList[i] + '=' + AiOS_HELPER.prefBranchAiOS.getCharPref(childList[i]);
+                    break;
+            }
+        }
+        catch(e) { }
+    }
+
+    // Einstellungen alphabetisch sortieren
+    aiosExport.sort();
+
+    // String erzeugen
+    var aiosExportString = "";
+    for(var i = 0; i < aiosExport.length; i++) {
+        aiosExportString+= aiosExport[i] + "\n";
+    }
+
+    // String in die Zwischenablage kopieren
+    if(aMode == "copy") {
+        var gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);
+        gClipboardHelper.copyString(aiosExportString);
+
+        alert(strings.getString('prefs.copy'));
+    }
+    // String in einer Textdatei speichern (thanks to adblock & Tab Mix Plus :-))
+    else if(aMode == "save") {
+        var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
+        var stream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
+
+        fp.init(window, strings.getString('prefs.save'), fp.modeSave);
+        fp.defaultExtension = 'txt';
+        fp.defaultString = 'AiOS-Settings';
+        fp.appendFilters(fp.filterText);
+
+        if(fp.show() != fp.returnCancel) {
+
+            if(fp.file.exists()) fp.file.remove(true);
+            fp.file.create(fp.file.NORMAL_FILE_TYPE, 0666);
+            stream.init(fp.file, 0x02, 0x200, null);
+
+            stream.write(aiosExportString, aiosExportString.length);
+            stream.close();
+        }
+    }
+}
+
+
+/*
+    Einstellungen aus Textdatei importieren
+        => Aufruf durch <menuitem> in prefs.xul
+*/
+function aios_importSettings() {
+    var strings = document.getElementById("aiosStrings");
+
+    var pattern = aios_loadFromFile();
+
+    if(!pattern) return false;
+
+    var i;
+    var aiosImport = new Array;
+    var appendFilters = null;
+
+    if(pattern[1].indexOf("All-in-One Sidebar - Settings") < 0 && pattern[1].indexOf("All-In-One Sidebar - Settings") < 0) {
+        alert(strings.getString('prefs.invalid'));
+        return false;
+    }
+
+    if(!confirm(strings.getString('prefs.import'))) return false;
+
+    for(i = 6; i < pattern.length; i++) {
+        var index = pattern[i].indexOf("=");
+
+        if(index > 0) {
+            aiosImport[i] = [];
+            aiosImport[i].push(pattern[i].substring(0, index));
+            aiosImport[i].push(pattern[i].substring(index + 1, pattern[i].length));
+        }
+    }
+
+    if(pattern[1].indexOf("All-in-One Sidebar - Settings") >= 0 || pattern[1].indexOf("All-In-One Sidebar - Settings") >= 0) {
+        for(i = 6; i < aiosImport.length; i++) {
+            try {
+                switch(AiOS_HELPER.prefBranchAiOS.getPrefType(aiosImport[i][0])) {
+                    case    AiOS_HELPER.prefInterface.PREF_BOOL:
+                        AiOS_HELPER.prefBranchAiOS.setBoolPref(aiosImport[i][0],/true/i.test(aiosImport[i][1]));
+                        break;
+
+                    case    AiOS_HELPER.prefInterface.PREF_INT:
+                        AiOS_HELPER.prefBranchAiOS.setIntPref(aiosImport[i][0], aiosImport[i][1]);
+                        break;
+
+                    case    AiOS_HELPER.prefInterface.PREF_STRING:
+                        var pref = aiosImport[i][1];
+                        if(pref.indexOf('"') == 0) // in prev version we use " " for string
+                            pref = pref.substring(1,pref.length - 1);
+                        AiOS_HELPER.prefBranchAiOS.setCharPref(aiosImport[i][0], pref);
+                        break;
+                }
+            }
+            catch(e) { }
+        }
+
+        // GUI-Elemente zuruecksetzen
+        aios_synchElements();
+
+        // abhaengige Elemente aktivieren oder deaktivieren
+        aios_checkDependent();
+
+        return true;
+    }
+
+    alert(strings.getString('prefs.failed'));
+    return false;
+}
+
+
+/*
+    Textdatei in ein Array einlesen (thanks to adblock & Tab Mix Plus :-))
+        => Aufruf durch aios_importSettings()
+*/
+function aios_loadFromFile() {
+    var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
+    var stream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
+    var streamIO = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
+
+    var strings = document.getElementById("aiosStrings");
+
+    fp.init(window, strings.getString('prefs.open'), fp.modeOpen);
+    fp.defaultExtension = 'txt';
+    fp.appendFilters(fp.filterText);
+
+    if(fp.show() != fp.returnCancel) {
+
+        stream.init(fp.file, 0x01, 0444, null);
+        streamIO.init(stream);
+
+        var input = streamIO.read(stream.available());
+        streamIO.close();
+        stream.close();
+
+        var linebreak = input.match(/(((\n+)|(\r+))+)/m)[1]; // first: whole match -- second: backref-1 -- etc..
+        return input.split(linebreak);
+    }
+
+    return null;
+}
+
+
+/*
+    auf abhaengige Elemente pruefen
+        => Aufruf durch aios_initPrefs(), aios_defaultPrefs() und aios_importSettings()
+*/
+function aios_checkDependent() {
+    var childObserver = document.getElementsByAttribute('oncommand', 'aios_checkboxObserver(this);');
+
+    for(var i = 0; i < childObserver.length; i++) {
+        aios_checkboxObserver(childObserver[i]);
+    }
+}
+
+
+/*
+    abhaengige Checkboxen aktivieren oder deaktivieren
+        Aufruf durch die Eltern-Checkbox und aios_checkDependent()
+*/
+function aios_checkboxObserver(which) {
+    var observe = which.getAttribute('aiosChilds');
+    var allChilds = observe.split(",");
+
+    for(var i = 0; i < allChilds.length; i++) {
+        var childPref = allChilds[i].replace(/ /, "");
+
+        var child = document.getElementsByAttribute('preference', childPref);
+        if(child.length == 0) child = document.getElementsByAttribute('id', childPref);
+
+        //if(child[0]) child[0].setAttribute('disabled', !aios_getBoolean(which, 'checked') || aios_getBoolean(which, 'disabled'));
+
+        if(child[0]) {
+            if(!aios_getBoolean(which, 'checked') || aios_getBoolean(which, 'disabled')) child[0].setAttribute('disabled', true);
+            else child[0].removeAttribute('disabled');
+        }
+    }
+}
+
+
+/*
+    Advanced-Mode aktivieren/deaktivieren und Elemente und ein-/ausblenden
+        => Aufruf durch aios_initPrefs() und das <menuitem> des Setting buttons
+*/
+function aios_advancedMode(trigger) {
+
+    /*if(trigger) {
+        var heightBefore = aios_getSizeBoxHeight();
+    }*/
+
+    var advanced = aios_getBoolean('aios-advanced', 'checked');
+
+    // Advanced-Elemente durchlaufen und ein-/ausblenden
+    var advElems = document.getElementsByAttribute('aiosAdvanced', 'true');
+    for(var i = 0; i < advElems.length; i++) {
+
+        // wenn das Element ein Tab-Container ist
+        if(advElems[i].localName == "tabs") {
+
+            var tabChild = advElems[i].selectedIndex;
+            var tabChildClass = advElems[i].childNodes[tabChild].getAttribute('class');
+
+            // vorherigen Tab aktivieren, wenn ein advanced Tab gewaehlt ist und der Advanced Mode deaktiviert wird
+            if(!advanced && tabChildClass == "aiosAdvanced") {
+                advElems[i].parentNode.childNodes[0].selectedIndex = advElems[i].selectedIndex - 1;
+                advElems[i].parentNode.childNodes[1].selectedIndex = advElems[i].selectedIndex - 1;
+
+                // noch einmal vorherigen Tab aktivieren, wenn der neue Tab auch ein advanced Tab ist
+                tabChild = advElems[i].selectedIndex;
+                tabChildClass = advElems[i].childNodes[tabChild].getAttribute('class');
+                if(tabChildClass == "aiosAdvanced") {
+                    advElems[i].parentNode.childNodes[0].selectedIndex = advElems[i].selectedIndex - 1;
+                    advElems[i].parentNode.childNodes[1].selectedIndex = advElems[i].selectedIndex - 1;
+                }
+
+                // selektierten Tab merken (in prefpane)
+                advElems[i].parentNode.parentNode.setAttribute('seltab', advElems[i].selectedIndex);
+            }
+
+            // welcher Tab-Container ist sichtbar?
+            advElems[i].parentNode.childNodes[0].setAttribute('hidden', advanced);
+            advElems[i].parentNode.childNodes[1].setAttribute('hidden', !advanced);
+            if(advanced) advElems[i].parentNode.childNodes[1].style.visibility = 'visible';
+        }
+        // andere Elemente
+        else {
+            advElems[i].setAttribute('hidden', !advanced);
+            if(advanced) advElems[i].style.visibility = 'visible';
+        }
+    }
+
+    // variierende Style-Angaben im normalen und erweiterten Modus
+    var advStyleElems = document.getElementsByAttribute('aiosAdvancedStyle', 'true');
+    for(var s = 0; s < advStyleElems.length; s++) {
+
+        var sStyle = advStyleElems[s].getAttribute('aiosNorStyle');
+        if(advanced) sStyle = advStyleElems[s].getAttribute('aiosAdvStyle');
+
+        advStyleElems[s].setAttribute('style', sStyle);
+    }
+
+    /*// Fenster vergroessern/verkleinern bei Mode-Umschaltung
+    if(trigger) {
+        var heightAfter = aios_getSizeBoxHeight();
+
+        //alert("heightBefore: " + heightBefore + " heightAfter: " + heightAfter);
+
+        var diff = heightBefore - heightAfter;
+        if(heightAfter > heightBefore) diff = diff - 10;
+        window.resizeTo(window.outerWidth, window.outerHeight - diff);
+    }*/
+
+    window.sizeToContent();
+}
+
+
+/*
+    Hoehe der Boxen zum Aktivieren/Deaktivieren des Advanced-Modes ermitteln
+        => Aufruf durch aios_advancedMode()
+*/
+function aios_getSizeBoxHeight() {
+    var theHeight = 0;
+    var sizeBoxen = document.getElementsByAttribute('class', 'aiosSizeBox');
+
+    for(var i = 0; i < sizeBoxen.length; i++) {
+        var h = sizeBoxen[i].boxObject.height;
+
+        if(sizeBoxen[i].getAttribute('restart')) h = h + 30;
+
+        if(h > theHeight) theHeight = h;
+    }
+
+    return theHeight;
+}
+
+
+/*
+    Zahlen mit fuehrender Null zurueckgeben
+        => Aufruf durch aios_exportSettings()
+*/
+function aios_extendInt(aInput) {
+    if(aInput < 10) return "0" + aInput.toString();
+    else return aInput;
+}
+
+
+/*
+    synchronisiert jeweils die beiden Tab-Container, die abwechselnd angezeigt werden (normal und advanced)
+        => Aufruf durch die beiden Tab-Container (General und Misc)
+*/
+function aios_synchTabs(which) {
+    var tabs0 = which.parentNode.childNodes[0];
+    var tabs1 = which.parentNode.childNodes[1];
+
+    if(tabs0.tagName == "tabs") tabs0.selectedIndex = which.selectedIndex;
+    if(tabs1.tagName == "tabs") tabs1.selectedIndex = which.selectedIndex;
+
+    // selektierten Tab merken (in prefpane)
+    which.parentNode.parentNode.setAttribute('seltab', which.selectedIndex);
+}
+
+
+/*
+    GUI-Elemente zuruecksetzen
+        => Aufruf durch aios_defaultSettings() und aios_importSettings()
+*/
+function aios_synchElements() {
+    var val;
+    var prefs = document.getElementsByTagName('preference');
+
+    for(var i = 0; i < prefs.length; i++) {
+
+        var prefID = prefs[i].getAttribute('id');
+        var prefType = prefs[i].getAttribute('type');
+        var prefName = prefs[i].getAttribute('name').replace(/extensions.aios./, "");
+
+        var elem = document.getElementsByAttribute('preference', prefID)[0];
+
+        switch(prefType) {
+            case "int":
+                val = AiOS_HELPER.prefBranchAiOS.getIntPref(prefName);
+                break;
+            case "string":
+                val = AiOS_HELPER.prefBranchAiOS.getCharPref(prefName);
+                break;
+            case "bool":
+                val = AiOS_HELPER.prefBranchAiOS.getBoolPref(prefName);
+                break;
+        }
+
+        if(elem) {
+            switch(elem.tagName) {
+                case "checkbox":
+                    elem.checked = val;
+                    break;
+                case "textbox":
+                    elem.value = val;
+                    break;
+                case "menulist":
+                    elem.value = val;
+                    break;
+            }
+        }
+    }
+}
+
+
+/*
+    Einstellungen einiger Optionen direkt uebernehmen
+        => Aufruf durch button "accept" und aios_applyPrefs()
+*/
+
+function aios_savePrefs() {
+    aios_setConfSidebarWidth();
+
+    // Tooltip fuer PanelTab-Button festlegen
+    if(AiOS_HELPER.mostRecentWindow.document.getElementById('paneltab-button')) {
+        var ptReverse = AiOS_HELPER.prefBranchAiOS.getBoolPref("paneltab.reverse");
+        var ptTooltip = (ptReverse) ? 'paneltab-tooltip-reverse' : 'paneltab-tooltip';
+        AiOS_HELPER.mostRecentWindow.document.getElementById('paneltab-button').setAttribute('tooltip', ptTooltip);
+    }
+
+    if(AiOS_HELPER.mostRecentWindow.aios_setTargets) AiOS_HELPER.mostRecentWindow.aios_setTargets();
+
+    AiOS_HELPER.mostRecentWindow.aios_checkThinSwitch();
+    if(AiOS_HELPER.mostRecentWindow.aios_setSidebarOrient) AiOS_HELPER.mostRecentWindow.aios_setSidebarOrient();
+    if(AiOS_HELPER.mostRecentWindow.aios_initAutohide) AiOS_HELPER.mostRecentWindow.aios_initAutohide();
+
+    // Bugfix...
+    // sonst wird das Kontextmenue der Erweiterung angezeigt,
+    // wenn die Optionen ueber Rechtsklick geoeffnet wurden und der Apply-Button geklickt wird
+    if(opener.document.getElementById('extensionContextMenu'))
+        opener.document.getElementById('extensionContextMenu').hidePopup();
+}
+
+
+/*
+    Einstellungen uebernehmen ohne den Dialog zu schliessen
+        => Aufruf durch button "extra1"
+*/
+function aios_applyPrefs() {
+    var pID, pType, pName, pValue;
+
+    // Prefs direkt speichern
+    var allPrefs = document.getElementsByTagName('preference');
+    for(var i = 0; i < allPrefs.length; i++) {
+        pID = allPrefs[i].getAttribute('id');
+        pType = allPrefs[i].getAttribute('type');
+        pName = allPrefs[i].getAttribute('name');
+        pValue = allPrefs[i].value;
+
+        switch(pType) {
+            case "string":
+                AiOS_HELPER.prefService.setCharPref(pName, pValue);
+                break;
+            case "bool":
+                AiOS_HELPER.prefService.setBoolPref(pName, pValue);
+                break;
+            case "int":
+                AiOS_HELPER.prefService.setIntPref(pName, pValue);
+                break;
+        }
+    }
+
+    // zusaetzliche Optionen
+    aios_savePrefs();
+
+    // Apply-Button deaktivieren
+    aios_disableApplyButton(true);
+
+    // Prefs merken, wird fuer den Apply-Button benoetigt => aios_checkApply()
+    aios_rememberOldPrefs();
+
+    // Prefs direkt in Datei speichern
+    AiOS_HELPER.prefService.savePrefFile(null);
+}
+
+
+/*
+    Apply-Button aktivieren/deaktivieren
+        => Aufruf durch aios_initPrefs(), aios_applyPrefs() und aios_checkApply()
+*/
+function aios_disableApplyButton(aDis) {
+
+    if(document.documentElement.getButton('extra1')) {
+        document.documentElement.getButton('extra1').setAttribute('disabled', aDis);
+    }
+
+    if(aDis) couldApply = "";
+}
+
+
+/*
+    Prefs merken, bevor sie veraendert werden => wird fuer den Apply-Button benoetigt
+        => Aufruf durch aios_initPrefs() und aios_applyPrefs()
+*/
+function aios_rememberOldPrefs() {
+    var allPrefs = document.getElementsByTagName('preference');
+    for(var i = 0; i < allPrefs.length; i++) {
+        allPrefs[i].setAttribute('oldValue', allPrefs[i].value);
+
+        // Change-Listener hinzufuegen
+        if(!allPrefs[i].getAttribute('data-changed')) {
+
+            allPrefs[i].addEventListener("change", function() {
+                aios_checkApply(this);
+            });
+
+            allPrefs[i].setAttribute('data-changed', true)
+
+        }
+    }
+}
+
+
+/*
+    Ueberpruefung auf zu speichernde Optionen => Apply-Button deaktivieren/aktivieren
+        Aufruf durch alle Checkboxen, Selcts, Textboxen usw durch onchange-Handler - gesetzt durch aios_rememberOldPrefs()
+*/
+var couldApply = "";
+function aios_checkApply(aPref) {
+    if(typeof aPref == "object") {
+
+        var oldPref, newPref;
+        var pID = aPref.id;
+
+        // gemerkte und neue Einstellungen in richtiges Format konvertieren
+        switch(aPref.getAttribute('type')) {
+            case "string":
+                oldPref = aPref.getAttribute('oldValue');
+                newPref = aPref.value;
+                break;
+
+            case "bool":
+                oldPref = aios_getBoolean(aPref, 'oldValue');
+                newPref = aPref.value;
+                break;
+
+            case "int":
+                oldPref = aPref.getAttribute('oldValue') * 1;
+                newPref = aPref.value * 1;
+                break;
+        }
+
+        // wenn die Aenderung der alten Einstellung entspricht,...
+        if(oldPref === newPref) {
+
+            // enspr. String loeschen
+            if(couldApply.indexOf(pID) >= 0) {
+                var t1 = couldApply.substr(0, couldApply.indexOf(pID));
+                if(t1.indexOf(",") == 0) t1 = t1.substr(1, t1.length);                  // Komma am Anfang loeschen
+                if(t1.lastIndexOf(",") == t1.length - 1) t1 = t1.substr(0, t1.length - 1);      // Komma am Ende loeschen
+
+                var t2 = couldApply.substr(couldApply.indexOf(pID) + pID.length, couldApply.length);
+                if(t2.indexOf(",") == 0) t2 = t2.substr(1, t2.length);                  // Komma am Anfang loeschen
+                if(t2.lastIndexOf(",") == t2.length - 1) t2 = t2.substr(0, t2.length - 1);      // Komma am Ende loeschen
+
+                if(t2.length > 0) t1+= ",";                                                     // mit Komma verbinden
+                couldApply = t1 + t2;
+            }
+        //alert("keine Aenderung: " + couldApply);
+        }
+        // wenn die Aenderung _nicht_ der alten Einstellung entspricht,...
+        else {
+            // enspr. String erweitern
+            if(couldApply.length > 0) couldApply+= ",";                                         // mit Komma verbinden
+            couldApply+= pID;
+        //alert("Aenderung: " + couldApply);
+        }
+
+        // Apply-Button deaktivieren/aktivieren
+        if(couldApply.length == 0) aios_disableApplyButton(true);
+        else aios_disableApplyButton(false);
+    }
+}
+
+
+/*
+    Optionen aus aelteren Versionen loeschen
+        => Aufruf durch aios_initPrefs()
+*/
+function aios_deleteOldPrefs() {
+
+    var oldPrefs = new Array('em.layout', 'em.layoutall', 'em.slim', 'em.colors', 'dm.slim', 'dm.colors', 'co.slim', 'co.colors', 'bm.layout', 'bm.layoutall', 'hi.layout', 'hi.layoutall');
+
+    for(var i = 0; i < oldPrefs.length; i++) {
+        try {
+            AiOS_HELPER.prefBranchAiOS.clearUserPref(oldPrefs[i]);
+        }
+        catch(e) { }
+    }
 }
\ No newline at end of file
diff --git a/content/prefs/prefs.xul b/content/prefs/prefs.xul
index 2b59e16..9dd5ac5 100644
--- a/content/prefs/prefs.xul
+++ b/content/prefs/prefs.xul
@@ -1,837 +1,837 @@
-<?xml version="1.0"?>
-
-<!-- skin -->
-<?xml-stylesheet href="chrome://global/skin/global.css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
-<?xml-stylesheet href="chrome://aios/skin/css/prefs.css"?>
-
-<!-- locale -->
-<!DOCTYPE prefwindow [
-    <!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd"> %browserDTD;
-
-    <!ENTITY % commonDTD SYSTEM "chrome://aios/content/aios.dtd"> %commonDTD;
-    <!ENTITY % prefsDTD SYSTEM "chrome://aios/locale/prefs.dtd"> %prefsDTD;
-    <!ENTITY % aiosDTD SYSTEM "chrome://aios/locale/aios.dtd"> %aiosDTD;
-    <!ENTITY % webpanelDTD SYSTEM "chrome://aios/locale/webpanel.dtd"> %webpanelDTD;
-]>
-
-<prefwindow id="aiosPreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-    title = "&title;"
-    persist = "screenX screenY"
-    buttons = "accept,cancel,extra2,extra1,disclosure"
-    style = "min-width: 45em; max-width: 780px;"
-    buttonlabelextra2 = "&settings;"
-    buttonlabelextra1 = "&apply;"
-
-    onload = "aios_initPrefs();"
-    ondialogaccept = "aios_savePrefs();"
-    ondialogextra1 = "aios_applyPrefs();"
-    ondialogdisclosure = "aios_addTab('http://firefox.exxile.net/aios/faq.php');">
-
-    <box>
-
-        <script type="application/x-javascript" src="chrome://aios/content/_helper.js" />
-        <script type="application/x-javascript" src="chrome://aios/content/prefs/prefs.js" />
-
-        <stringbundleset>
-            <stringbundle id="aiosStrings" src="chrome://aios/locale/lib.properties" />
-        </stringbundleset>
-
-        <popupset>
-            <menupopup id="aios-settings-popup" position="before_start">
-                <menuitem id="aios-defaults" label="&settings.default;" oncommand="aios_defaultSettings();" />
-                <menuitem id="aios-advanced" label="&settings.advanced;" class="aiosAdvanced" type="checkbox"
-                    autoCheck="false" persist="checked" oncommand="aios_advancedMode(true);" />
-
-                <menuseparator />
-
-                <menuitem id="aios-export" label="&settings.export;" oncommand="aios_exportSettings('save');" />
-                <menuitem id="aios-import" label="&settings.import;" oncommand="aios_importSettings();" />
-                <menuitem id="aios-copy" label="&settings.copy;" oncommand="aios_exportSettings('copy');" />
-            </menupopup>
-        </popupset>
-
-    </box>
-
-
-<!-- G E N E R A L -->
-
-    <prefpane id="aiosGeneral" label="&tab.gen;" flex="1" seltab="0" persist="seltab" onpaneload="aios_initPane('general');">
-
-        <script type="application/x-javascript" src="chrome://aios/content/prefs/general.js"/>
-
-        <preferences>
-            <preference id="sidebarOrient"  type="int"          name="extensions.aios.gen.orient" />
-
-            <preference id="minWidthVal"    type="int"          name="extensions.aios.gen.width.minVal" />
-            <preference id="minWidthUnit"   type="string"       name="extensions.aios.gen.width.minUnit" />
-
-            <preference id="defWidthVal"    type="int"          name="extensions.aios.gen.width.defVal" />
-            <preference id="defWidthUnit"   type="string"       name="extensions.aios.gen.width.defUnit" />
-
-            <preference id="maxWidthVal"    type="int"          name="extensions.aios.gen.width.maxVal" />
-            <preference id="maxWidthUnit"   type="string"       name="extensions.aios.gen.width.maxUnit" />
-
-            <preference id="sidebarInit"    type="string"       name="extensions.aios.gen.init" />
-            <preference id="toolbarInit"    type="int"          name="extensions.aios.gen.toolbar.init" />
-            <preference id="switchInit"     type="int"          name="extensions.aios.gen.switch.init" />
-
-            <preference id="openInit"       type="string"       name="extensions.aios.gen.open.init" />
-
-            <preference id="FSSidebar"      type="bool"         name="extensions.aios.fs.sidebar" />
-            <preference id="FSToolbar"      type="bool"         name="extensions.aios.fs.toolbar" />
-            <preference id="FSSwitch"       type="bool"         name="extensions.aios.fs.switch" />
-            <preference id="FSRestore"      type="bool"         name="extensions.aios.fs.restore" />
-
-            <preference id="SSAutoshow"     type="bool"         name="extensions.aios.gen.switch.autoshow" />
-            <preference id="SSOnlymax"      type="bool"         name="extensions.aios.gen.switch.onlymax" />
-            <preference id="SSDelay"        type="int"          name="extensions.aios.gen.switch.delay" />
-            <preference id="SSHidemethod"   type="int"          name="extensions.aios.gen.switch.hidemethod" />
-            <preference id="SSWidth"        type="int"          name="extensions.aios.gen.switch.width" />
-            <preference id="SSThinWidth"    type="int"          name="extensions.aios.gen.switch.twidth" />
-            <preference id="SSThin"         type="bool"         name="extensions.aios.gen.switch.thin" />
-            <preference id="SSThinMax"      type="bool"         name="extensions.aios.gen.switch.thinmax" />
-
-            <preference id="cmodeKey"       type="int"          name="extensions.aios.cmode.key" />
-            <preference id="cmodeSwitch"    type="int"          name="extensions.aios.cmode.switch" />
-            <preference id="cmodeTbb"       type="int"          name="extensions.aios.cmode.tbb" />
-            <preference id="cmodeClose"     type="int"          name="extensions.aios.cmode.close" />
-
-            <preference id="SBCollapsing"   type="bool"         name="extensions.aios.collapse" />
-        </preferences>
-
-        <tooltip id="minWidthHint" class="labelTipElem">
-            <label value="&gen.width.min.hint;" />
-            <box />
-        </tooltip>
-
-        <tooltip id="defWidthHint" class="labelTipElem">
-            <label value="&gen.width.def.hint;" />
-            <box />
-        </tooltip>
-
-        <tooltip id="maxWidthHint" class="labelTipElem">
-            <label value="&gen.width.max.hint;" />
-            <box />
-        </tooltip>
-
-        <tabbox flex="1" id="aiosTabboxGeneral">
-
-            <tabs onclick="aios_synchTabs(this);">
-                <tab label="&tab.gen.appearance;" />
-                <tab label="&tab.gen.behavior;" />
-                <tab label="&menu.togglebar.label;" />
-            </tabs>
-
-            <tabs onclick="aios_synchTabs(this);" aiosAdvanced="true">
-                <tab label="&tab.gen.appearance;" />
-                <tab label="&tab.gen.behavior;" />
-                <tab label="&menu.togglebar.label;" />
-                <tab label="&tab.gen.special;" class="aiosAdvanced" />
-            </tabs>
-
-            <tabpanels flex="1" id="panelTest">
-
-
-<!-- TAB: Appearance -->
-
-                <tabpanel orient="vertical">
-                    <vbox class="aiosSizeBox">
-
-<!-- Orientation -->
-                        <groupbox>
-                            <caption label="&gen.orient.caption;" />
-
-                            <grid flex="1">
-                                <columns>
-                                    <column style="width:&gen.column1;px;" />
-                                    <column flex="1" />
-                                </columns>
-
-                                <rows>
-
-                                    <row align="center">
-                                        <label value="&gen.orient.label;" />
-
-                                        <menulist preference="sidebarOrient">
-                                            <menupopup>
-                                                <menuitem label="&gen.orient.left;" value="1" />
-                                                <menuitem label="&gen.orient.right;" value="2" />
-                                            </menupopup>
-                                        </menulist>
-                                    </row>
-
-                                </rows>
-                            </grid>
-                        </groupbox>
-
-<!-- Size -->
-                        <groupbox>
-                            <caption label="&gen.width.caption;" />
-
-                            <grid flex="1">
-                                <columns>
-                                    <column style="width:&gen.column1;px;" />
-                                    <column flex="1" />
-                                </columns>
-
-                                <rows>
-
-                                    <row align="center">
-                                        <hbox tooltip="minWidthHint" class="labelTip">
-                                            <label value="&sidebar.width.min;" />
-                                            <spacer flex="1" />
-                                            <toolbarbutton class="info" />
-                                        </hbox>
-
-                                        <hbox>
-                                            <textbox id="obj-minWidthVal" preference="minWidthVal" onblur="aios_checkWidthVal('min');" />
-
-                                            <menulist id="obj-minWidthUnit" preference="minWidthUnit" flex="1">
-                                                <menupopup>
-                                                    <menuitem label="&gen.width.px;" value="px" />
-                                                    <menuitem label="&gen.width.perc;" value="%" />
-                                                </menupopup>
-                                            </menulist>
-
-                                            <toolbarbutton label="&gen.width.current;" tooltiptext="&gen.width.current.tip;"
-                                                oncommand="aios_setWidthVal('min');" class="arrow-lft" />
-                                        </hbox>
-                                    </row>
-
-                                    <row align="center">
-                                        <hbox tooltip="defWidthHint" class="labelTip">
-                                            <label value="&sidebar.width.def;" />
-                                            <spacer flex="1" />
-                                            <toolbarbutton class="info" />
-                                        </hbox>
-
-                                        <hbox>
-                                            <textbox id="obj-defWidthVal" preference="defWidthVal" onblur="aios_checkWidthVal('def');" />
-
-                                            <menulist id="obj-defWidthUnit" preference="defWidthUnit" flex="1">
-                                                <menupopup>
-                                                    <menuitem label="&gen.width.px;" value="px" />
-                                                    <menuitem label="&gen.width.perc;" value="%" />
-                                                </menupopup>
-                                            </menulist>
-
-                                            <toolbarbutton label="&gen.width.current;" tooltiptext="&gen.width.current.tip;"
-                                                oncommand="aios_setWidthVal('def');" class="arrow-lft" />
-                                        </hbox>
-                                    </row>
-
-                                    <row align="center">
-                                        <hbox tooltip="maxWidthHint" class="labelTip">
-                                            <label value="&sidebar.width.max;" />
-                                            <spacer flex="1" />
-                                            <toolbarbutton class="info" />
-                                        </hbox>
-
-                                        <hbox>
-                                            <textbox id="obj-maxWidthVal" preference="maxWidthVal" onblur="aios_checkWidthVal('max');" />
-
-                                            <menulist id="obj-maxWidthUnit" preference="maxWidthUnit" flex="1">
-                                                <menupopup>
-                                                    <menuitem label="&gen.width.px;" value="px" />
-                                                    <menuitem label="&gen.width.perc;" value="%" />
-                                                </menupopup>
-                                            </menulist>
-
-                                            <toolbarbutton label="&gen.width.current;" tooltiptext="&gen.width.current.tip;"
-                                                oncommand="aios_setWidthVal('max');" class="arrow-lft" />
-                                        </hbox>
-
-                                    </row>
-
-                                </rows>
-                            </grid>
-                        </groupbox>
-
-                    </vbox>
-
-                </tabpanel>
-
-
-
-<!-- TAB: Behavior -->
-
-                <tabpanel orient="vertical">
-                    <vbox class="aiosSizeBox">
-
-<!-- Startup -->
-
-                        <groupbox>
-                            <caption label="&gen.init.caption;" />
-
-                            <grid flex="1">
-                                <columns>
-                                    <column style="width:&gen.column1;px;" />
-                                    <column flex="1" />
-                                </columns>
-
-                                <rows>
-
-                                    <row align="center">
-                                        <label value="&gen.init.label;" />
-
-                                        <menulist preference="sidebarInit">
-                                            <menupopup id="sidebarInitPopup">
-                                                <menuitem label="&gen.init.mode1;" value="rem" />
-                                                <menuitem label="&sidebar.open.label;" value="open" />
-                                                <menuitem label="&sidebar.close.label;" value="close" />
-                                            </menupopup>
-                                        </menulist>
-
-                                    </row>
-
-                                    <row align="center">
-                                        <label value="&gen.init.toolbar.label;" />
-
-                                        <menulist preference="toolbarInit">
-                                            <menupopup>
-                                                <menuitem label="&gen.init.mode1;" value="2" />
-                                                <menuitem label="&gen.init.toolbar.show.label;" value="1" />
-                                                <menuitem label="&gen.init.toolbar.hide.label;" value="0" />
-                                            </menupopup>
-                                        </menulist>
-
-                                    </row>
-
-                                    <row align="center" aiosAdvanced="true">
-                                        <label value="&menu.togglebar.label;" />
-
-                                        <menulist preference="switchInit">
-                                            <menupopup>
-                                                <menuitem label="&gen.init.mode1;" value="2" />
-                                                <menuitem label="&gen.init.switch.show.label;" value="1" />
-                                                <menuitem label="&gen.init.switch.hide.label;" value="0" />
-                                            </menupopup>
-                                        </menulist>
-
-                                    </row>
-
-                                </rows>
-                            </grid>
-                        </groupbox>
-
-<!-- Open Sidebar -->
-
-                        <groupbox aiosAdvanced="true">
-                            <caption label="&gen.init.sidebar;" />
-
-                            <grid flex="1">
-                                <columns>
-                                    <column style="width:&gen.column1;px;" />
-                                    <column flex="1" />
-                                </columns>
-
-                                <rows>
-
-                                    <row align="center">
-                                        <label value="&tab.gen.behavior;" />
-
-                                        <menulist preference="openInit">
-                                            <menupopup id="panelInitPopup">
-                                                <menuitem label="&gen.init.sidebar.restore;" value="rem" />
-                                            </menupopup>
-                                        </menulist>
-
-                                    </row>
-
-                                </rows>
-                            </grid>
-                        </groupbox>
-
-<!-- Fullscreen Mode -->
-
-                        <groupbox id="fullscreenGroupbox">
-                            <caption label="&tab.gen.fullscreen;" />
-
-                            <checkbox preference="FSSidebar" label="&sidebar.close.label;" />
-                            <checkbox preference="FSToolbar" label="&gen.init.toolbar.hide.label;" />
-                            <checkbox preference="FSSwitch" label="&gen.init.switch.hide.label;" aiosAdvanced="true" />
-                            <checkbox preference="FSRestore" label="&gen.fs.off;" aiosAdvanced="true" />
-
-                        </groupbox>
-
-                    </vbox>
-                </tabpanel>
-
-
-
-<!-- TAB: Sidebar-Switch -->
-
-                <tabpanel orient="vertical">
-                    <vbox class="aiosSizeBox">
-
-<!-- Behavior -->
-                        <groupbox>
-                            <caption label="&tab.gen.behavior;" />
-
-                            <checkbox label="&gen.switch.autoshow;" preference="SSAutoshow"
-                                oncommand="aios_checkboxObserver(this);" aiosChilds="SSOnlymax,SSDelay,SSHidemethod1,SSHidemethod2" />
-
-                            <vbox class="indent">
-                                <checkbox label="&gen.switch.onlymax;" preference="SSOnlymax" />
-
-                                <hbox align="center" style="margin-top: 5px;">
-                                    <label value="&gen.switch.delay;:" />
-                                    <textbox preference="SSDelay" size="2" />
-                                    <label value="&gen.switch.delayUnit;" />
-                                </hbox>
-
-                                <vbox style="margin-top: 5px;" aiosAdvanced="true">
-                                    <label value="&gen.switch.hide;" />
-
-                                    <radiogroup class="indent" preference="SSHidemethod">
-                                        <radio id="SSHidemethod1" label="&gen.switch.hideBar;" value="1" />
-                                        <radio id="SSHidemethod2" label="&gen.switch.hidePage;" value="2" />
-                                    </radiogroup>
-
-                                </vbox>
-                            </vbox>
-
-                        </groupbox>
-
-<!-- Appearance -->
-
-                        <groupbox>
-                            <caption label="&tab.gen.appearance;" />
-
-                            <checkbox preference="SSThin" label="&gen.switch.thin;"
-                                oncommand="aios_checkboxObserver(this);" aiosChilds="SSThinMax" />
-
-                            <vbox class="indent">
-                                <checkbox preference="SSThinMax" label="&gen.switch.onlymax;" />
-                            </vbox>
-
-                            <grid flex="1" aiosAdvanced="true" style="margin-top: 5px;">
-                                <columns>
-                                    <column />
-                                    <column />
-                                </columns>
-
-                                <rows>
-
-                                    <row align="center" class="aiosAdvanced">
-                                        <label value="&gen.switch.width;:" />
-
-                                        <hbox align="center">
-                                            <textbox preference="SSWidth" size="1" />
-                                            <label value="&gen.width.px;" />
-                                        </hbox>
-                                    </row>
-
-                                    <row align="center" class="aiosAdvanced">
-                                        <label value="&gen.switch.twidth;:" />
-
-                                        <hbox align="center">
-                                            <textbox preference="SSThinWidth" size="1" />
-                                            <label value="&gen.width.px;" />
-                                        </hbox>
-                                    </row>
-
-                                </rows>
-                            </grid>
-
-                        </groupbox>
-
-            <!-- Fix fuer die Hoehe des Shortcut-Panels => sonst wird die letzte Textzeile "Tipp: ...keyconfig..." abgeschnitten -->
-                        <description style="visibility:hidden;">.</description>
-
-                    </vbox>
-
-                </tabpanel>
-
-
-<!-- TAB: Special -->
-
-                <tabpanel orient="vertical">
-                    <vbox aiosAdvanced="true">
-
-<!-- Open/Close Sidebar -->
-
-                        <groupbox aiosAdvanced="true">
-                            <caption label="&cmode.caption;" />
-
-                            <hbox>
-                                <description width="100%" flex="1" align="center">&cmode.desc;</description>
-
-                                <toolbarbutton style="float:right;" class="labelTip info" tooltiptext="&misc.enablelink.tooltip;"
-                                    oncommand="aios_addTab('http://firefox.exxile.net/aios/faq.php#operabehav');" />
-                            </hbox>
-
-                            <grid flex="1">
-                                <columns>
-                                    <column style="width:&gen.column1;px;" />
-                                    <column flex="1" />
-                                </columns>
-
-                                <rows>
-
-                                    <row align="center">
-                                        <label value="&cmode.key.label;" />
-
-                                        <menulist preference="cmodeKey">
-                                            <menupopup>
-                                                <menuitem label="&cmode.mode1.label;" value="1" />
-                                                <menuitem label="&cmode.mode2.label;" value="2" />
-                                                <menuitem label="&cmode.mode3.label;" value="3" />
-                                                <menuitem label="&cmode.mode4.label;" value="4" />
-                                            </menupopup>
-                                        </menulist>
-
-                                    </row>
-
-                                    <row align="center">
-                                        <label value="&menu.togglebar.label;" />
-
-                                        <menulist preference="cmodeSwitch">
-                                            <menupopup>
-                                                <menuitem label="&cmode.mode1.label;" value="1" />
-                                                <menuitem label="&cmode.mode2.label;" value="2" />
-                                                <menuitem label="&cmode.mode3.label;" value="3" />
-                                                <menuitem label="&cmode.mode4.label;" value="4" />
-                                            </menupopup>
-                                        </menulist>
-
-                                    </row>
-
-                                    <row align="center">
-                                        <label value="&cmode.tbb.label;" />
-
-                                        <menulist preference="cmodeTbb">
-                                            <menupopup>
-                                                <menuitem label="&cmode.mode1.label;" value="1" />
-                                                <menuitem label="&cmode.mode2.label;" value="2" />
-                                                <menuitem label="&cmode.mode3.label;" value="3" />
-                                                <menuitem label="&cmode.mode4.label;" value="4" />
-                                            </menupopup>
-                                        </menulist>
-
-                                    </row>
-
-                                    <row align="center">
-                                        <label value="&cmode.close.label;" />
-
-                                        <menulist preference="cmodeClose">
-                                            <menupopup>
-                                                <menuitem label="&cmode.mode1.label;" value="1" />
-                                                <menuitem label="&cmode.mode2.label;" value="2" />
-                                                <menuitem label="&cmode.mode3.label;" value="3" />
-                                            </menupopup>
-                                        </menulist>
-
-                                    </row>
-
-                                </rows>
-                            </grid>
-                        </groupbox>
-
-<!-- Sidebar Collapsing -->
-
-                        <groupbox>
-
-                            <caption label="&special.collapsing.caption; *" />
-
-                            <hbox>
-                                <description width="100%" flex="1" align="center">&special.collapsing.desc;</description>
-
-                                <toolbarbutton style="float:right;" class="labelTip info" tooltiptext="&misc.enablelink.tooltip;"
-                                    oncommand="aios_addTab('http://firefox.exxile.net/aios/faq.php#collapsing');" />
-                            </hbox>
-
-                            <checkbox id="obj-SBCollapsing" preference="SBCollapsing" label="&special.collapsing.label;" flex="1" />
-
-                        </groupbox>
-
-                    </vbox>
-
-                    <spacer flex="1" />
-                    <description value="* &keyconfig.warn;" style="margin-top: 10px;" />
-                </tabpanel>
-
-            </tabpanels>
-
-        </tabbox>
-    </prefpane>
-
-
-<!-- P A N E L S -->
-
-    <prefpane id="aiosPanels" label="&tab.panels;" flex="1" seltab="0" persist="seltab" onpaneload="aios_initPane('panels');">
-        <preferences>
-            <preference id="DMOpen"         type="bool"     name="extensions.aios.dm.sidebar" />
-            <preference id="DMLayout"       type="bool"     name="extensions.aios.dm.layout" />
-            <preference id="DMAutoOpen"     type="bool"     name="extensions.aios.dm.autoopen" />
-            <preference id="DMAutoClose"    type="bool"     name="extensions.aios.dm.autoclose" />
-            <preference id="DMCount"        type="bool"     name="extensions.aios.dm.count" />
-
-            <preference id="EMOpen"         type="bool"     name="extensions.aios.em.sidebar" />
-            <preference id="EMCount"        type="bool"     name="extensions.aios.em.count" />
-
-            <preference id="BMOpen"         type="bool"     name="extensions.aios.bm.sidebar" />
-            <preference id="HIOpen"         type="bool"     name="extensions.aios.hi.sidebar" />
-            <preference id="PIOpen"         type="bool"     name="extensions.aios.pi.sidebar" />
-            <preference id="PILayout"       type="bool"     name="extensions.aios.pi.layout" />
-
-            <preference id="MPOpen"         type="bool"     name="extensions.aios.mp.sidebar" />
-            <preference id="COOpen"         type="bool"     name="extensions.aios.co.sidebar" />
-            <preference id="COLayout"       type="bool"     name="extensions.aios.co.layout" />
-
-            <preference id="PanelTabReverse"    type="bool"     name="extensions.aios.paneltab.reverse" />
-            <preference id="PanelTabBMM"    type="bool"     name="extensions.aios.paneltab.bm" />
-        </preferences>
-
-        <tabbox flex="1" id="aiosTabboxPanels">
-
-            <tabs onclick="aios_synchTabs(this);">
-                <tab label="&tab.panels.places;" />
-                <tab label="&downloads.label;" />
-                <tab label="&button.addons.label;" />
-                <tab label="&tab.panels.other1;" />
-                <tab label="&tab.panels.other2;" />
-            </tabs>
-
-            <tabs onclick="aios_synchTabs(this);" aiosAdvanced="true">
-                <tab label="&tab.panels.places;" />
-                <tab label="&downloads.label;" />
-                <tab label="&button.addons.label;" />
-                <tab label="&tab.panels.other1;" />
-                <tab label="&tab.panels.other2;" />
-                <tab label="&tab.panels.paneltab;" class="aiosAdvanced" />
-            </tabs>
-
-            <tabpanels flex="1">
-
-
-<!-- TAB: Bookmarks/History -->
-
-                <tabpanel orient="vertical">
-                    <vbox class="aiosSizeBox" restart="true">
-
-                        <groupbox>
-                            <caption label="&bookmarksButton.label;" />
-                            <checkbox preference="BMOpen" label="&misc.enablesidebar.label; *" oncommand="aios_checkboxObserver(this);" />
-                        </groupbox>
-
-                        <groupbox>
-                            <caption label="&historyButton.label;" />
-                            <checkbox preference="HIOpen" label="&misc.enablesidebar.label; *" oncommand="aios_checkboxObserver(this);" />
-                        </groupbox>
-
-                    </vbox>
-
-                    <spacer flex="1" />
-                    <description value="* &restart;" style="margin-top: 10px;" />
-
-                </tabpanel>
-
-
-<!-- TAB: Downloads -->
-
-                <tabpanel orient="vertical">
-                    <vbox class="aiosSizeBox" restart="true">
-
-                        <groupbox>
-                            <caption label="&tab.gen.behavior;" />
-                            <checkbox preference="DMOpen" label="&misc.enablesidebar.label; *" aiosChilds="DMLayout, DMAutoOpen, DMAutoClose" oncommand="aios_checkboxObserver(this);" />
-
-<!--
-                            <vbox class="indent">
-                                <checkbox preference="DMAutoOpen" label="&misc.dm.autoopen.label;" aiosChilds="DMAutoClose" oncommand="aios_checkboxObserver(this);" />
-                                <vbox class="indent">
-                                    <checkbox preference="DMAutoClose" label="&misc.dm.autoclose.label;" />
-                                </vbox>
-                            </vbox>
-
-                            <vbox class="indent spacer" aiosAdvanced="true">
-                                <checkbox preference="DMLayout" label="&misc.layout.label;" />
-                            </vbox>
--->
-                        </groupbox>
-
-<!--
-                        <groupbox>
-                            <caption label="&tab.gen.appearance;" />
-                            <checkbox preference="DMCount" label="&misc.count.label;" />
-                        </groupbox>
--->
-                    </vbox>
-
-                    <spacer flex="1" />
-                    <description value="* &restart;" style="margin-top: 10px;" />
-
-                </tabpanel>
-
-
-<!-- TAB: Add-ons -->
-
-                <tabpanel orient="vertical">
-                    <vbox class="aiosSizeBox" restart="true">
-
-                        <groupbox>
-                            <caption label="&tab.gen.behavior;" />
-                            <checkbox preference="EMOpen" label="&misc.enablesidebar.label; *" oncommand="aios_checkboxObserver(this);" />
-                        </groupbox>
-
-                        <groupbox>
-                            <caption label="&tab.gen.appearance;" />
-                            <checkbox preference="EMCount" label="&misc.count.label;" />
-                        </groupbox>
-
-                    </vbox>
-
-                    <spacer flex="1" />
-                    <description value="* &restart;" style="margin-top: 10px;" />
-
-                </tabpanel>
-
-
-<!-- TAB: Andere I -->
-
-                <tabpanel orient="vertical">
-                    <vbox class="aiosSizeBox" restart="true">
-
-                        <groupbox>
-                            <caption label="&button.multipanel.label;" />
-                            <checkbox preference="MPOpen" label="&misc.enablesidebar.label; *" />
-                        </groupbox>
-
-                        <groupbox>
-                            <caption label="&pageInfoCmd.label;" />
-                            <checkbox preference="PIOpen" label="&misc.enablesidebar.label; *" aiosChilds="PILayout" oncommand="aios_checkboxObserver(this);" />
-
-                            <vbox class="indent" aiosAdvanced="true">
-                                <checkbox id="obj-PILayout" preference="PILayout" label="&misc.layout.label;" />
-                            </vbox>
-                        </groupbox>
-
-                    </vbox>
-
-                    <spacer flex="1" />
-                    <description value="* &restart;" style="margin-top: 10px;" />
-
-                </tabpanel>
-
-
-<!-- TAB: Andere II -->
-
-                <tabpanel orient="vertical">
-                    <vbox class="aiosSizeBox" restart="true">
-
-                        <groupbox>
-                            <caption label="&button.console.label;" />
-                            <checkbox preference="COOpen" label="&misc.enablesidebar.label; *" aiosChilds="COLayout" oncommand="aios_checkboxObserver(this);" />
-
-                            <vbox class="indent" aiosAdvanced="true">
-                                <checkbox preference="COLayout" label="&misc.layout.label;" />
-                            </vbox>
-                        </groupbox>
-
-                    </vbox>
-
-                    <spacer flex="1" />
-                    <description value="* &restart;" style="margin-top: 10px;" />
-
-                </tabpanel>
-
-
-<!-- TAB: PanelTab -->
-
-                <tabpanel orient="vertical">
-                    <vbox class="aiosSizeBox">
-
-<!-- Bookmarks - PanelTab -->
-
-                        <groupbox aiosAdvanced="true">
-                            <caption label="&tab.gen.behavior;" />
-                            <checkbox preference="PanelTabReverse" label="&misc.paneltab.reverse;" />
-                        </groupbox>
-
-                        <groupbox aiosAdvanced="true">
-                            <caption label="&bookmarksButton.label;" />
-
-                            <description width="100%">&misc.bm.paneltab.desc;</description>
-                            <checkbox preference="PanelTabBMM" label="&misc.bm.paneltab;" />
-                        </groupbox>
-
-                    </vbox>
-                </tabpanel>
-
-            </tabpanels>
-        </tabbox>
-    </prefpane>
-
-
-<!-- M E N U S -->
-
-    <prefpane id="aiosMenus" label="&tab.menus;" flex="1" seltab="0" persist="seltab" onpaneload="aios_initPane('menus');">
-        <preferences>
-            <preference id="SBEntryDeac"    type="bool"     name="extensions.aios.menus.sidebar.entrydeac" />
-            <preference id="SBEntries"      type="bool"     name="extensions.aios.menus.sidebar.entries" />
-            <preference id="SBIcons"        type="bool"     name="extensions.aios.menus.sidebar.icons" />
-            <preference id="SBPanelTab1"    type="bool"     name="extensions.aios.menus.sidebar.paneltab1" />
-            <preference id="SBPanelTab2"    type="bool"     name="extensions.aios.menus.sidebar.paneltab2" />
-            <preference id="SBShowHide"     type="bool"     name="extensions.aios.menus.sidebar.showhide" />
-            <preference id="SBOptions"      type="bool"     name="extensions.aios.menus.sidebar.prefs" />
-        </preferences>
-
-        <tabbox flex="1" id="aiosTabboxMenus">
-
-            <tabs onclick="aios_synchTabs(this);">
-                <tab label="&tab.menus.sidebar;" />
-            </tabs>
-
-            <tabpanels flex="1">
-
-
-<!-- TAB: Sidebar -->
-
-                <tabpanel orient="vertical">
-                    <vbox class="aiosSizeBox">
-
-                        <description width="100%">&menus.sidebar.desc;</description>
-
-                        <checkbox preference="SBEntryDeac" label="&menus.sidebar.entrydeac;" aiosAdvanced="true" />
-
-                        <groupbox>
-                            <caption>
-                                <checkbox preference="SBEntries" label="&menus.entries.label;" oncommand="aios_checkboxObserver(this);"
-                                    aiosChilds="SBIcons, SBPanelTab1, SBPanelTab2, SBShowHide, SBOptions" />
-                            </caption>
-
-                            <vbox class="indent">
-
-                                <vbox aiosAdvanced="true">
-                                    <checkbox preference="SBIcons" label="&menus.icons.label;" />
-                                    <separator class="groove" />
-                                </vbox>
-
-                                <checkbox preference="SBPanelTab1" label="&button.paneltab.menu1.label;" />
-                                <checkbox preference="SBPanelTab2" label="&button.paneltab.menu2.label;" />
-                                <checkbox preference="SBShowHide" label="&sidebar.open.label;/&sidebar.close.label;" />
-                                <checkbox preference="SBOptions" label="&menu.prefs.label;" />
-                            </vbox>
-
-                        </groupbox>
-
-                    </vbox>
-                </tabpanel>
-
-            </tabpanels>
-        </tabbox>
-    </prefpane>
-
-
-<!-- S H O R T C U T S -->
-
-    <prefpane id="aiosKeys" label="&tab.keys;" flex="1" src="chrome://aios/content/prefs/keys.xul" />
-
-
-<!-- A B O U T -->
-
-    <prefpane id="aiosAbout" label="&tab.about;" flex="1" src="chrome://aios/content/about_content.xul" />
-
+<?xml version="1.0"?>
+
+<!-- skin -->
+<?xml-stylesheet href="chrome://global/skin/global.css"?>
+<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
+<?xml-stylesheet href="chrome://aios/skin/css/prefs.css"?>
+
+<!-- locale -->
+<!DOCTYPE prefwindow [
+    <!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd"> %browserDTD;
+
+    <!ENTITY % commonDTD SYSTEM "chrome://aios/content/aios.dtd"> %commonDTD;
+    <!ENTITY % prefsDTD SYSTEM "chrome://aios/locale/prefs.dtd"> %prefsDTD;
+    <!ENTITY % aiosDTD SYSTEM "chrome://aios/locale/aios.dtd"> %aiosDTD;
+    <!ENTITY % webpanelDTD SYSTEM "chrome://aios/locale/webpanel.dtd"> %webpanelDTD;
+]>
+
+<prefwindow id="aiosPreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+    title = "&title;"
+    persist = "screenX screenY"
+    buttons = "accept,cancel,extra2,extra1,disclosure"
+    style = "min-width: 45em; max-width: 780px;"
+    buttonlabelextra2 = "&settings;"
+    buttonlabelextra1 = "&apply;"
+
+    onload = "aios_initPrefs();"
+    ondialogaccept = "aios_savePrefs();"
+    ondialogextra1 = "aios_applyPrefs();"
+    ondialogdisclosure = "aios_addTab('http://firefox.exxile.net/aios/faq.php');">
+
+    <box>
+
+        <script type="application/x-javascript" src="chrome://aios/content/_helper.js" />
+        <script type="application/x-javascript" src="chrome://aios/content/prefs/prefs.js" />
+
+        <stringbundleset>
+            <stringbundle id="aiosStrings" src="chrome://aios/locale/lib.properties" />
+        </stringbundleset>
+
+        <popupset>
+            <menupopup id="aios-settings-popup" position="before_start">
+                <menuitem id="aios-defaults" label="&settings.default;" oncommand="aios_defaultSettings();" />
+                <menuitem id="aios-advanced" label="&settings.advanced;" class="aiosAdvanced" type="checkbox"
+                    autoCheck="false" persist="checked" oncommand="aios_advancedMode(true);" />
+
+                <menuseparator />
+
+                <menuitem id="aios-export" label="&settings.export;" oncommand="aios_exportSettings('save');" />
+                <menuitem id="aios-import" label="&settings.import;" oncommand="aios_importSettings();" />
+                <menuitem id="aios-copy" label="&settings.copy;" oncommand="aios_exportSettings('copy');" />
+            </menupopup>
+        </popupset>
+
+    </box>
+
+
+<!-- G E N E R A L -->
+
+    <prefpane id="aiosGeneral" label="&tab.gen;" flex="1" seltab="0" persist="seltab" onpaneload="aios_initPane('general');">
+
+        <script type="application/x-javascript" src="chrome://aios/content/prefs/general.js"/>
+
+        <preferences>
+            <preference id="sidebarOrient"  type="int"          name="extensions.aios.gen.orient" />
+
+            <preference id="minWidthVal"    type="int"          name="extensions.aios.gen.width.minVal" />
+            <preference id="minWidthUnit"   type="string"       name="extensions.aios.gen.width.minUnit" />
+
+            <preference id="defWidthVal"    type="int"          name="extensions.aios.gen.width.defVal" />
+            <preference id="defWidthUnit"   type="string"       name="extensions.aios.gen.width.defUnit" />
+
+            <preference id="maxWidthVal"    type="int"          name="extensions.aios.gen.width.maxVal" />
+            <preference id="maxWidthUnit"   type="string"       name="extensions.aios.gen.width.maxUnit" />
+
+            <preference id="sidebarInit"    type="string"       name="extensions.aios.gen.init" />
+            <preference id="toolbarInit"    type="int"          name="extensions.aios.gen.toolbar.init" />
+            <preference id="switchInit"     type="int"          name="extensions.aios.gen.switch.init" />
+
+            <preference id="openInit"       type="string"       name="extensions.aios.gen.open.init" />
+
+            <preference id="FSSidebar"      type="bool"         name="extensions.aios.fs.sidebar" />
+            <preference id="FSToolbar"      type="bool"         name="extensions.aios.fs.toolbar" />
+            <preference id="FSSwitch"       type="bool"         name="extensions.aios.fs.switch" />
+            <preference id="FSRestore"      type="bool"         name="extensions.aios.fs.restore" />
+
+            <preference id="SSAutoshow"     type="bool"         name="extensions.aios.gen.switch.autoshow" />
+            <preference id="SSOnlymax"      type="bool"         name="extensions.aios.gen.switch.onlymax" />
+            <preference id="SSDelay"        type="int"          name="extensions.aios.gen.switch.delay" />
+            <preference id="SSHidemethod"   type="int"          name="extensions.aios.gen.switch.hidemethod" />
+            <preference id="SSWidth"        type="int"          name="extensions.aios.gen.switch.width" />
+            <preference id="SSThinWidth"    type="int"          name="extensions.aios.gen.switch.twidth" />
+            <preference id="SSThin"         type="bool"         name="extensions.aios.gen.switch.thin" />
+            <preference id="SSThinMax"      type="bool"         name="extensions.aios.gen.switch.thinmax" />
+
+            <preference id="cmodeKey"       type="int"          name="extensions.aios.cmode.key" />
+            <preference id="cmodeSwitch"    type="int"          name="extensions.aios.cmode.switch" />
+            <preference id="cmodeTbb"       type="int"          name="extensions.aios.cmode.tbb" />
+            <preference id="cmodeClose"     type="int"          name="extensions.aios.cmode.close" />
+
+            <preference id="SBCollapsing"   type="bool"         name="extensions.aios.collapse" />
+        </preferences>
+
+        <tooltip id="minWidthHint" class="labelTipElem">
+            <label value="&gen.width.min.hint;" />
+            <box />
+        </tooltip>
+
+        <tooltip id="defWidthHint" class="labelTipElem">
+            <label value="&gen.width.def.hint;" />
+            <box />
+        </tooltip>
+
+        <tooltip id="maxWidthHint" class="labelTipElem">
+            <label value="&gen.width.max.hint;" />
+            <box />
+        </tooltip>
+
+        <tabbox flex="1" id="aiosTabboxGeneral">
+
+            <tabs onclick="aios_synchTabs(this);">
+                <tab label="&tab.gen.appearance;" />
+                <tab label="&tab.gen.behavior;" />
+                <tab label="&menu.togglebar.label;" />
+            </tabs>
+
+            <tabs onclick="aios_synchTabs(this);" aiosAdvanced="true">
+                <tab label="&tab.gen.appearance;" />
+                <tab label="&tab.gen.behavior;" />
+                <tab label="&menu.togglebar.label;" />
+                <tab label="&tab.gen.special;" class="aiosAdvanced" />
+            </tabs>
+
+            <tabpanels flex="1" id="panelTest">
+
+
+<!-- TAB: Appearance -->
+
+                <tabpanel orient="vertical">
+                    <vbox class="aiosSizeBox">
+
+<!-- Orientation -->
+                        <groupbox>
+                            <caption label="&gen.orient.caption;" />
+
+                            <grid flex="1">
+                                <columns>
+                                    <column style="width:&gen.column1;px;" />
+                                    <column flex="1" />
+                                </columns>
+
+                                <rows>
+
+                                    <row align="center">
+                                        <label value="&gen.orient.label;" />
+
+                                        <menulist preference="sidebarOrient">
+                                            <menupopup>
+                                                <menuitem label="&gen.orient.left;" value="1" />
+                                                <menuitem label="&gen.orient.right;" value="2" />
+                                            </menupopup>
+                                        </menulist>
+                                    </row>
+
+                                </rows>
+                            </grid>
+                        </groupbox>
+
+<!-- Size -->
+                        <groupbox>
+                            <caption label="&gen.width.caption;" />
+
+                            <grid flex="1">
+                                <columns>
+                                    <column style="width:&gen.column1;px;" />
+                                    <column flex="1" />
+                                </columns>
+
+                                <rows>
+
+                                    <row align="center">
+                                        <hbox tooltip="minWidthHint" class="labelTip">
+                                            <label value="&sidebar.width.min;" />
+                                            <spacer flex="1" />
+                                            <toolbarbutton class="info" />
+                                        </hbox>
+
+                                        <hbox>
+                                            <textbox id="obj-minWidthVal" preference="minWidthVal" onblur="aios_checkWidthVal('min');" />
+
+                                            <menulist id="obj-minWidthUnit" preference="minWidthUnit" flex="1">
+                                                <menupopup>
+                                                    <menuitem label="&gen.width.px;" value="px" />
+                                                    <menuitem label="&gen.width.perc;" value="%" />
+                                                </menupopup>
+                                            </menulist>
+
+                                            <toolbarbutton label="&gen.width.current;" tooltiptext="&gen.width.current.tip;"
+                                                oncommand="aios_setWidthVal('min');" class="arrow-lft" />
+                                        </hbox>
+                                    </row>
+
+                                    <row align="center">
+                                        <hbox tooltip="defWidthHint" class="labelTip">
+                                            <label value="&sidebar.width.def;" />
+                                            <spacer flex="1" />
+                                            <toolbarbutton class="info" />
+                                        </hbox>
+
+                                        <hbox>
+                                            <textbox id="obj-defWidthVal" preference="defWidthVal" onblur="aios_checkWidthVal('def');" />
+
+                                            <menulist id="obj-defWidthUnit" preference="defWidthUnit" flex="1">
+                                                <menupopup>
+                                                    <menuitem label="&gen.width.px;" value="px" />
+                                                    <menuitem label="&gen.width.perc;" value="%" />
+                                                </menupopup>
+                                            </menulist>
+
+                                            <toolbarbutton label="&gen.width.current;" tooltiptext="&gen.width.current.tip;"
+                                                oncommand="aios_setWidthVal('def');" class="arrow-lft" />
+                                        </hbox>
+                                    </row>
+
+                                    <row align="center">
+                                        <hbox tooltip="maxWidthHint" class="labelTip">
+                                            <label value="&sidebar.width.max;" />
+                                            <spacer flex="1" />
+                                            <toolbarbutton class="info" />
+                                        </hbox>
+
+                                        <hbox>
+                                            <textbox id="obj-maxWidthVal" preference="maxWidthVal" onblur="aios_checkWidthVal('max');" />
+
+                                            <menulist id="obj-maxWidthUnit" preference="maxWidthUnit" flex="1">
+                                                <menupopup>
+                                                    <menuitem label="&gen.width.px;" value="px" />
+                                                    <menuitem label="&gen.width.perc;" value="%" />
+                                                </menupopup>
+                                            </menulist>
+
+                                            <toolbarbutton label="&gen.width.current;" tooltiptext="&gen.width.current.tip;"
+                                                oncommand="aios_setWidthVal('max');" class="arrow-lft" />
+                                        </hbox>
+
+                                    </row>
+
+                                </rows>
+                            </grid>
+                        </groupbox>
+
+                    </vbox>
+
+                </tabpanel>
+
+
+
+<!-- TAB: Behavior -->
+
+                <tabpanel orient="vertical">
+                    <vbox class="aiosSizeBox">
+
+<!-- Startup -->
+
+                        <groupbox>
+                            <caption label="&gen.init.caption;" />
+
+                            <grid flex="1">
+                                <columns>
+                                    <column style="width:&gen.column1;px;" />
+                                    <column flex="1" />
+                                </columns>
+
+                                <rows>
+
+                                    <row align="center">
+                                        <label value="&gen.init.label;" />
+
+                                        <menulist preference="sidebarInit">
+                                            <menupopup id="sidebarInitPopup">
+                                                <menuitem label="&gen.init.mode1;" value="rem" />
+                                                <menuitem label="&sidebar.open.label;" value="open" />
+                                                <menuitem label="&sidebar.close.label;" value="close" />
+                                            </menupopup>
+                                        </menulist>
+
+                                    </row>
+
+                                    <row align="center">
+                                        <label value="&gen.init.toolbar.label;" />
+
+                                        <menulist preference="toolbarInit">
+                                            <menupopup>
+                                                <menuitem label="&gen.init.mode1;" value="2" />
+                                                <menuitem label="&gen.init.toolbar.show.label;" value="1" />
+                                                <menuitem label="&gen.init.toolbar.hide.label;" value="0" />
+                                            </menupopup>
+                                        </menulist>
+
+                                    </row>
+
+                                    <row align="center" aiosAdvanced="true">
+                                        <label value="&menu.togglebar.label;" />
+
+                                        <menulist preference="switchInit">
+                                            <menupopup>
+                                                <menuitem label="&gen.init.mode1;" value="2" />
+                                                <menuitem label="&gen.init.switch.show.label;" value="1" />
+                                                <menuitem label="&gen.init.switch.hide.label;" value="0" />
+                                            </menupopup>
+                                        </menulist>
+
+                                    </row>
+
+                                </rows>
+                            </grid>
+                        </groupbox>
+
+<!-- Open Sidebar -->
+
+                        <groupbox aiosAdvanced="true">
+                            <caption label="&gen.init.sidebar;" />
+
+                            <grid flex="1">
+                                <columns>
+                                    <column style="width:&gen.column1;px;" />
+                                    <column flex="1" />
+                                </columns>
+
+                                <rows>
+
+                                    <row align="center">
+                                        <label value="&tab.gen.behavior;" />
+
+                                        <menulist preference="openInit">
+                                            <menupopup id="panelInitPopup">
+                                                <menuitem label="&gen.init.sidebar.restore;" value="rem" />
+                                            </menupopup>
+                                        </menulist>
+
+                                    </row>
+
+                                </rows>
+                            </grid>
+                        </groupbox>
+
+<!-- Fullscreen Mode -->
+
+                        <groupbox id="fullscreenGroupbox">
+                            <caption label="&tab.gen.fullscreen;" />
+
+                            <checkbox preference="FSSidebar" label="&sidebar.close.label;" />
+                            <checkbox preference="FSToolbar" label="&gen.init.toolbar.hide.label;" />
+                            <checkbox preference="FSSwitch" label="&gen.init.switch.hide.label;" aiosAdvanced="true" />
+                            <checkbox preference="FSRestore" label="&gen.fs.off;" aiosAdvanced="true" />
+
+                        </groupbox>
+
+                    </vbox>
+                </tabpanel>
+
+
+
+<!-- TAB: Sidebar-Switch -->
+
+                <tabpanel orient="vertical">
+                    <vbox class="aiosSizeBox">
+
+<!-- Behavior -->
+                        <groupbox>
+                            <caption label="&tab.gen.behavior;" />
+
+                            <checkbox label="&gen.switch.autoshow;" preference="SSAutoshow"
+                                oncommand="aios_checkboxObserver(this);" aiosChilds="SSOnlymax,SSDelay,SSHidemethod1,SSHidemethod2" />
+
+                            <vbox class="indent">
+                                <checkbox label="&gen.switch.onlymax;" preference="SSOnlymax" />
+
+                                <hbox align="center" style="margin-top: 5px;">
+                                    <label value="&gen.switch.delay;:" />
+                                    <textbox preference="SSDelay" size="2" />
+                                    <label value="&gen.switch.delayUnit;" />
+                                </hbox>
+
+                                <vbox style="margin-top: 5px;" aiosAdvanced="true">
+                                    <label value="&gen.switch.hide;" />
+
+                                    <radiogroup class="indent" preference="SSHidemethod">
+                                        <radio id="SSHidemethod1" label="&gen.switch.hideBar;" value="1" />
+                                        <radio id="SSHidemethod2" label="&gen.switch.hidePage;" value="2" />
+                                    </radiogroup>
+
+                                </vbox>
+                            </vbox>
+
+                        </groupbox>
+
+<!-- Appearance -->
+
+                        <groupbox>
+                            <caption label="&tab.gen.appearance;" />
+
+                            <checkbox preference="SSThin" label="&gen.switch.thin;"
+                                oncommand="aios_checkboxObserver(this);" aiosChilds="SSThinMax" />
+
+                            <vbox class="indent">
+                                <checkbox preference="SSThinMax" label="&gen.switch.onlymax;" />
+                            </vbox>
+
+                            <grid flex="1" aiosAdvanced="true" style="margin-top: 5px;">
+                                <columns>
+                                    <column />
+                                    <column />
+                                </columns>
+
+                                <rows>
+
+                                    <row align="center" class="aiosAdvanced">
+                                        <label value="&gen.switch.width;:" />
+
+                                        <hbox align="center">
+                                            <textbox preference="SSWidth" size="1" />
+                                            <label value="&gen.width.px;" />
+                                        </hbox>
+                                    </row>
+
+                                    <row align="center" class="aiosAdvanced">
+                                        <label value="&gen.switch.twidth;:" />
+
+                                        <hbox align="center">
+                                            <textbox preference="SSThinWidth" size="1" />
+                                            <label value="&gen.width.px;" />
+                                        </hbox>
+                                    </row>
+
+                                </rows>
+                            </grid>
+
+                        </groupbox>
+
+            <!-- Fix fuer die Hoehe des Shortcut-Panels => sonst wird die letzte Textzeile "Tipp: ...keyconfig..." abgeschnitten -->
+                        <description style="visibility:hidden;">.</description>
+
+                    </vbox>
+
+                </tabpanel>
+
+
+<!-- TAB: Special -->
+
+                <tabpanel orient="vertical">
+                    <vbox aiosAdvanced="true">
+
+<!-- Open/Close Sidebar -->
+
+                        <groupbox aiosAdvanced="true">
+                            <caption label="&cmode.caption;" />
+
+                            <hbox>
+                                <description width="100%" flex="1" align="center">&cmode.desc;</description>
+
+                                <toolbarbutton style="float:right;" class="labelTip info" tooltiptext="&misc.enablelink.tooltip;"
+                                    oncommand="aios_addTab('http://firefox.exxile.net/aios/faq.php#operabehav');" />
+                            </hbox>
+
+                            <grid flex="1">
+                                <columns>
+                                    <column style="width:&gen.column1;px;" />
+                                    <column flex="1" />
+                                </columns>
+
+                                <rows>
+
+                                    <row align="center">
+                                        <label value="&cmode.key.label;" />
+
+                                        <menulist preference="cmodeKey">
+                                            <menupopup>
+                                                <menuitem label="&cmode.mode1.label;" value="1" />
+                                                <menuitem label="&cmode.mode2.label;" value="2" />
+                                                <menuitem label="&cmode.mode3.label;" value="3" />
+                                                <menuitem label="&cmode.mode4.label;" value="4" />
+                                            </menupopup>
+                                        </menulist>
+
+                                    </row>
+
+                                    <row align="center">
+                                        <label value="&menu.togglebar.label;" />
+
+                                        <menulist preference="cmodeSwitch">
+                                            <menupopup>
+                                                <menuitem label="&cmode.mode1.label;" value="1" />
+                                                <menuitem label="&cmode.mode2.label;" value="2" />
+                                                <menuitem label="&cmode.mode3.label;" value="3" />
+                                                <menuitem label="&cmode.mode4.label;" value="4" />
+                                            </menupopup>
+                                        </menulist>
+
+                                    </row>
+
+                                    <row align="center">
+                                        <label value="&cmode.tbb.label;" />
+
+                                        <menulist preference="cmodeTbb">
+                                            <menupopup>
+                                                <menuitem label="&cmode.mode1.label;" value="1" />
+                                                <menuitem label="&cmode.mode2.label;" value="2" />
+                                                <menuitem label="&cmode.mode3.label;" value="3" />
+                                                <menuitem label="&cmode.mode4.label;" value="4" />
+                                            </menupopup>
+                                        </menulist>
+
+                                    </row>
+
+                                    <row align="center">
+                                        <label value="&cmode.close.label;" />
+
+                                        <menulist preference="cmodeClose">
+                                            <menupopup>
+                                                <menuitem label="&cmode.mode1.label;" value="1" />
+                                                <menuitem label="&cmode.mode2.label;" value="2" />
+                                                <menuitem label="&cmode.mode3.label;" value="3" />
+                                            </menupopup>
+                                        </menulist>
+
+                                    </row>
+
+                                </rows>
+                            </grid>
+                        </groupbox>
+
+<!-- Sidebar Collapsing -->
+
+                        <groupbox>
+
+                            <caption label="&special.collapsing.caption; *" />
+
+                            <hbox>
+                                <description width="100%" flex="1" align="center">&special.collapsing.desc;</description>
+
+                                <toolbarbutton style="float:right;" class="labelTip info" tooltiptext="&misc.enablelink.tooltip;"
+                                    oncommand="aios_addTab('http://firefox.exxile.net/aios/faq.php#collapsing');" />
+                            </hbox>
+
+                            <checkbox id="obj-SBCollapsing" preference="SBCollapsing" label="&special.collapsing.label;" flex="1" />
+
+                        </groupbox>
+
+                    </vbox>
+
+                    <spacer flex="1" />
+                    <description value="* &keyconfig.warn;" style="margin-top: 10px;" />
+                </tabpanel>
+
+            </tabpanels>
+
+        </tabbox>
+    </prefpane>
+
+
+<!-- P A N E L S -->
+
+    <prefpane id="aiosPanels" label="&tab.panels;" flex="1" seltab="0" persist="seltab" onpaneload="aios_initPane('panels');">
+        <preferences>
+            <preference id="DMOpen"         type="bool"     name="extensions.aios.dm.sidebar" />
+            <preference id="DMLayout"       type="bool"     name="extensions.aios.dm.layout" />
+            <preference id="DMAutoOpen"     type="bool"     name="extensions.aios.dm.autoopen" />
+            <preference id="DMAutoClose"    type="bool"     name="extensions.aios.dm.autoclose" />
+            <preference id="DMCount"        type="bool"     name="extensions.aios.dm.count" />
+
+            <preference id="EMOpen"         type="bool"     name="extensions.aios.em.sidebar" />
+            <preference id="EMCount"        type="bool"     name="extensions.aios.em.count" />
+
+            <preference id="BMOpen"         type="bool"     name="extensions.aios.bm.sidebar" />
+            <preference id="HIOpen"         type="bool"     name="extensions.aios.hi.sidebar" />
+            <preference id="PIOpen"         type="bool"     name="extensions.aios.pi.sidebar" />
+            <preference id="PILayout"       type="bool"     name="extensions.aios.pi.layout" />
+
+            <preference id="MPOpen"         type="bool"     name="extensions.aios.mp.sidebar" />
+            <preference id="COOpen"         type="bool"     name="extensions.aios.co.sidebar" />
+            <preference id="COLayout"       type="bool"     name="extensions.aios.co.layout" />
+
+            <preference id="PanelTabReverse"    type="bool"     name="extensions.aios.paneltab.reverse" />
+            <preference id="PanelTabBMM"    type="bool"     name="extensions.aios.paneltab.bm" />
+        </preferences>
+
+        <tabbox flex="1" id="aiosTabboxPanels">
+
+            <tabs onclick="aios_synchTabs(this);">
+                <tab label="&tab.panels.places;" />
+                <tab label="&downloads.label;" />
+                <tab label="&button.addons.label;" />
+                <tab label="&tab.panels.other1;" />
+                <tab label="&tab.panels.other2;" />
+            </tabs>
+
+            <tabs onclick="aios_synchTabs(this);" aiosAdvanced="true">
+                <tab label="&tab.panels.places;" />
+                <tab label="&downloads.label;" />
+                <tab label="&button.addons.label;" />
+                <tab label="&tab.panels.other1;" />
+                <tab label="&tab.panels.other2;" />
+                <tab label="&tab.panels.paneltab;" class="aiosAdvanced" />
+            </tabs>
+
+            <tabpanels flex="1">
+
+
+<!-- TAB: Bookmarks/History -->
+
+                <tabpanel orient="vertical">
+                    <vbox class="aiosSizeBox" restart="true">
+
+                        <groupbox>
+                            <caption label="&bookmarksButton.label;" />
+                            <checkbox preference="BMOpen" label="&misc.enablesidebar.label; *" oncommand="aios_checkboxObserver(this);" />
+                        </groupbox>
+
+                        <groupbox>
+                            <caption label="&historyButton.label;" />
+                            <checkbox preference="HIOpen" label="&misc.enablesidebar.label; *" oncommand="aios_checkboxObserver(this);" />
+                        </groupbox>
+
+                    </vbox>
+
+                    <spacer flex="1" />
+                    <description value="* &restart;" style="margin-top: 10px;" />
+
+                </tabpanel>
+
+
+<!-- TAB: Downloads -->
+
+                <tabpanel orient="vertical">
+                    <vbox class="aiosSizeBox" restart="true">
+
+                        <groupbox>
+                            <caption label="&tab.gen.behavior;" />
+                            <checkbox preference="DMOpen" label="&misc.enablesidebar.label; *" aiosChilds="DMLayout, DMAutoOpen, DMAutoClose" oncommand="aios_checkboxObserver(this);" />
+
+<!--
+                            <vbox class="indent">
+                                <checkbox preference="DMAutoOpen" label="&misc.dm.autoopen.label;" aiosChilds="DMAutoClose" oncommand="aios_checkboxObserver(this);" />
+                                <vbox class="indent">
+                                    <checkbox preference="DMAutoClose" label="&misc.dm.autoclose.label;" />
+                                </vbox>
+                            </vbox>
+
+                            <vbox class="indent spacer" aiosAdvanced="true">
+                                <checkbox preference="DMLayout" label="&misc.layout.label;" />
+                            </vbox>
+-->
+                        </groupbox>
+
+<!--
+                        <groupbox>
+                            <caption label="&tab.gen.appearance;" />
+                            <checkbox preference="DMCount" label="&misc.count.label;" />
+                        </groupbox>
+-->
+                    </vbox>
+
+                    <spacer flex="1" />
+                    <description value="* &restart;" style="margin-top: 10px;" />
+
+                </tabpanel>
+
+
+<!-- TAB: Add-ons -->
+
+                <tabpanel orient="vertical">
+                    <vbox class="aiosSizeBox" restart="true">
+
+                        <groupbox>
+                            <caption label="&tab.gen.behavior;" />
+                            <checkbox preference="EMOpen" label="&misc.enablesidebar.label; *" oncommand="aios_checkboxObserver(this);" />
+                        </groupbox>
+
+                        <groupbox>
+                            <caption label="&tab.gen.appearance;" />
+                            <checkbox preference="EMCount" label="&misc.count.label;" />
+                        </groupbox>
+
+                    </vbox>
+
+                    <spacer flex="1" />
+                    <description value="* &restart;" style="margin-top: 10px;" />
+
+                </tabpanel>
+
+
+<!-- TAB: Andere I -->
+
+                <tabpanel orient="vertical">
+                    <vbox class="aiosSizeBox" restart="true">
+
+                        <groupbox>
+                            <caption label="&button.multipanel.label;" />
+                            <checkbox preference="MPOpen" label="&misc.enablesidebar.label; *" />
+                        </groupbox>
+
+                        <groupbox>
+                            <caption label="&pageInfoCmd.label;" />
+                            <checkbox preference="PIOpen" label="&misc.enablesidebar.label; *" aiosChilds="PILayout" oncommand="aios_checkboxObserver(this);" />
+
+                            <vbox class="indent" aiosAdvanced="true">
+                                <checkbox id="obj-PILayout" preference="PILayout" label="&misc.layout.label;" />
+                            </vbox>
+                        </groupbox>
+
+                    </vbox>
+
+                    <spacer flex="1" />
+                    <description value="* &restart;" style="margin-top: 10px;" />
+
+                </tabpanel>
+
+
+<!-- TAB: Andere II -->
+
+                <tabpanel orient="vertical">
+                    <vbox class="aiosSizeBox" restart="true">
+
+                        <groupbox>
+                            <caption label="&button.console.label;" />
+                            <checkbox preference="COOpen" label="&misc.enablesidebar.label; *" aiosChilds="COLayout" oncommand="aios_checkboxObserver(this);" />
+
+                            <vbox class="indent" aiosAdvanced="true">
+                                <checkbox preference="COLayout" label="&misc.layout.label;" />
+                            </vbox>
+                        </groupbox>
+
+                    </vbox>
+
+                    <spacer flex="1" />
+                    <description value="* &restart;" style="margin-top: 10px;" />
+
+                </tabpanel>
+
+
+<!-- TAB: PanelTab -->
+
+                <tabpanel orient="vertical">
+                    <vbox class="aiosSizeBox">
+
+<!-- Bookmarks - PanelTab -->
+
+                        <groupbox aiosAdvanced="true">
+                            <caption label="&tab.gen.behavior;" />
+                            <checkbox preference="PanelTabReverse" label="&misc.paneltab.reverse;" />
+                        </groupbox>
+
+                        <groupbox aiosAdvanced="true">
+                            <caption label="&bookmarksButton.label;" />
+
+                            <description width="100%">&misc.bm.paneltab.desc;</description>
+                            <checkbox preference="PanelTabBMM" label="&misc.bm.paneltab;" />
+                        </groupbox>
+
+                    </vbox>
+                </tabpanel>
+
+            </tabpanels>
+        </tabbox>
+    </prefpane>
+
+
+<!-- M E N U S -->
+
+    <prefpane id="aiosMenus" label="&tab.menus;" flex="1" seltab="0" persist="seltab" onpaneload="aios_initPane('menus');">
+        <preferences>
+            <preference id="SBEntryDeac"    type="bool"     name="extensions.aios.menus.sidebar.entrydeac" />
+            <preference id="SBEntries"      type="bool"     name="extensions.aios.menus.sidebar.entries" />
+            <preference id="SBIcons"        type="bool"     name="extensions.aios.menus.sidebar.icons" />
+            <preference id="SBPanelTab1"    type="bool"     name="extensions.aios.menus.sidebar.paneltab1" />
+            <preference id="SBPanelTab2"    type="bool"     name="extensions.aios.menus.sidebar.paneltab2" />
+            <preference id="SBShowHide"     type="bool"     name="extensions.aios.menus.sidebar.showhide" />
+            <preference id="SBOptions"      type="bool"     name="extensions.aios.menus.sidebar.prefs" />
+        </preferences>
+
+        <tabbox flex="1" id="aiosTabboxMenus">
+
+            <tabs onclick="aios_synchTabs(this);">
+                <tab label="&tab.menus.sidebar;" />
+            </tabs>
+
+            <tabpanels flex="1">
+
+
+<!-- TAB: Sidebar -->
+
+                <tabpanel orient="vertical">
+                    <vbox class="aiosSizeBox">
+
+                        <description width="100%">&menus.sidebar.desc;</description>
+
+                        <checkbox preference="SBEntryDeac" label="&menus.sidebar.entrydeac;" aiosAdvanced="true" />
+
+                        <groupbox>
+                            <caption>
+                                <checkbox preference="SBEntries" label="&menus.entries.label;" oncommand="aios_checkboxObserver(this);"
+                                    aiosChilds="SBIcons, SBPanelTab1, SBPanelTab2, SBShowHide, SBOptions" />
+                            </caption>
+
+                            <vbox class="indent">
+
+                                <vbox aiosAdvanced="true">
+                                    <checkbox preference="SBIcons" label="&menus.icons.label;" />
+                                    <separator class="groove" />
+                                </vbox>
+
+                                <checkbox preference="SBPanelTab1" label="&button.paneltab.menu1.label;" />
+                                <checkbox preference="SBPanelTab2" label="&button.paneltab.menu2.label;" />
+                                <checkbox preference="SBShowHide" label="&sidebar.open.label;/&sidebar.close.label;" />
+                                <checkbox preference="SBOptions" label="&menu.prefs.label;" />
+                            </vbox>
+
+                        </groupbox>
+
+                    </vbox>
+                </tabpanel>
+
+            </tabpanels>
+        </tabbox>
+    </prefpane>
+
+
+<!-- S H O R T C U T S -->
+
+    <prefpane id="aiosKeys" label="&tab.keys;" flex="1" src="chrome://aios/content/prefs/keys.xul" />
+
+
+<!-- A B O U T -->
+
+    <prefpane id="aiosAbout" label="&tab.about;" flex="1" src="chrome://aios/content/about_content.xul" />
+
 </prefwindow>
\ No newline at end of file
diff --git a/defaults/preferences/aios.js b/defaults/preferences/aios.js
index 63e41c0..75d4e2c 100644
--- a/defaults/preferences/aios.js
+++ b/defaults/preferences/aios.js
@@ -1,108 +1,108 @@
-
-/*
- *  AiOS
- **/
-pref("extensions.{097d3191-e6fa-4728-9826-b533d755359d}.description", "chrome://aios/locale/lib.properties");
-pref("extensions.aios.changelog", "");
-pref("extensions.aios.infotips", true);
-pref("extensions.aios.vbuttons", true);
-
-
-/*
- *  General
- **/
-pref("extensions.aios.gen.orient", 1);
-pref("extensions.aios.collapse", true);
-pref("extensions.aios.rightclick", false);
-
-pref("extensions.aios.gen.width.minVal", 200);
-pref("extensions.aios.gen.width.minUnit", "px");
-pref("extensions.aios.gen.width.defVal", 300);
-pref("extensions.aios.gen.width.defUnit", "px");
-pref("extensions.aios.gen.width.maxVal", 800);
-pref("extensions.aios.gen.width.maxUnit", "px");
-
-pref("extensions.aios.gen.init", "rem");
-pref("extensions.aios.gen.toolbar.init", 2);
-pref("extensions.aios.gen.switch.init", 2);
-
-pref("extensions.aios.gen.open.init", "rem");
-
-pref("extensions.aios.gen.switch.autoshow", false);
-pref("extensions.aios.gen.switch.onlymax", false);
-pref("extensions.aios.gen.switch.delay", 500);
-pref("extensions.aios.gen.switch.hidemethod", 1);
-pref("extensions.aios.gen.switch.width", 6);
-pref("extensions.aios.gen.switch.twidth", 2);
-pref("extensions.aios.gen.switch.thin", false);
-pref("extensions.aios.gen.switch.thinmax", false);
-pref("extensions.aios.gen.switch.drag", true);
-
-pref("extensions.aios.cmode.key", 2);
-pref("extensions.aios.cmode.switch", 2);
-pref("extensions.aios.cmode.tbb", 2);
-pref("extensions.aios.cmode.close", 1);
-
-pref("extensions.aios.fs.sidebar", true);
-pref("extensions.aios.fs.toolbar", true);
-pref("extensions.aios.fs.switch", false);
-pref("extensions.aios.fs.restore", true);
-
-
-/*
- *  Panels
- **/
-pref("extensions.aios.dm.sidebar", true);
-pref("extensions.aios.dm.layout", true);
-pref("extensions.aios.dm.layoutall", false);
-pref("extensions.aios.dm.autoopen", true);
-pref("extensions.aios.dm.autoclose", false);
-pref("extensions.aios.dm.count", true);
-
-pref("extensions.aios.em.sidebar", true);
-pref("extensions.aios.em.count", true);
-
-pref("extensions.aios.bm.sidebar", true);
-pref("extensions.aios.bm.layout", true);
-
-pref("extensions.aios.hi.sidebar", true);
-pref("extensions.aios.hi.layout", true);
-
-pref("extensions.aios.mp.sidebar", true);
-
-pref("extensions.aios.pi.sidebar", true);
-pref("extensions.aios.pi.layout", true);
-pref("extensions.aios.pi.layoutall", false);
-
-pref("extensions.aios.co.sidebar", true);
-pref("extensions.aios.co.layout", true);
-pref("extensions.aios.co.layoutall", false);
-
-
-/*
- *  Menus
- **/
-pref("extensions.aios.menus.sidebar.entrydeac", true);
-pref("extensions.aios.menus.sidebar.entries", true);
-pref("extensions.aios.menus.sidebar.icons", true);
-pref("extensions.aios.menus.sidebar.paneltab1", false);
-pref("extensions.aios.menus.sidebar.paneltab2", false);
-pref("extensions.aios.menus.sidebar.showhide", true);
-pref("extensions.aios.menus.sidebar.prefs", true);
-
-
-/*
- *  Shortcuts - by Dorando
- **/
-pref("extensions.aios.keyconf.devmode", false);
-pref("extensions.aios.keyconf.nicenames.reverse_order", false);
-pref("extensions.aios.keyconf.profile", "main");
-pref("extensions.aios.keyconf.warnOnClose", false);
-pref("extensions.aios.keyconf.warnOnDuplicate", true);
-
-
-/*
- *  Misc
- **/
-pref("extensions.aios.paneltab.reverse", false);
+
+/*
+ *  AiOS
+ **/
+pref("extensions.{097d3191-e6fa-4728-9826-b533d755359d}.description", "chrome://aios/locale/lib.properties");
+pref("extensions.aios.changelog", "");
+pref("extensions.aios.infotips", true);
+pref("extensions.aios.vbuttons", true);
+
+
+/*
+ *  General
+ **/
+pref("extensions.aios.gen.orient", 1);
+pref("extensions.aios.collapse", true);
+pref("extensions.aios.rightclick", false);
+
+pref("extensions.aios.gen.width.minVal", 200);
+pref("extensions.aios.gen.width.minUnit", "px");
+pref("extensions.aios.gen.width.defVal", 300);
+pref("extensions.aios.gen.width.defUnit", "px");
+pref("extensions.aios.gen.width.maxVal", 800);
+pref("extensions.aios.gen.width.maxUnit", "px");
+
+pref("extensions.aios.gen.init", "rem");
+pref("extensions.aios.gen.toolbar.init", 2);
+pref("extensions.aios.gen.switch.init", 2);
+
+pref("extensions.aios.gen.open.init", "rem");
+
+pref("extensions.aios.gen.switch.autoshow", false);
+pref("extensions.aios.gen.switch.onlymax", false);
+pref("extensions.aios.gen.switch.delay", 500);
+pref("extensions.aios.gen.switch.hidemethod", 1);
+pref("extensions.aios.gen.switch.width", 6);
+pref("extensions.aios.gen.switch.twidth", 2);
+pref("extensions.aios.gen.switch.thin", false);
+pref("extensions.aios.gen.switch.thinmax", false);
+pref("extensions.aios.gen.switch.drag", true);
+
+pref("extensions.aios.cmode.key", 2);
+pref("extensions.aios.cmode.switch", 2);
+pref("extensions.aios.cmode.tbb", 2);
+pref("extensions.aios.cmode.close", 1);
+
+pref("extensions.aios.fs.sidebar", true);
+pref("extensions.aios.fs.toolbar", true);
+pref("extensions.aios.fs.switch", false);
+pref("extensions.aios.fs.restore", true);
+
+
+/*
+ *  Panels
+ **/
+pref("extensions.aios.dm.sidebar", true);
+pref("extensions.aios.dm.layout", true);
+pref("extensions.aios.dm.layoutall", false);
+pref("extensions.aios.dm.autoopen", true);
+pref("extensions.aios.dm.autoclose", false);
+pref("extensions.aios.dm.count", true);
+
+pref("extensions.aios.em.sidebar", true);
+pref("extensions.aios.em.count", true);
+
+pref("extensions.aios.bm.sidebar", true);
+pref("extensions.aios.bm.layout", true);
+
+pref("extensions.aios.hi.sidebar", true);
+pref("extensions.aios.hi.layout", true);
+
+pref("extensions.aios.mp.sidebar", true);
+
+pref("extensions.aios.pi.sidebar", true);
+pref("extensions.aios.pi.layout", true);
+pref("extensions.aios.pi.layoutall", false);
+
+pref("extensions.aios.co.sidebar", true);
+pref("extensions.aios.co.layout", true);
+pref("extensions.aios.co.layoutall", false);
+
+
+/*
+ *  Menus
+ **/
+pref("extensions.aios.menus.sidebar.entrydeac", true);
+pref("extensions.aios.menus.sidebar.entries", true);
+pref("extensions.aios.menus.sidebar.icons", true);
+pref("extensions.aios.menus.sidebar.paneltab1", false);
+pref("extensions.aios.menus.sidebar.paneltab2", false);
+pref("extensions.aios.menus.sidebar.showhide", true);
+pref("extensions.aios.menus.sidebar.prefs", true);
+
+
+/*
+ *  Shortcuts - by Dorando
+ **/
+pref("extensions.aios.keyconf.devmode", false);
+pref("extensions.aios.keyconf.nicenames.reverse_order", false);
+pref("extensions.aios.keyconf.profile", "main");
+pref("extensions.aios.keyconf.warnOnClose", false);
+pref("extensions.aios.keyconf.warnOnDuplicate", true);
+
+
+/*
+ *  Misc
+ **/
+pref("extensions.aios.paneltab.reverse", false);
 pref("extensions.aios.paneltab.bm", false);
\ No newline at end of file
diff --git a/install.rdf b/install.rdf
index a6e93eb..f98cfab 100644
--- a/install.rdf
+++ b/install.rdf
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-    <Description about="urn:mozilla:install-manifest">
-        <em:name>All-in-One Sidebar</em:name>
-        <em:version>0.7.22</em:version>
-        <em:description>Sidebar control with award-winning user experience!</em:description>
-        <em:creator>Ingo Wennemaring</em:creator>
-
-        <em:id>{097d3191-e6fa-4728-9826-b533d755359d}</em:id>
-        <em:type>2</em:type>
-
-        <em:icon64URL>chrome://aios/skin/icons/icon64.png</em:icon64URL>
-        <em:aboutURL>chrome://aios/content/about.xul</em:aboutURL>
-        <em:homepageURL>http://addonlab.com</em:homepageURL>
-        <em:optionsURL>chrome://aios/content/prefs/prefs.xul</em:optionsURL>
-
-        <em:targetApplication>
-
-            <!-- Firefox -->
-            <Description>
-                <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-                <em:minVersion>29.0</em:minVersion>
-                <em:maxVersion>29.*</em:maxVersion>
-            </Description>
-
-        </em:targetApplication>
-
-    </Description>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+    <Description about="urn:mozilla:install-manifest">
+        <em:name>All-in-One Sidebar</em:name>
+        <em:version>0.7.23</em:version>
+        <em:description>Sidebar control with award-winning user experience!</em:description>
+        <em:creator>Ingo Wennemaring</em:creator>
+
+        <em:id>{097d3191-e6fa-4728-9826-b533d755359d}</em:id>
+        <em:type>2</em:type>
+
+        <em:icon64URL>chrome://aios/skin/icons/icon64.png</em:icon64URL>
+        <em:aboutURL>chrome://aios/content/about.xul</em:aboutURL>
+        <em:homepageURL>http://addonlab.com</em:homepageURL>
+        <em:optionsURL>chrome://aios/content/prefs/prefs.xul</em:optionsURL>
+
+        <em:targetApplication>
+
+            <!-- Firefox -->
+            <Description>
+                <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+                <em:minVersion>29.0</em:minVersion>
+                <em:maxVersion>31.*</em:maxVersion>
+            </Description>
+
+        </em:targetApplication>
+
+    </Description>
 </RDF>
\ No newline at end of file
diff --git a/license.txt b/license.txt
index 8a86b69..94fb846 100644
--- a/license.txt
+++ b/license.txt
@@ -1,339 +1,339 @@
-        GNU GENERAL PUBLIC LICENSE
-           Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-          Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-        GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-          NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-         END OF TERMS AND CONDITIONS
-
-      How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
+        GNU GENERAL PUBLIC LICENSE
+           Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+          Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+        GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+          NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+         END OF TERMS AND CONDITIONS
+
+      How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/locale/hu-HU/aios.dtd b/locale/hu-HU/aios.dtd
index 92370f9..c9363ac 100644
--- a/locale/hu-HU/aios.dtd
+++ b/locale/hu-HU/aios.dtd
@@ -5,7 +5,7 @@
 <!ENTITY toolbar.name "All-in-One Sidebar Eszköztár">
 <!ENTITY toolbar.label "All-in-One-Sidebar">
 <!ENTITY sbhtoolbar.name "Oldalsáv eszköztár">
-<!ENTITY sbhtoolbar.label "Sidebarheader">
+<!ENTITY sbhtoolbar.label "Oldalsáv címsor">
 <!ENTITY button.toggle.label "AiOS">
 <!ENTITY button.toggle.tooltip "Az All-in-One Sidebar által vezérelt elemek váltása">
 <!ENTITY button.switch.tooltip1 "Oldalsáv és Eszköztár megnyitása/bezárása">
diff --git a/locale/it/aios.dtd b/locale/it/aios.dtd
index 73b8a77..f6d0f0e 100644
--- a/locale/it/aios.dtd
+++ b/locale/it/aios.dtd
@@ -3,9 +3,9 @@
 <!ENTITY menu.togglebar.label "Bordo cliccabile (Mostra/Nasconde AiOS)">
 <!ENTITY menu.grippy.label "Barra laterale Grippy">
 <!ENTITY toolbar.name "Barra degli strumenti di All-in-One Sidebar">
-<!ENTITY toolbar.label "All-in-One-Sidebar">
+<!ENTITY toolbar.label "All-in-One Sidebar">
 <!ENTITY sbhtoolbar.name "Barra laterale">
-<!ENTITY sbhtoolbar.label "Sidebarheader">
+<!ENTITY sbhtoolbar.label "Intestazione della barra laterale">
 <!ENTITY button.toggle.label "AiOS">
 <!ENTITY button.toggle.tooltip "Attiva/Disattiva gli elementi controllati da All-in-One Sidebar">
 <!ENTITY button.switch.tooltip1 "Attiva/Disattiva barra laterale e degli strumenti">
diff --git a/locale/pt-PT/about.dtd b/locale/pt-PT/about.dtd
index c7839a6..d337176 100644
--- a/locale/pt-PT/about.dtd
+++ b/locale/pt-PT/about.dtd
@@ -2,12 +2,12 @@
 <!ENTITY settings "Definições…">
 <!ENTITY close "Fechar">
 <!ENTITY tab.about "Sobre">
-<!ENTITY tab.help "Help">
+<!ENTITY tab.help "Ajuda">
 <!ENTITY tab.contrib "Colaboradores">
 <!ENTITY tab.trans "Tradutores">
 <!ENTITY about.desc "O All-in-One Sidebar deixa-o abrir várias janelas como painéis laterais e trocar rapidamente entre eles. Por isso põe fim ao caos de janelas! Para além dos marcadores e do histórico abre os diálogos das transferências, extras e muito mais na barra lateral.">
 <!ENTITY create.desc "criado por Ingo Wennemaring, Hamburg [Alemanha]">
-<!ENTITY help.desc "You will find many information about this addon on the website:">
+<!ENTITY help.desc "Vai encontrar muita informação sobre este extra no sítio web:">
 <!ENTITY about1.name "Página Inicial- muitas informações num só lugar">
 <!ENTITY about2.name "Características - todas as características do All-in-One Sidebar">
 <!ENTITY about3.name "Perguntas e respostas frequentes">
diff --git a/locale/pt-PT/prefs.dtd b/locale/pt-PT/prefs.dtd
index 81d254e..fb57e82 100644
--- a/locale/pt-PT/prefs.dtd
+++ b/locale/pt-PT/prefs.dtd
@@ -21,7 +21,7 @@
 <!ENTITY tab.menus "Menus">
 <!ENTITY tab.menus.sidebar "Barra Lateral">
 <!ENTITY tab.keys "Atalhos">
-<!ENTITY tab.about "About/Help">
+<!ENTITY tab.about "Sobre/Ajuda">
 <!ENTITY gen.orient.caption "Posição">
 <!ENTITY gen.orient.label "Mostrar barra lateral no">
 <!ENTITY gen.orient.left "lado esquerdo">
diff --git a/locale/ro/lib.properties b/locale/ro/lib.properties
index 8af1d6f..b42e7b2 100644
--- a/locale/ro/lib.properties
+++ b/locale/ro/lib.properties
@@ -7,4 +7,4 @@ prefs.open=Importă configurația
 prefs.copy=Configurația a fost copiată în memoria tampon.
 prefs.invalid=Configurația nu poate fi importată deoarece fișierul este necorespunzător.
 prefs.failed=Configurația nu a putut fi importată.
-prefs.openpanel=Deschide
+prefs.openpanel=Se deschide
diff --git a/locale/ro/prefs.dtd b/locale/ro/prefs.dtd
index b58c8f7..4d5845b 100644
--- a/locale/ro/prefs.dtd
+++ b/locale/ro/prefs.dtd
@@ -3,15 +3,15 @@
 <!ENTITY settings "Configurații">
 <!ENTITY settings.default "Reinițializează…">
 <!ENTITY settings.advanced "Mod complex">
-<!ENTITY settings.import "Importă configurația...">
-<!ENTITY settings.export "Exportă configurația...">
+<!ENTITY settings.import "Importă configurația…">
+<!ENTITY settings.export "Exportă configurația…">
 <!ENTITY settings.copy "Copiază configurația în memoria tampon">
 <!ENTITY apply "Aplică">
 <!ENTITY gen.column1 "110">
 <!ENTITY tab.gen "General">
 <!ENTITY tab.gen.appearance "Prezentare">
 <!ENTITY tab.gen.behavior "Funcționare">
-<!ENTITY tab.gen.fullscreen "Mod „Pe tot ecranul“">
+<!ENTITY tab.gen.fullscreen "Mod „Ecran complet“">
 <!ENTITY tab.gen.special "Speciale">
 <!ENTITY tab.panels "Elemente panou">
 <!ENTITY tab.panels.places "Semne de carte/Istoric">
@@ -23,7 +23,7 @@
 <!ENTITY tab.keys "Taste directe">
 <!ENTITY tab.about "Despre/Ajutor">
 <!ENTITY gen.orient.caption "Orientare">
-<!ENTITY gen.orient.label "Afișează panoul lateral în">
+<!ENTITY gen.orient.label "Se afișează panoul lateral în">
 <!ENTITY gen.orient.left "partea stângă">
 <!ENTITY gen.orient.right "partea dreaptă">
 <!ENTITY gen.width.caption "Dimensiune">
@@ -37,21 +37,21 @@
 <!ENTITY gen.init.caption "Pornire navigator">
 <!ENTITY gen.init.label "Panou lateral">
 <!ENTITY gen.init.toolbar.label "Bară de unelte">
-<!ENTITY gen.init.toolbar.show.label "Afișează bara de unelte">
-<!ENTITY gen.init.toolbar.hide.label "Ascunde bara de unelte">
-<!ENTITY gen.init.switch.show.label "Afișează comutatorul panoului lateral">
-<!ENTITY gen.init.switch.hide.label "Ascunde comutatorul panoului lateral">
-<!ENTITY gen.init.mode1 "Restaurează starea memorată">
+<!ENTITY gen.init.toolbar.show.label "Se afișează bara de unelte">
+<!ENTITY gen.init.toolbar.hide.label "Se ascunde bara de unelte">
+<!ENTITY gen.init.switch.show.label "Se afișează comutatorul panoului lateral">
+<!ENTITY gen.init.switch.hide.label "Se ascunde comutatorul panoului lateral">
+<!ENTITY gen.init.mode1 "Se restaurează starea memorată">
 <!ENTITY gen.init.sidebar "Deschidere panou lateral (comutator panou, buton de comutare, taste directe)">
-<!ENTITY gen.init.sidebar.restore "Restaurează starea memorată">
-<!ENTITY gen.switch.autoshow "Afișează/ascunde automat panoul lateral (la trecerea cu mausul peste comutator)">
+<!ENTITY gen.init.sidebar.restore "Se restaurează ultimul panou afișat">
+<!ENTITY gen.switch.autoshow "Se afișează/ascunde automat panoul lateral (la trecerea cu mausul peste comutator)">
 <!ENTITY gen.switch.onlymax "Numai dacă navigatorul este maximizat sau în modul „Pe tot ecranul“">
 <!ENTITY gen.switch.delay "Întârziere">
 <!ENTITY gen.switch.delayUnit "milisecunde">
-<!ENTITY gen.switch.hide "Ascunde panoul lateral dacă cursorul mausului">
+<!ENTITY gen.switch.hide "Se ascunde panoul lateral dacă cursorul mausului">
 <!ENTITY gen.switch.hideBar "este readus în pagină">
 <!ENTITY gen.switch.hidePage "este menținut peste comutator">
-<!ENTITY gen.switch.thin "Activează comutatorul subțire">
+<!ENTITY gen.switch.thin "Se activează comutatorul subțire">
 <!ENTITY gen.switch.width "Grosime comutator standard">
 <!ENTITY gen.switch.twidth "Grosime comutator subțire">
 <!ENTITY cmode.caption "Comutator panou lateral">
@@ -62,8 +62,8 @@
 <!ENTITY cmode.mode1.label "Numai panoul lateral">
 <!ENTITY cmode.mode2.label "Panoul lateral și bara de unelte">
 <!ENTITY cmode.mode3.label "Panoul lateral, bara de unelte și comutatorul panoului">
-<!ENTITY cmode.mode4.label "Comportament ca și în Opera">
-<!ENTITY gen.fs.off "Restaurează starea dacă se părăsește modul „Pe tot ecranul“">
+<!ENTITY cmode.mode4.label "Comportament asemănător navigatorului „Opera”">
+<!ENTITY gen.fs.off "Se restaurează starea dacă se părăsește modul „Ecran complet“">
 <!ENTITY keyconfig.keyid "Denumiri">
 <!ENTITY keyconfig.id "ID">
 <!ENTITY keyconfig.apply "Aplică">
@@ -73,21 +73,21 @@
 <!ENTITY keyconfig.onreset "Este necesară repornirea navigatorului.">
 <!ENTITY keyconfig.unrecognized "Necunoscut ($1)">
 <!ENTITY keyconfig.used "Această tastă este deja utilizată de: \\n\\n\\t$1\\n\\nTotuși, este posibil să funcționeze.">
-<!ENTITY menus.sidebar.desc "Particularizează opțiunile meniului „Vizualizare > Bară laterală (panou lateral!)“ și ale listelor derulante aferente butoanelor panoului lateral.">
-<!ENTITY menus.icons.label "Afișează pictogramele">
-<!ENTITY menus.entries.label "Afișează opțiunile">
-<!ENTITY menus.sidebar.entrydeac "Dezactivează opțiunea dacă panoul lateral este vizibil">
-<!ENTITY misc.enablesidebar.label "Deschide în panoul lateral">
-<!ENTITY misc.layout.label "Optimizează aspectul pentru panoul lateral">
-<!ENTITY misc.dm.overlay "Modifică opțiunile privind comportamentul panoului lateral">
-<!ENTITY misc.dm.autoopen.label "Afișează panoul când se descarcă un fișier">
-<!ENTITY misc.dm.autoclose.label "Închide panoul la terminarea descărcărilor">
-<!ENTITY misc.colors.label "Colorează fundalul pe baza stărilor curente">
-<!ENTITY misc.count.label "Afișează numărul de elemente">
+<!ENTITY menus.sidebar.desc "Particularizează opțiunile meniului „Vizualizare | Bară laterală (panou lateral!)“ și ale listelor derulante aferente butoanelor panoului lateral.">
+<!ENTITY menus.icons.label "Se afișează pictogramele">
+<!ENTITY menus.entries.label "Se afișează opțiunile">
+<!ENTITY menus.sidebar.entrydeac "Se dezactivează opțiunea dacă panoul lateral este vizibil">
+<!ENTITY misc.enablesidebar.label "Se deschide în panoul lateral">
+<!ENTITY misc.layout.label "Se optimizează aspectul pentru panoul lateral">
+<!ENTITY misc.dm.overlay "Se modifică opțiunile privind comportamentul panoului lateral">
+<!ENTITY misc.dm.autoopen.label "Se afișează panoul când se descarcă un fișier">
+<!ENTITY misc.dm.autoclose.label "Se închide panoul la terminarea descărcărilor">
+<!ENTITY misc.colors.label "Se colorează fundalul pe baza stărilor curente">
+<!ENTITY misc.count.label "Se afișează numărul de elemente">
 <!ENTITY misc.enablelink.tooltip "Faceți clic aici pentru mai multe informații (legătură la „Întrebări și răspunsuri“)">
-<!ENTITY misc.paneltab.reverse "Inversează acțiunile pentru clic-stânga și clic-mijloc">
-<!ENTITY misc.bm.paneltab.desc "Butonul „File în panoul lateral“ poate deschide gestionarul semnelor de carte într-o nouă filă în loc de panoul semnelor de carte.">
-<!ENTITY misc.bm.paneltab "Deschide gestionarul semnelor de carte într-o nouă filă">
+<!ENTITY misc.paneltab.reverse "Se inversează acțiunile pentru clic-stânga și clic-mijloc">
+<!ENTITY misc.bm.paneltab.desc "Butonul „File în panoul lateral“ poate deschide gestionarul semnelor de carte într-o filă nouă în loc de panoul semnelor de carte.">
+<!ENTITY misc.bm.paneltab "Se deschide gestionarul semnelor de carte într-o filă nouă">
 <!ENTITY special.collapsing.caption "Ascundere panou lateral">
-<!ENTITY special.collapsing.label "Activează ascunderea panoului lateral">
+<!ENTITY special.collapsing.label "Se activează ascunderea panoului lateral">
 <!ENTITY special.collapsing.desc "Panoul lateral poate fi ascuns în loc să fie închis. Avantajul constă în redeschiderea mai rapidă, deoarece conținutul nu se mai reîncarcă ci doar se reafișează.">
diff --git a/locale/ru/aios.dtd b/locale/ru/aios.dtd
index 73b528c..8041279 100644
--- a/locale/ru/aios.dtd
+++ b/locale/ru/aios.dtd
@@ -5,7 +5,7 @@
 <!ENTITY toolbar.name "Боковая панель инструментов">
 <!ENTITY toolbar.label "All-in-One-Sidebar">
 <!ENTITY sbhtoolbar.name "Панель инструментов заголовка окна боковой панели">
-<!ENTITY sbhtoolbar.label "Sidebarheader">
+<!ENTITY sbhtoolbar.label "Заголовок боковой панели">
 <!ENTITY button.toggle.label "AiOS">
 <!ENTITY button.toggle.tooltip "Переключить боковые панели с помощью All-in-One Sidebar">
 <!ENTITY button.switch.tooltip1 "Переключить панель инструментов и боковую панель">
diff --git a/locale/sr/aios.dtd b/locale/sr/aios.dtd
index e67f1fe..ef7090e 100644
--- a/locale/sr/aios.dtd
+++ b/locale/sr/aios.dtd
@@ -1,14 +1,14 @@
-<!ENTITY loading.label "учитавање панела…">
-<!ENTITY menu.prefs.label "Поставке АиОС-а…">
+<!ENTITY loading.label "учитавање траке…">
+<!ENTITY menu.prefs.label "All-in-One Sidebar - опције">
 <!ENTITY menu.togglebar.label "Пребацивање бочне траке">
 <!ENTITY menu.grippy.label "Збијена бочна трака">
-<!ENTITY toolbar.name "АиОС трака задатака">
-<!ENTITY toolbar.label "All-in-One-Sidebar">
-<!ENTITY sbhtoolbar.name "Sidebarheader трака са задацима">
-<!ENTITY sbhtoolbar.label "Sidebarheader">
-<!ENTITY button.toggle.label "АиОС">
-<!ENTITY button.toggle.tooltip "Промени елементе контролисане од АиОС-а">
-<!ENTITY button.switch.tooltip1 "Промени траку задатака и алатну траку">
+<!ENTITY toolbar.name "All-in-One Sidebar трака са алаткама">
+<!ENTITY toolbar.label "All-in-One Sidebar">
+<!ENTITY sbhtoolbar.name "Sidebarheader трака са алаткама">
+<!ENTITY sbhtoolbar.label "Заглавље бочне траке">
+<!ENTITY button.toggle.label "AiOS">
+<!ENTITY button.toggle.tooltip "Промени елементе које контролише All-in-One Sidebar">
+<!ENTITY button.switch.tooltip1 "Промени бочну траку и алатну траку">
 <!ENTITY button.switch.tooltip2 "Промени алатну траку">
 <!ENTITY button.switch.tooltip3 "Промени траку задатака">
 <!ENTITY sidebar.open.label "Отвори бочну траку">
diff --git a/locale/tr/aios.dtd b/locale/tr/aios.dtd
index de0cfad..6687d92 100644
--- a/locale/tr/aios.dtd
+++ b/locale/tr/aios.dtd
@@ -5,7 +5,7 @@
 <!ENTITY toolbar.name "All-in-One Kenar Araç Çubuğu">
 <!ENTITY toolbar.label "All-in-One-Sidebar">
 <!ENTITY sbhtoolbar.name "Kenar Çubuğu başlık Araç Çubuğu">
-<!ENTITY sbhtoolbar.label "Sidebarheader">
+<!ENTITY sbhtoolbar.label "Yan-Çubuk-Başlığı">
 <!ENTITY button.toggle.label "AiOS">
 <!ENTITY button.toggle.tooltip "All-in-One Sidebar ile Düğme öğeleri düzenlendi">
 <!ENTITY button.switch.tooltip1 "Araç ve Kenar Çubuğu Düğmesi">
diff --git a/locale/uk/aios.dtd b/locale/uk/aios.dtd
index 161a2c7..b6818a7 100644
--- a/locale/uk/aios.dtd
+++ b/locale/uk/aios.dtd
@@ -3,9 +3,9 @@
 <!ENTITY menu.togglebar.label "Вимикач бічної панелі">
 <!ENTITY menu.grippy.label "Кнопка “Згорнути/Розгорнути”">
 <!ENTITY toolbar.name "Бічна панель інструментів">
-<!ENTITY toolbar.label "All-in-One-Sidebar">
+<!ENTITY toolbar.label "Бічна панель All-in-One">
 <!ENTITY sbhtoolbar.name "Панель інструментів заголовка бічної панелі">
-<!ENTITY sbhtoolbar.label "Sidebarheader">
+<!ENTITY sbhtoolbar.label "Заголовок бічної панелі">
 <!ENTITY button.toggle.label "AiOS">
 <!ENTITY button.toggle.tooltip "Переключити елементи, керовані All-in-One Sidebar">
 <!ENTITY button.switch.tooltip1 "Переключити бічну панель та панель інструментів">

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/all-in-one-sidebar.git



More information about the Pkg-mozext-commits mailing list