var margin = 6;
var speed = 30;
var stopspeed = 5000;
var nieuws_actueel;

function begin () {
	nieuws_actueel = document.getElementById ("nieuws_actueel");
	if (nieuws_actueel.hasChildNodes ()) {
		for (var i = 0; i < nieuws_actueel.childNodes.length; i++) {
			if (nieuws_actueel.childNodes[i].nodeType == 1) {
				nieuws_actueel.childNodes[i].style.margin = margin + 'px';
			} else if (nieuws_actueel.childNodes[i].nodeType == 3) {
				nieuws_actueel.removeChild (nieuws_actueel.childNodes[i]);
				i--;
			}
		}
		setTimeout ("count(" + margin + ")", stopspeed);
	}
}

function count (counter) {
	counter--;
	setTimeout ("move(" + counter + ")", speed);
}

function move (counter) {
	nieuws_actueel.firstChild.style.marginTop = counter + 'px';
	if (counter > -(nieuws_actueel.firstChild.offsetHeight)) {
		count (counter);
	} else {
		setTimeout ("stack(" + counter + ")", stopspeed);
	}
}

function stack (counter) {
	var thischild = nieuws_actueel.firstChild;
	nieuws_actueel.removeChild (thischild);
	nieuws_actueel.appendChild (thischild);
	nieuws_actueel.lastChild.style.margin = margin + 'px';
	count (margin);
}