$(document).ready(function () {

	$(".case-headers").slideUp("fast", function(){
	});
	
	$("a.grouped-elements").fancybox();
	
	if($('#nav li').hasClass('current_page_item')){
	}
	else{
		$('#nav .home').css("background", "url('http://www.rolandpastoor.nl/wp-content/themes/rolandpastoor/images/lijn.png') repeat-x");
	};
	
	$(".post").mouseenter(function() {
		$(this).css("border", "2px solid #800000");
		$(this).find(".case-headers").slideDown("fast", function(){
		});
	});
	
	$(".post").mouseleave(function() {
		$(this).css("border", "2px solid #fff");
		$(".case-headers").slideUp("fast", function(){
		});
	});	

	var ih = $('.image-headers-container'); 
	var $container = $(".single-post-images").cycle({
	fx: 'scrollLeft',
	timeout: 5000,
	speed: 1200,
	fit: 0,
	height: 'auto',
	pause: 'true',
	autostop: 0,
	autostopCount: 0,
	pager:  'a.image-headers-link'
	});

	
	$container.children().each(function(i) { 
    // create input 
    $('') 
        // append it to button container 
        .appendTo(ih) 
        // bind click handler 
        .click(function() { 
            // cycle to the corresponding slide 
            $container.cycle(i); 
            return false; 
        }); 
	}); 


	var validator = $('#formulier').validate({
		validClass: "success",
		rules: {
			naam: {
				required: false
				},
			mail:{
				required: true,
				email: true
				},
			bericht: {
				required: true,
				minlength: 2
				}},
		messages:{
			mail: {
				required: "Een geldig e-mail adres is verplicht",
				email: "Het email adres moet de opmaak 'naam@domein.nl' hebben."
				},
			bericht: "Er is geen bericht ingetypt.<br /> E&eacute;n zin is al voldoende.",
			}
		});
	
});
