var $ = function(elmId) {
	return document.getElementById(elmId);
}

var ScrollQuickNews = {
	elm : $('QuickNews'),
	content : null,
	contentWidth : null,
	timeout : null,
	
	scroll : function()
	{
	   var left = parseInt(this.content.style.left);

	   if(left < -this.contentWidth)
		{
			this.content.style.left = '400px';
			left = 400;
  		}

		this.content.style.left = (left - 1) + 'px';
		this.timeout = window.setTimeout("ScrollQuickNews.scroll()", 25);
	},

	scrollStop : function()
	{
	   window.clearTimeout(this.timeout);
	},
	
	scrollStart : function()
	{
	   this.content = this.elm.childNodes[0];
		this.contentWidth = this.content.offsetWidth;
		
	   this.content.style.position = 'relative';
		this.content.style.left = '420px';

		try {
		   $('QuickNewsLine').attachEvent('onmouseover', QuickNewsPause);
		}
		catch(e) {
		   $('QuickNewsLine').setAttribute('onmouseover', 'QuickNewsPause()');
		}
		
		try {
		   $('QuickNewsLine').attachEvent('onmouseout', QuickNewsContinue);
		}
		catch(e) {
		   $('QuickNewsLine').setAttribute('onmouseout', 'QuickNewsContinue()');
		}
		
		this.timeout = window.setTimeout("ScrollQuickNews.scroll()", 25);
	}
}

function QuickNewsPause()
{
	ScrollQuickNews.scrollStop();
}

function QuickNewsContinue()
{
	ScrollQuickNews.scroll();
}

ScrollQuickNews.scrollStart();