Index: typo3/js/backendsearch.js
===================================================================
--- typo3/js/backendsearch.js	(Revision 10174)
+++ typo3/js/backendsearch.js	(Arbeitskopie)
@@ -35,10 +35,9 @@
 	 * registers for resize event listener and executes on DOM ready
 	 */
 	initialize: function() {
-		Event.observe(window, 'resize', this.positionMenu);
-
 		Ext.onReady(function() {
-			this.positionMenu();
+			Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('backend-search-menu'));
+			TYPO3BackendToolbarManager.positionMenu('backend-search-menu');
 			this.toolbarItemIcon = $$('#backend-search-menu .toolbar-item span.t3-icon')[0];
 
 			$('search-query').observe('keypress', function(event) {
@@ -63,38 +62,7 @@
 		}.bindAsEventListener(this));
 	},
 
-	/**
-	 * positions the menu below the toolbar icon, let's do some math!
-	 */
-	positionMenu: function() {
-		var calculatedOffset = 0;
-		var parentWidth      = $('backend-search-menu').getWidth();
-		var currentToolbarItemLayer = $$('#backend-search-menu div')[0];
-		var ownWidth         = currentToolbarItemLayer.getWidth();
 
-		var parentSiblings   = $('backend-search-menu').previousSiblings();
-
-		parentSiblings.each(function(toolbarItem) {
-			calculatedOffset += toolbarItem.getWidth() - 1;
-			// -1 to compensate for the margin-right -1px of the list items,
-			// which itself is necessary for overlaying the separator with the active state background
-
-			if (toolbarItem.down().hasClassName('no-separator')) {
-				calculatedOffset -= 1;
-			}
-		});
-		calculatedOffset = calculatedOffset - ownWidth + parentWidth;
-
-		// border correction
-	if (currentToolbarItemLayer.getStyle('display') !== 'none') {
-		calculatedOffset += 2;
-	}
-
-		$$('#backend-search-menu div')[0].setStyle({
-			left: calculatedOffset + 'px'
-		});
-	},
-
 	/**
 	 * toggles the visibility of the menu and places it under the toolbar icon
 	 */
Index: typo3/js/workspacemenu.js
===================================================================
--- typo3/js/workspacemenu.js	(Revision 10174)
+++ typo3/js/workspacemenu.js	(Arbeitskopie)
@@ -36,10 +36,10 @@
 	 * registers for resize event listener and executes on DOM ready
 	 */
 	initialize: function() {
-		Event.observe(window, 'resize', this.positionMenu);
 
 		Ext.onReady(function() {
-			this.positionMenu();
+			Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('workspace-selector-menu'));
+			TYPO3BackendToolbarManager.positionMenu('workspace-selector-menu');
 
 			Event.observe('workspace-selector-menu', 'click', this.toggleMenu);
 			Event.observe('frontendPreviewToggle', 'click', this.toggleFrontendPreview.bind(this));
@@ -54,37 +54,6 @@
 	},
 
 	/**
-	 * positions the menu below the toolbar icon, let's do some math!
-	 */
-	positionMenu: function() {
-		var calculatedOffset = 0;
-		var parentWidth      = $('workspace-selector-menu').getWidth();
-		var currentToolbarItemLayer = $$('#workspace-selector-menu ul')[0];
-		var ownWidth         = currentToolbarItemLayer.getWidth();
-		var parentSiblings   = $('workspace-selector-menu').previousSiblings();
-
-		parentSiblings.each(function(toolbarItem) {
-			calculatedOffset += toolbarItem.getWidth() - 1;
-			// -1 to compensate for the margin-right -1px of the list items,
-			// which itself is necessary for overlaying the separator with the active state background
-
-			if (toolbarItem.down().hasClassName('no-separator')) {
-				calculatedOffset -= 1;
-			}
-		});
-		calculatedOffset = calculatedOffset - ownWidth + parentWidth;
-
-			// border correction
-		if (currentToolbarItemLayer.getStyle('display') !== 'none') {
-			calculatedOffset += 2;
-		}
-
-		$$('#workspace-selector-menu ul')[0].setStyle({
-			left: calculatedOffset + 'px'
-		});
-	},
-
-	/**
 	 * toggles the visibility of the menu and places it under the toolbar icon
 	 */
 	toggleMenu: function(event) {
Index: typo3/js/toolbarmanager.js
===================================================================
--- typo3/js/toolbarmanager.js	(Revision 10174)
+++ typo3/js/toolbarmanager.js	(Arbeitskopie)
@@ -44,6 +44,48 @@
 				// show toolbarItem
 			toolbarItem.addClassName('toolbar-item-active');
 		}
+	},
+
+	/**
+	 * refreshs positioning of all submenus
+	 */
+	refreshAll: function() {
+		$$('.toolbar-item-menu').each(function(element) {
+			menuParent = Ext.get(element);
+			TYPO3BackendToolbarManager.positionMenu(menuParent.findParentNode('[id$="-menu"]').id);
+		});
+	},
+
+	/**
+	 * positions a toolbar item (has to have .toolbar-item-menu)
+	 * @param elementId The parent element ofthe menu to be positioned
+	 */
+	positionMenu: function(elementId) {
+		var calculatedOffset = 0;
+		var parentWidth = $(elementId).getWidth();
+		var currentToolbarItemLayer = $$('#' + elementId + ' .toolbar-item-menu')[0];
+		var ownWidth = currentToolbarItemLayer.getWidth();
+		var parentSiblings = $(elementId).previousSiblings();
+
+		parentSiblings.each(function(toolbarItem) {
+			calculatedOffset += toolbarItem.getWidth() - 1;
+			// -1 to compensate for the margin-right -1px of the list items,
+			// which itself is necessary for overlaying the separator with the active state background
+
+			if (toolbarItem.down().hasClassName('no-separator')) {
+				calculatedOffset -= 1;
+			}
+		});
+		calculatedOffset = calculatedOffset - ownWidth + parentWidth;
+
+		// border correction
+		if (currentToolbarItemLayer.getStyle('display') !== 'none') {
+			calculatedOffset += 2;
+		}
+
+		$$('#' + elementId + ' .toolbar-item-menu')[0].setStyle({
+			left: calculatedOffset + 'px'
+		});
 	}
 
 });
Index: typo3/js/clearcachemenu.js
===================================================================
--- typo3/js/clearcachemenu.js	(Revision 10174)
+++ typo3/js/clearcachemenu.js	(Arbeitskopie)
@@ -35,10 +35,10 @@
 	 * registers for resize event listener and executes on DOM ready
 	 */
 	initialize: function() {
-		Event.observe(window, 'resize', this.positionMenu);
 
 		Ext.onReady(function() {
-			this.positionMenu();
+			Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('clear-cache-actions-menu'));
+			TYPO3BackendToolbarManager.positionMenu('clear-cache-actions-menu');
 			this.toolbarItemIcon = $$('#clear-cache-actions-menu .toolbar-item span.t3-icon')[0];
 
 			Event.observe('clear-cache-actions-menu', 'click', this.toggleMenu)
@@ -51,38 +51,6 @@
 	},
 
 	/**
-	 * positions the menu below the toolbar icon, let's do some math!
-	 */
-	positionMenu: function() {
-		var calculatedOffset = 0;
-		var parentWidth      = $('clear-cache-actions-menu').getWidth();
-		var currentToolbarItemLayer = $$('#clear-cache-actions-menu ul')[0];
-		var ownWidth         = currentToolbarItemLayer.getWidth();
-		var parentSiblings   = $('clear-cache-actions-menu').previousSiblings();
-
-		parentSiblings.each(function(toolbarItem) {
-			calculatedOffset += toolbarItem.getWidth() - 1;
-			// -1 to compensate for the margin-right -1px of the list items,
-			// which itself is necessary for overlaying the separator with the active state background
-
-			if (toolbarItem.down().hasClassName('no-separator')) {
-				calculatedOffset -= 1;
-			}
-		});
-		calculatedOffset = calculatedOffset - ownWidth + parentWidth;
-
-			// border correction
-		if (currentToolbarItemLayer.getStyle('display') !== 'none') {
-			calculatedOffset += 2;
-		}
-
-
-		$$('#clear-cache-actions-menu ul')[0].setStyle({
-			left: calculatedOffset + 'px'
-		});
-	},
-
-	/**
 	 * toggles the visibility of the menu and places it under the toolbar icon
 	 */
 	toggleMenu: function(event) {
Index: typo3/js/shortcutmenu.js
===================================================================
--- typo3/js/shortcutmenu.js	(Revision 10174)
+++ typo3/js/shortcutmenu.js	(Arbeitskopie)
@@ -36,10 +36,10 @@
 	 * registers for resize event listener and executes on DOM ready
 	 */
 	initialize: function() {
-		Event.observe(window, 'resize', this.positionMenu);
-
 		Ext.onReady(function() {
-			this.positionMenu();
+			Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('shortcut-menu'));
+			TYPO3BackendToolbarManager.positionMenu('shortcut-menu');
+			
 			this.toolbarItemIcon = $$('#shortcut-menu .toolbar-item span.t3-icon')[0];
 
 			Event.observe($$('#shortcut-menu .toolbar-item')[0], 'click', this.toggleMenu);
@@ -101,37 +101,6 @@
 	},
 
 	/**
-	 * positions the menu below the toolbar icon, let's do some math!
-	 */
-	positionMenu: function() {
-		var calculatedOffset = 0;
-		var parentWidth      = $('shortcut-menu').getWidth();
-		var currentToolbarItemLayer = $$('#shortcut-menu .toolbar-item-menu')[0];
-		var ownWidth         = currentToolbarItemLayer.getWidth();
-		var parentSiblings   = $('shortcut-menu').previousSiblings();
-
-		parentSiblings.each(function(toolbarItem) {
-			calculatedOffset += toolbarItem.getWidth() - 1;
-			// -1 to compensate for the margin-right -1px of the list items,
-			// which itself is necessary for overlaying the separator with the active state background
-
-			if (toolbarItem.down().hasClassName('no-separator')) {
-				calculatedOffset -= 1;
-			}
-		});
-		calculatedOffset = calculatedOffset - ownWidth + parentWidth;
-
-			// border correction
-		if (currentToolbarItemLayer.getStyle('display') !== 'none') {
-			calculatedOffset += 2;
-		}
-
-		$$('#shortcut-menu .toolbar-item-menu')[0].setStyle({
-			left: calculatedOffset + 'px'
-		});
-	},
-
-	/**
 	 * toggles the visibility of the menu and places it under the toolbar icon
 	 */
 	toggleMenu: function(event) {
Index: typo3/sysext/opendocs/opendocs.js
===================================================================
--- typo3/sysext/opendocs/opendocs.js	(Revision 10174)
+++ typo3/sysext/opendocs/opendocs.js	(Arbeitskopie)
@@ -37,10 +37,10 @@
 	 * registers for resize event listener and executes on DOM ready
 	 */
 	initialize: function() {
-		Event.observe(window, 'resize', this.positionMenu);
 
 		Ext.onReady(function() {
-			this.positionMenu();
+			Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('tx-opendocs-menu'));
+			TYPO3BackendToolbarManager.positionMenu('tx-opendocs-menu');
 			this.toolbarItemIcon = $$('#tx-opendocs-menu .toolbar-item span.t3-icon')[0];
 			this.ajaxScript      = top.TS.PATH_typo3 + this.ajaxScript; // can't be initialized earlier
 
@@ -50,37 +50,6 @@
 	},
 
 	/**
-	 * positions the menu below the toolbar icon, let's do some math!
-	 */
-	positionMenu: function() {
-		var calculatedOffset = 0;
-		var parentWidth      = $('tx-opendocs-menu').getWidth();
-		var currentToolbarItemLayer = $$('#tx-opendocs-menu .toolbar-item-menu')[0];
-		var ownWidth         = currentToolbarItemLayer.getWidth();
-		var parentSiblings   = $('tx-opendocs-menu').previousSiblings();
-
-		parentSiblings.each(function(toolbarItem) {
-			calculatedOffset += toolbarItem.getWidth() - 1;
-			// -1 to compensate for the margin-right -1px of the list items,
-			// which itself is necessary for overlaying the separator with the active state background
-
-			if(toolbarItem.down().hasClassName('no-separator')) {
-				calculatedOffset -= 1;
-			}
-		});
-		calculatedOffset = calculatedOffset - ownWidth + parentWidth;
-
-			// border correction
-		if (currentToolbarItemLayer.getStyle('display') !== 'none') {
-			calculatedOffset += 2;
-		}
-
-		$$('#tx-opendocs-menu .toolbar-item-menu')[0].setStyle({
-			left: calculatedOffset + 'px'
-		});
-	},
-
-	/**
 	 * toggles the visibility of the menu and places it under the toolbar icon
 	 */
 	toggleMenu: function(event) {
Index: typo3/sysext/sys_action/toolbarmenu/tx_sysactions.js
===================================================================
--- typo3/sysext/sys_action/toolbarmenu/tx_sysactions.js	(Revision 10174)
+++ typo3/sysext/sys_action/toolbarmenu/tx_sysactions.js	(Arbeitskopie)
@@ -35,10 +35,10 @@
 	 * registers for resize event listener and executes on DOM ready
 	 */
 	initialize: function() {
-		Event.observe(window, 'resize', this.positionMenu);
 
 		Ext.onReady(function() {
-			this.positionMenu();
+			Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('tx-sys-action-menu'));
+			TYPO3BackendToolbarManager.positionMenu('tx-sys-action-menu');
 			this.toolbarItemIcon = $$('#tx-sys-action-menu .toolbar-item span')[0].src;
 
 			Event.observe('tx-sys-action-menu', 'click', this.toggleMenu);
@@ -47,37 +47,6 @@
 	},
 
 	/**
-	 * positions the menu below the toolbar icon, let's do some math!
-	 */
-	positionMenu: function() {
-		var calculatedOffset = 0;
-		var parentWidth      = $('tx-sys-action-menu').getWidth();
-		var currentToolbarItemLayer = $$('#tx-sys-action-menu ul')[0];
-		var ownWidth         = currentToolbarItemLayer.getWidth();
-		var parentSiblings   = $('tx-sys-action-menu').previousSiblings();
-
-		parentSiblings.each(function(toolbarItem) {
-			calculatedOffset += toolbarItem.getWidth() - 1;
-			// -1 to compensate for the margin-right -1px of the list items,
-			// which itself is necessary for overlaying the separator with the active state background
-
-			if(toolbarItem.down().hasClassName('no-separator')) {
-				calculatedOffset -= 1;
-			}
-		});
-		calculatedOffset = calculatedOffset - ownWidth + parentWidth;
-
-			// border correction
-		if (currentToolbarItemLayer.getStyle('display') !== 'none') {
-			calculatedOffset += 2;
-		}
-
-		$$('#tx-sys-action-menu ul')[0].setStyle({
-			left: calculatedOffset + 'px'
-		});
-	},
-
-	/**
 	 * toggles the visibility of the menu and places it under the toolbar icon
 	 */
 	toggleMenu: function(event) {
