$(document).ready(function(){
	jQuery(function(){jQuery(document).pngFix();});

	$("a.zoom").fancybox();
	
	$("a[rel=fotogroep]").fancybox({
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over"><span style="float:right">Afbeelding ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>' + (title && title.length ? title : '&nbsp;' ) + '</span>';
		}
	});

	$('#header').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
	$('#logowissel').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
	$("#contactForm").validate({
		invalidHandler: function(e, validator) {
			var errors = validator.numberOfInvalids();
			if (errors) {
				var message = errors == 1
					? 'Er is ' + errors + ' veld nog niet gevuld. Deze is hieronder aangegeven.'
					: 'Er zijn ' + errors + ' velden nog niet gevuld. Deze zijn hieronder aangegeven.';
				$("div.error span").html(message);
				$("div.error").show();
				$("label.error").css('display','none');
			} else {
				$("div.error").hide();
			}
		}
	});
	
});

$(document).ready(function(){
	$("#menu").hover(
		function() {
			$(this).addClass("iehover");
		},
		function() {
			$(this).removeClass("iehover");
		}
	);
});
