var currentIndex=0;
var max=10;

function scrollPanel(direction, container)
{        
    var realChildNodes = new Array();
    var z=0;
    for(y=0; y<=document.getElementById(container).childNodes.length; y++)
    {
        if(document.getElementById(container).childNodes[y]!=null)
        {
            if(document.getElementById(container).childNodes[y].nodeType==1)
            {
                realChildNodes[z] = document.getElementById(container).childNodes[y];
                z++;
            }
        }
    }
    
    var nodeCount = realChildNodes.length;
    
    if(realChildNodes[0]!=null)
    {
        if(realChildNodes[0].style.display != "none" && currentIndex != 0)
        {
            currentIndex=0;
        }
    }
    
    if(nodeCount>max)
    {
        if(direction=='up')
        {            
            if(currentIndex > 0)
            {
                currentIndex--;
                
                for(x=0; x<nodeCount; x++)
                {
                    if(x < (currentIndex + max) && x >= currentIndex)
                    {
                        realChildNodes[x].style.display="block";
                    }
                    else
                    {
                        realChildNodes[x].style.display="none";
                    }                
                }
            }                
        }
        
        if(direction=='down')
        {
            if(currentIndex < (nodeCount-max))
            {
                currentIndex++;
                for(x=0; x<nodeCount; x++)
                {
                    if(x < (currentIndex + max) && x >= currentIndex)
                    {
                        realChildNodes[x].style.display="block";                                
                    }
                    else
                    {
                        realChildNodes[x].style.display="none";                                
                    }                
                }
            }
        }
    }
}
