function initSlideshow() {
	$('.sfeer .fotos').cycle({
		fx:     'fade',
		timeout: 2000,
		speed:	 2000
	});
}

function showPhoto() {
	var sSrc;
	$('.thumb img').click(function(){
		sSrc = $(this).attr('src').replace('_thumb','_normal');
		$('#foto_groot').animate({ 
				'opacity': 0 
			}, 200, 
			function(){
				$(this).attr('src',sSrc).animate({ 
				'opacity': 1 
			}, 400);
		});
		sLightbox = sSrc.replace('_normal','_lightbox');
		$(this).parents('.thumbs').prev('#foto').children('a').attr('href', sLightbox);
	});	
}

function initSubmenu() {
	//$(".submenu").fadeTo(0, 0.9);
	$("#menu ul li").hover(function() {
		$(this).children("ul.submenu").show();	
	},function() {
		$(this).children("ul.submenu").hide();
	});
}

function initCheckbox() {
	$('.aanhef').click(function(){
		$('.aanhef').removeClass('checked');
		$(this).addClass('checked');
		$('#sAanhef').attr('value', $(this).attr('title'));
	});
}

var iconOK = '<img src="images/template/icon-ok.gif" alt="" />';
var iconDisabled = '<img src="images/template/icon-disabled.gif" alt="" />';
var iconError = '<img src="images/template/icon-disabled.gif" alt="" />';

function validateContact(){
	$('#contactForm').validate({
		rules: {
			sNaam: 'required',
			sVoorletters: 'required',
			sEmail: {
				required: true,
				email: true
			}
		},
		messages: {
			sNaam: 'U heeft geen naam opgegeven.',
			sVoorletters: 'U heeft geen voorletters opgegeven.',
			sEmail: {
				required: 'U heeft geen e-mailadres opgegeven.',
				email: 'Dit is geen geldig e-mailadres.'
			}
		},
		errorPlacement: function(error, element){
			error.insertAfter(element.parent().next('span')).slideDown(300);
			element.parent().next('span.icon').html(iconError);
		},
		submitHandler: function(form) {
			form.submit();
			return false;
		},
		success: function(label){
			label.prev('span.icon').html(iconOK);
			label.remove();
		}
	});		
}