Index: /CKEditor/branches/features/aria/_source/plugins/toolbar/plugin.js
===================================================================
--- /CKEditor/branches/features/aria/_source/plugins/toolbar/plugin.js	(revision 4952)
+++ /CKEditor/branches/features/aria/_source/plugins/toolbar/plugin.js	(revision 4953)
@@ -1,3 +1,3 @@
-﻿/*
+/*
 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -60,11 +60,34 @@
 			var itemKeystroke = function( item, keystroke )
 			{
+				var next, nextToolGroup, groupItemsCount;
+
 				switch ( keystroke )
 				{
 					case 39 :					// RIGHT-ARROW
 					case 9 :					// TAB
-						// Look for the next item in the toolbar.
-						while ( ( item = item.next || ( item.toolbar.next && item.toolbar.next.items[ 0 ] ) ) && !item.focus )
-						{ /*jsl:pass*/ }
+						do
+						{
+							// Look for the previous item in the toolbar.
+							next = item.next;
+
+							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;
+						}
+						while ( item && !item.focus )
 
 						// If available, just focus it, otherwise focus the
@@ -79,8 +102,29 @@
 					case 37 :					// LEFT-ARROW
 					case CKEDITOR.SHIFT + 9 :	// SHIFT + TAB
-						// Look for the previous item in the toolbar.
-						while ( ( item = item.previous || ( item.toolbar.previous && item.toolbar.previous.items[ item.toolbar.previous.items.length - 1 ] ) ) && !item.focus )
-						{ /*jsl:pass*/ }
-
+						do
+						{
+							// Look for the previous item in the toolbar.
+							next = item.previous;
+
+							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;
+						}
+						while ( item && !item.focus )
+						
 						// If available, just focus it, otherwise focus the
 						// last one.
