var autoScroll = 1;
var autoTimeout = 50;
var timerScroll;
var inicialized = false;
var scrollHeight;
var divHeight;
var divTop;

function scroll(id,speed){
	if(!inicialized){
		scrollHeight = parseInt(document.getElementById(id).offsetHeight);
		divHeight = parseInt(document.getElementById('news').style.height);
		divTop = parseInt(document.getElementById('news').offsetTop);
		inicialized = true;
		speed = divHeight;
	}
	if(scrollHeight > divHeight){
		document.getElementById(id).style.top = speed+"px";
		if(speed == 0-scrollHeight){
			document.getElementById('text').style.top = divTop + divHeight;
			speed = divHeight;
		}
		speed--;
		timerScroll = window.setTimeout("scroll('" + id + "'," + speed + ")", autoTimeout)
	}
}