Index: /CKEditor/branches/features/toolbargroup2/_source/plugins/toolbar/plugin.js
===================================================================
--- /CKEditor/branches/features/toolbargroup2/_source/plugins/toolbar/plugin.js	(revision 6715)
+++ /CKEditor/branches/features/toolbargroup2/_source/plugins/toolbar/plugin.js	(revision 6716)
@@ -61,5 +61,5 @@
 			var itemKeystroke = function( item, keystroke )
 			{
-				var next, nextToolGroup, groupItemsCount;
+				var next, toolbar;
 				var rtl = editor.lang.dir == 'rtl';
 
@@ -68,5 +68,26 @@
 					case 9 :					// TAB
 					case CKEDITOR.SHIFT + 9 :	// SHIFT + TAB
-						
+						// Cycle through the toolbars, starting from the one
+						// closest to the current item.
+						while ( !toolbar || !toolbar.items.length )
+						{
+							toolbar = keystroke == 9 ?
+								( ( toolbar ? toolbar.next : item.toolbar.next ) || editor.toolbox.toolbars[ 0 ] ) : 
+								( ( toolbar ? toolbar.previous : item.toolbar.previous ) || editor.toolbox.toolbars[ editor.toolbox.toolbars.length - 1 ] );
+
+							// Look for the first item that accepts focus.
+							item = toolbar.items.length && toolbar.items[ 0 ];
+							while ( item && !item.focus )
+							{
+								item = item.next;
+
+								if ( !item )
+									toolbar = 0;
+							}
+						}
+
+						if ( item )
+							item.focus();
+
 						return false;
 
@@ -82,20 +103,4 @@
 								next = item.toolbar.items[ 0 ];
 
-//							if ( !next )
-//							{
-//								nextToolGroup = item.toolbar.next;
-//								groupItemsCount = nextToolGroup && nextToolGroup.items.length;
-
-//								// Bypass the empty toolgroups.
-//								while ( groupItemsCount === 0 )
-//								{
-//									nextToolGroup = nextToolGroup.next;
-//									groupItemsCount = nextToolGroup && nextToolGroup.items.length;
-//								}
-
-//								if ( nextToolGroup )
-//									next = nextToolGroup.items[ 0 ];
-//							}
-
 							item = next;
 						}
@@ -121,20 +126,4 @@
 							if ( !next )
 								next = item.toolbar.items[ item.toolbar.items.length - 1 ];
-
-//							if ( !next )
-//							{
-//								nextToolGroup = item.toolbar.previous;
-//								groupItemsCount = nextToolGroup && nextToolGroup.items.length;
-
-//								// Bypass the empty toolgroups.
-//								while ( groupItemsCount === 0 )
-//								{
-//									nextToolGroup = nextToolGroup.previous;
-//									groupItemsCount = nextToolGroup && nextToolGroup.items.length;
-//								}
-
-//								if ( nextToolGroup )
-//									next = nextToolGroup.items[ groupItemsCount - 1 ];
-//							}
 
 							item = next;
