var scroll;
var childCount;
var myFx;
function begin()
{
	childCount = $('fx_messages').getElements('li[id^=fx_messages]');  
	(childCount);   
    if (childCount.length > 1)
    {
		childCount.getParent('ul').setStyle('position:relative;')
        childCount.setStyle('position', 'absolute');
		childCount.setStyle('opacity', '0');

		toNext();
	}

}

function toNext(item)
{
    var target = (item) ? item.getNext('li[id^=fx_messages]') : $('fx_messages').getFirst('li[id^=fx_messages]');
    if (target)
    {
		childCount.set('tween', {duration: 1000});
		childCount.tween('opacity', '0');

		target.set('tween', {duration: 2000});
        target.tween('opacity', 1);

        toNext.pass(target).delay(5000);
    }
	
    else
    {
        toNext();
    }

}

window.addEvent('domready', begin);
