var ul = false;
var _scroller = false;
var ul_offsetWidth = 0;
var _speed = 2;
var _is_paused = false;
var _is_right2left = false;
var _timeout = 20;

function initNewsScroll()
{

	if($('marguee-box'))
	{
		$('marguee-box').style.cursor = 'pointer';
		$('marguee-box').onclick = function()
		{
			window.location = '/news.html';
		}
	}

	ul = document.getElementById('news');
	if(ul)
	{
		ul_offsetWidth = ul.offsetWidth;
		
		if(ul_offsetWidth <= ul.parentNode.parentNode.offsetWidth) return;
		
		var _content = ul.innerHTML;		
		ul.innerHTML = _content + _content + _content;		

		_scroller = ul.parentNode;
		_scroller.id = "news-scroller";
		
		_scroller._start = (-1)*ul_offsetWidth;
		_scroller._end = (-1)* (2*ul_offsetWidth);


		_scroller._mooeff = new Fx.Styles( _scroller.id, {transition: Fx.Transitions.linear, duration: ul_offsetWidth*25,
					onStart: function(){
					},
					onComplete: function(){
						_scroller._mooeff.custom({'left':[_scroller._start,_scroller._end]});
					}			
			});

		_scroller._mooeff.custom({'left':[_scroller._start,_scroller._end]});
		
	}

}

if (window.addEventListener)
	window.addEventListener("load", initNewsScroll, false);
else if (window.attachEvent)
	window.attachEvent("onload", initNewsScroll);