$(document).ready(function(){

	// Scroll to #href
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
		&& location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target
			|| $('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				$('html,body')
				.animate({scrollTop: targetOffset}, 1000);
				return false;
			}
		}
	});	
	
	// Lightbox
	$("a.lightbox").fancybox();

	
	// Contact form opac - opmaak
	$(".fade").css("opacity","0.5"); // 50% opac
	$(".fade").hover(function () {
		// op mouse over
		$(this).stop().animate({opacity: 1.0}, "slow"); // opac naar 100%
	}, function () {
		// callback: op mouse out
		$(this).stop().animate({ opacity: 0.5}, "slow"); // opac terug op 50%
	});
	
	
	
	// Contactform validator
	
	$('#quoteform').ajaxContactForm(
			'lib/send_ajaxcontactform.php', 
			{	/*	Configuration goes here	*/	
			
				  
				  submitButton:		'.submit',
				  resetButton:		'.reset',
				  method:			'POST',
				  language:			'nl',
				  extraValues:		{},
				  falseFieldFunc:		function(form, field, language) {
					  field.effect("highlight", {color: '#dd0000'}, 1000);
				  },
				  falseMessageFunc:	function(form, language) { 
					  alert("Niet alle velden zijn correct ingevuld");
				  },
				  errorMessageFunc:	function(form, message, language) { 
					  alert(message); 
				  },
				  succesMessageFunc:	function(form, message, language) { 
					  $.fn.ajaxContactForm.resetForm(form);
					  alert(message);
				  }
			  
			
			}
		);


}); // END document.ready
		
      
