$(document).ready(function() { 

	$("a.fancy").fancybox({
	 'overlayShow': true,
	 'frameWidth': 390,
	 'frameHeight': 520
	
	});
	
	$("a.fancy").click(function() {
	  var h= parseInt($(this).find('img').attr('rel'));
	  frameheight= h + parseInt(200);
	});
	
	// $('#fancy_outer').ready(function() {
	//  $(this).attr('style','top: 10px; left: 566px; height: '+frameheight+'px; width: 390px; display: block;');
	// });
	
	$("a.ffancyNOTUSED").fancybox({
	 'hideOnContentClick': true 
	}); 
	 
	$("a.ffancyNOTUSED").fancybox({ 
	 'zoomSpeedIn': 0, 'zoomSpeedOut': 0, 'overlayShow': true 
	});
	
	if($("#aanvraagkey").is('*')) {
	        $("#aanvraagkey").attr('value','owmpersaanvraag')
	}
        
	var timeout = setTimeout('onderwijsmuseumFixHeights()', 100);
	

       
 });


function onderwijsmuseumFixHeights() {

	//console.log('hoi');

	// Eerst de 'floatende' divjes een height geven, n.a.v. de plaatjes die er in staan
	$('.sameheight img').each(function(){
		// console.log( "x: " +  ($(this).attr('height')));
		$(this).parent().attr('height', $(this).attr('height') );
	});

    //zelfde hoogte voor verschillende floating columns naast elkaar
    equalHeight($(".sameheight"));

}

function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
	//console.log(tallest);
}
