         var viewport:IViewport = scroller.viewport;
         var hsb:ScrollBar = scroller.horizontalScrollBar;
         var vsb:ScrollBar = scroller.verticalScrollBar;
-        var hsbElt:ILayoutElement = LayoutElementFor(hsb);
-        var vsbElt:ILayoutElement = LayoutElementFor(vsb);
            
         // Decide which scrollbars will be visible
         var showHSB:Boolean = false;

        if (showVSB && !showHSB && hAuto && (viewport.contentWidth > viewportW))
        {
            showHSB = true;
            hsbH = hsbElt.getPreferredBoundsHeight();                
            viewportH -= hsbH;
        }
        else if (!showVSB && showHSB && vAuto && (viewport.contentHeight > viewportH))
        {
            showVSB = true;
            vsbW = vsbElt.getPreferredBoundsWidth();                
            viewportW -= vsbW;
        }

        // layout the viewport
        if (viewport)
        {
            var viewportElt:ILayoutElement = LayoutElementFor(viewport);
            viewportElt.setLayoutBoundsSize(viewportW, viewportH);
            viewportElt.setLayoutBoundsPosition(0,0);
        }

        var hsbH:Number = 0;
        if (showHSB) 
        {
            hsbH = hsb.getPreferredBoundsHeight();
            viewportH -= hsbH;
        }
        var viewportW:Number = w;
        var vsbW:Number = 0;
        if (showVSB) 
        {
            vsbW = vsb.getPreferredBoundsWidth();
            viewportW -= vsbW;
        }
        
