var cMenuAnimator = {
    animationTimer:     null,
    animationObjects:   new Array(),
    
    init:               function ()
                        {
                            var oUl = document.getElementById('menuAnimator');
                            
                            if (oUl == undefined
                                || oUl == null)
                            {
                                return;   
                            }
                            
                            var aLinks = oUl.getElementsByTagName('a');

                            var i = aLinks.length;
                            while (i--)
                            {
                                if (aLinks[i].className != 'selected')
                                {
                                    aLinks[i].onmouseover = cMenuAnimator.mouseOver;
                                    aLinks[i].onmouseout = cMenuAnimator.mouseOut;
                                    
                                    aLinks[i].style.backgroundPosition = '0 26px';
                                    
                                    cMenuAnimator.animationObjects.push(aLinks[i]);
                                }
                            }
                            
                            // Set timer
                            setInterval("cMenuAnimator.animate()", 10);
                        },
                        
    mouseOver:          function ()
                        {
                            this.iTargetBackgroundYSpacing = 0;
                        },
    
    mouseOut:           function ()
                        {
                            this.iTargetBackgroundYSpacing = 26;
                        },
                        
    animate:            function ()
                        {
                            var i = cMenuAnimator.animationObjects.length;
                            while (i--)
                            {
                                cMenuAnimator.animation(cMenuAnimator.animationObjects[i]);
                            }
                        },
    
    animation:          function (obj)
                        {
                            // Get current Background Y Position
                            var iSpaceIndex = obj.style.backgroundPosition.indexOf(' ');
                            var iPxIndex = obj.style.backgroundPosition.lastIndexOf('px');
                            
                            var iYSpacing = parseInt(obj.style.backgroundPosition.substring(iSpaceIndex + 1, iPxIndex));
                            
                            if (iYSpacing < obj.iTargetBackgroundYSpacing)
                            {
                                obj.style.backgroundPosition = '0 ' + (iYSpacing + 1) + 'px';
                            }
                            else if (iYSpacing > obj.iTargetBackgroundYSpacing)
                            {
                                obj.style.backgroundPosition = '0 ' + (iYSpacing - 1) + 'px';
                            }
                        }
}