// On document ready
$(document).ready(function(){		
	$('#photos').innerfade({
		speed: 1000,
		timeout: 5000,
		type: 'sequence',
		containerheight: '250px'
	});
	
	$("a[rel=gb_imageset]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">Afbeelding ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' - ' + title + '</span>';
		}
	});
	
	$("a.enews").fancybox({
		'width'				: 600,
		'height'			: 540,
		'autoScale'			: false,
		'type'				: 'iframe'
	});
	
	$(".rubriek").css({ opacity: 0.85 });
	
	$('.rubriek').each(function() {
		$(this).hover(function() {
			$(this).stop().animate({ opacity: 1.0 }, 500);
		},
	   function() {
		   $(this).stop().animate({ opacity: 0.9 }, 500);
	   });
	});
	
	$('.rubriek').click(function(){
		window.location = $(this).attr('rel');							 
	});

	$("#contactform").validationEngine({
		ajaxSubmit: true,
		inlineValidation: false, 
		ajaxSubmitFile: "/general/ajaxSubmit.php",
		ajaxSubmitMessage: "<p>Bedankt, we hebben uw gegevens goed ontvangen.</p>",
		success :  function() {},
		failure : function() {}
	});
	
	$("#callform").validationEngine({
		promptPosition: "topRight",
		ajaxSubmit: true,
		inlineValidation: false, 
		ajaxSubmitFile: "/general/ajaxSubmitCallFormStep1.php",
		ajaxSubmitMessage: "",
		success :  function() {
			window.location='/nl/bel-mij/';
		},
		failure : function() {}
	});
	
	$("#callmeform").validationEngine({
		promptPosition: "topRight",
		ajaxSubmit: true,
		inlineValidation: false, 
		ajaxSubmitFile: "/general/ajaxSubmitCallFormStep2.php",
		ajaxSubmitMessage: "<p>Bedankt, we hebben uw gegevens goed ontvangen.</p>",
		success :  function() {},
		failure : function() {}
	});
	
	$('#callform input').example(function() {
	  return $(this).attr('title');
	});
	
	 $('#banner2').innerfade({
		animationtype: 'fade',
		speed: 750,
		timeout: 4000,
		type: 'random',
		containerheight: '120px'
	});
});
