/**
 * 
 */
$(document).ready(function() {
	$('#coda-slider-1').codaSlider( {
		dynamicArrows: false,
		dynamicTabsPosition: "bottom",
		dynamicTabsAlign: "left",
		autoSlide: true
		
	});
	
	$("#werk li a").fancybox({
		'padding'			: 0,
		'width'				: '90%',
		'height'			: '90%',
		'titlePosition'		: 'inside',
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'type'				: 'iframe'
	});
	
	$("#werk li a img").fadeTo("fast", 0.6);
	$("#werk li a img").hover(function(){
		$(this).fadeTo("slow", 1.0); // This should set the opacity to 100%	on hover
	},function(){
		$(this).fadeTo("slow", 0.6); // This should set the opacity back to 30% on mouseout
	}); 
	
	var v = jQuery("#contactFormulier").validate({
		submitHandler: function(form) {
			jQuery(form).ajaxSubmit({
				target: "#contactFormulier"
			});
		},
		rules: {
	    	name: "required",
	    	email: {
	    		required: true,
	    		email: true,
	    	},
	    	message: "required"
	    },
	    messages: {
			name: "Ik zou graag uw naar willen weten.",
			email: {
				required: "Dit kan geen e-mailadres zijn.",
				email: "Zonder e-mailadres kan ik u niet terug mailen."
			},
			message: "Als u iets wilt weten, zou ik wel willen weten wat..."
		},
	    errorPlacement: function(error, element) {
            error.appendTo('#err');
        }
	});
	
	jQuery("#reset").click(function() {
		v.resetForm();
	});

	
	
});
