$(document).ready(function(){ 

	setHeight('.gelijk2', 0);
	setHeight('.gelijk', 0);

	$("div.trans_omranding").wrap('<div class="transbox">'+ 
	'<div class="middle_right">'+ 
	'<div class="middle_left">'+ 
	'<div class="middle_center">'+ 
	'</div>'+ 
	'</div>'+ 
	'</div>'+ 
	'</div>');
	$('div.transbox').prepend('<div class="top_right">'+
	'<div class="top_left"></div>'+
	'</div>')
	.append('<div class="bottom_right">'+
	'<div class="bottom_left"></div>'+
	'</div>');
	
	$("div.blauw_omranding").wrap('<div class="transbox_blue">'+ 
	'<div class="middle_right">'+ 
	'<div class="middle_left">'+ 
	'<div class="middle_center">'+ 
	'</div>'+ 
	'</div>'+ 
	'</div>'+ 
	'</div>');
	$('div.transbox_blue').prepend('<div class="top_right_blue">'+
	'<div class="top_left_blue"></div>'+
	'</div>')
	.append('<div class="bottom_right">'+
	'<div class="bottom_left"></div>'+
	'</div>');
	
	$('.transbox').each(function(){
		$('.top_left', this).append($(".box_title", this));
		$('.bottom_left', this).append($(".box_readmore", this));
	});
	$('.transbox_blue').each(function(){
		$('.top_left_blue', this).append($("h3.h3", this));
		$('.bottom_left', this).append($(".home_news_readmore", this));
	});
	
	if ($('.slideshow')) {
		$('.slideshow').cycle({
			fx: 'fade',
			timeout: 4000,
			speed: 4000
		});
	}
	if ($('.leden_slideshow')) {
		$('.leden_slideshow').cycle({
			fx: 'fade',
			random: 'true'
		});
	}
});


function setHeight(col, maxHeight) {
	//Get all the element with class = col
	col = $(col);
	
	//Loop all the col
    col.each(function() {
		//Store the highest value
		if($(this).height() > maxHeight) {
            maxHeight = $(this).height();
        }
    });
	
	//Set the height
    col.height(maxHeight);
}