$(document).ready(function(){

	// clickable elements
	/*
	$(".clickable").click(
		function()
		{
		    window.location = $(this).attr("url");
		    return false;
		}
	).hover(
		function () {
			$(this).addClass("hover");
		},
		function () {
			$(this).removeClass("hover");
		}
	);
	*/
	
	$(".clickable_slide").click(
		function()
		{
		    window.location = $(this).attr("url");
		    return false;
		}
	);
	
	// fancyvideo youtube lightbox
	$("a[rel*='youtube']").click(function() {
		$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'title'			: this.title,
				'width'		: 680,
				'height'		: 495,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
				   	 'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
			});
	
		return false;
	});

	// init header slideshow
	$('#bigimg').cycle({ 
	    fx:     'fade', 
	    speed:   2000, 
	    timeout: 4000
	});

	// init slide slideshow
	$('#slides').cycle({ 
	    fx:     'turnDown', 
	    speed:   1000, 
	    timeout: 8000
	});
	
});

function send_newsletter_email()
{
	email = $("#newsletter_email").val();
	if (email=="E-mail adres...") return false;
	
	$.getJSON("/index.php?a=getjson&type=subscriber&email="+email, function(result){ 
	
		if (result=="ok")
			$("#newsletter_form").html("Bedankt! Er is een email naar jou verzonden waarmee je je aanmelding definitief kunt maken.");
		else
			$("#newsletter_message").html('<span class="error">Ongeldig e-mailadres ingevuld</span>');
		
	});
}


