$(document).ready(function(){
	resizeMain();
	
	$('#home_nieuws').each(function(){
		function next(){
			divs.eq(current).stop(true, true).slideUp(1000, 'swing');
			
			current++;
			if(current == count)
				current = 0;
				
			divs.eq(current).appendTo($('#home_nieuws')).stop(true, true).slideDown(1000, 'swing');
		}
		
		var divs = $(this).find('> div');
		var count = divs.length;
		var current = 0;
		
		if(count > 1){
			divs.filter(':gt(0)').hide();
			
			setInterval(next, 5000);
		}
	});
});


window.onresize = resizeMain;

function resizeMain(){
	mainheight = document.body.clientHeight - 333;
	document.getElementById('main').style.height = mainheight + 'px';
}
