             return 0;
 
         var delta:Number = 0;
-        switch (scrollUnit)
+        switch (navigationUnit)
         {
-            case ScrollUnit.LEFT:
+            case NavigationUnit.LEFT:
                 // Snap the left edge of element to the left edge of the scrollRect.
                 // The element is the the first non-fully visible element left of the scrollRect.
                 delta = Math.max(getElementBounds.left - scrollRect.left, -scrollRect.width);
             break;    
-            case ScrollUnit.RIGHT:
+            case NavigationUnit.RIGHT:
                 // Snap the right edge of the element to the right edge of the scrollRect.
                 // The element is the the first non-fully visible element right of the scrollRect.
                 delta = Math.min(getElementBounds.right - scrollRect.right, scrollRect.width);
             break;    
-            case ScrollUnit.PAGE_LEFT:
+            case NavigationUnit.PAGE_LEFT:
             {
                 // Snap the right edge of the element to the right edge of the scrollRect.
                 // The element is the the first non-fully visible element left of the scrollRect. 

import flash.ui.Keyboard; 

import spark.components.supportClasses.GroupBase;
import spark.core.ScrollUnit;
import mx.core.ILayoutElement;
import mx.utils.OnDemandEventDispatcher;
import spark.core.NavigationUnit;

        var maxDelta:Number = g.contentWidth - scrollRect.right;
        var minDelta:Number = -scrollRect.left;
        var getElementBounds:Rectangle;
        switch(navigationUnit)
        {
            case NavigationUnit.LEFT:
            case NavigationUnit.PAGE_LEFT:
                // Find the bounds of the first non-fully visible element
                // to the left of the scrollRect.
                getElementBounds = getElementBoundsLeftOfScrollRect(scrollRect);
                break;

            case NavigationUnit.RIGHT:
            case NavigationUnit.PAGE_RIGHT:
                // Find the bounds of the first non-fully visible element
                // to the right of the scrollRect.
                getElementBounds = getElementBoundsRightOfScrollRect(scrollRect);
                break;

            case NavigationUnit.HOME: 
                return minDelta;
                
            case NavigationUnit.END: 
                return maxDelta;
                
            default:
