// News script
var cInfo = 
{
	'content': null,
	'pos': 160, // default
	'height': 0,
	'step': 1,
	'rate': 40,
	'spacing': 15
};

var moveConst = 1;
function stopMovement(stop)
{
	if (stop)
		moveConst = 0;
	else
		moveConst = 1;
}

function scrollNews() 
{
	if (moveConst)
	{
		var pos = cInfo.pos;
		pos -= cInfo.step
		if (pos <= -cInfo.height) pos = 0; 
		cInfo.pos = pos;
		cInfo.content.style.top = pos + 'px';
	}
	setTimeout(scrollNews, cInfo.rate);
	
}
		
function initNews(pos)
{
	cInfo.pos = pos;
	var content = document.getElementById("mCont");
	document.getElementById('ss').style.marginBottom = cInfo.spacing + 'px';
	cInfo.spacing = parseInt(document.getElementById('ss').style.marginBottom);
	while(cInfo.spacing + document.getElementById('ss').offsetHeight < document.getElementById('mBox').offsetHeight)
		cInfo.spacing += 10;
	document.getElementById('ss').style.marginBottom = cInfo.spacing + 'px';
	var height = document.getElementById('ss').offsetHeight + cInfo.spacing;
	var smth = document.getElementById("ss");
	smth.style.visibility = 'visible';
	var clone = smth.cloneNode(true);
	clone.style.top = height + 'px';
	content.appendChild(clone);
	cInfo.content = content;
	cInfo.height = height;
	if(document.layers) content.captureEvents(Event.MOUSEDOWN); // if using ns4
	scrollNews();     
}

// End of news script
