var scrollEnabled = true;
document.observe("dom:loaded", function() {
	
	fillerDiv = new Element('div', {'class':'nieuwsscrollfiller'});
	originalText = $('nieuwsscrollcontainer').innerHTML;
	$('nieuwsscrollcontainer').update('');
	$('nieuwsscrollcontainer').insert(fillerDiv);

	$('nieuwsscrollcontainer').insert(originalText);
	//$('nieuwsscrollcontainer').update(fillerDiv + originalText + fillerDiv);
	//alert($('nieuwsscrollcontainer').getHeight());
	$('nieuwsscrollcontainer').setStyle({
		top: '0px'
	});
	scrollUp('nieuwsscrollcontainer');
	$('nieuwsscroll').observe('mouseover',function(event){
		scrollEnabled = false;
	});

	$('nieuwsscroll').observe('mouseout',function(event){
		scrollEnabled = true;
	});
});

function scrollUp(elementid){
	if(scrollEnabled){
		//alert(Element.getStyle);
		var myTop = $(elementid).getStyle('top').replace('px','');
		//alert(elementid);
		//alert($(elementid));
		//var myTop = $(elementid).style.top;
		//alert(document.getElementById(element).style.top);
		var myHeight = $(elementid).getHeight();
		$(elementid).setStyle({
			'top': '' + myTop - 2 + 'px'
		});

			
		//alert(parseInt(height) + parseInt(top));
		if(parseInt(myHeight) + parseInt(myTop)< 0){
			$(elementid).setStyle({
				'top': '0px'
			});
		}
	}
	setTimeout('scrollUp(\''+elementid+'\')',50);
}
