// JavaScript Document

function equalHeights() {
	var height = 494
	if ($('#container_subsubnavigatie').height() > height) {
		height = $('#container_subsubnavigatie').height()
	}
	if ($('#container_webpagina').height() > height) {
		height = $('#container_webpagina').height()
	}
	if ($('#container_foto').height() > height) {
		height = $('#container_foto').height()
	}
	$('#container_subsubnavigatie').height(height);
	$('#container_webpagina').height(height);
	$('#container_foto').height(height);
}

$(document).ready(function () {

	$('img[src$=.png]').ifixpng();
	
	equalHeights();
	
	if ($(window).height() <= 768) {
		$('#sfeerfotos_home').css({'height':'180px','overflow-y':'hidden'});
		$('#sfeerfotos_home div').css({'margin-top':'-22px'});
	}
	
	$('#container_hoofdnavigatie_balk').fadeTo('fast',0.6);

	$('#sfeerfotos').cycle({
		random:1,
		speed:3500, 
		timeout:7000 
	});
	$('#sfeerfotos').show();

	$("a.fancybox").fancybox({
		'zoomSpeedIn'			: 600,
		'zoomSpeedOut'			: 500,
		'easingIn'				: 'easeOutBack',
		'easingOut'				: 'easeInBack'
	});
	
	$('a.email').each(function(){
		e = this.rel;
		e = splitext = e.split("");
		revertext = splitext.reverse();
		reversed = revertext.join("");
		reversed = reversed.replace('[a]','@');
		reversed = reversed.replace(/\[\!\]/g,'.');
		this.href = 'mailto:' + reversed + '?subject=' + $(this).attr('subject');
		$(this).text(reversed);
	});
	
});