         var foundLastVisibleElement:Boolean = false;
         var numVisibleElements:int = 0;
         var numVisitedElements:int = 0;
-                
+        
         // Translate the vsp to the item index
         if (!wrapElements)
         {

        yPos = itemIndex * rowHeight + yOffset;
        
        // Calculate the y position of the bottom of the viewable area
        yPosMax = yPos + height;
        
        // Normalize the itemIndex
        if (wrapElements)

			var wrapCount:int = Math.floor(verticalScrollPosition / totalHeight);
			index += wrapCount * target.numElements;
			
			var firstVisibleItem:int = Math.floor((verticalScrollPosition ) / rowHeight);
			if (index < firstVisibleItem)
				index += target.numElements;
		}
