// JavaScript Document
$(document).ready(function(){
	
	// Referentie image switcher
	$("#container #content #contentRef p.thumbs a").click(function(){
		var largePath = $(this).attr("href");
		var largeAlt = $(this).attr("title");
		$("#container #content #contentImg3 #largeImg").attr({ src: largePath, alt: largeAlt });
		return false;
	});
	
	// Clickable Boxes voor zijkanten
	$('#container #content #boxes #box1').click(function(event) {
		window.location.href = $('a', this).attr('href');
		return false;
	});
	
	$('#container #content #boxes #box2').click(function(event) {
		window.location.href = $('a', this).attr('href');
		return false;
	});
	
	$('#container #content #boxes #box3').click(function(event) {
		window.location.href = $('a', this).attr('href');
		return false;
	});
	
	$('#container #webview .alb1').click(function(event) {
		window.location.href = $('a', this).attr('href');
		return false;
	});
	
	$('#container #webview .alb2').click(function(event) {
		window.location.href = $('a', this).attr('href');
		return false;
	});
	
	$('#container #webview .alb3').click(function(event) {
		window.location.href = $('a', this).attr('href');
		return false;
	});
	
	$('#container #webview .alb4').click(function(event) {
		window.location.href = $('a', this).attr('href');
		return false;
	});

});

$(function() {
   $("#content #webview .webView").jCarouselLite({
		btnNext: "#content #webview .next",
		btnPrev: "#content #webview .prev",
		auto: 3000,
    	speed: 2500,
		visible: 1
	});
});

function slideSwitch() {
    var $active = $('#contentImg IMG.active');

    if ( $active.length == 0 ) $active = $('#contentImg IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#contentImg IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("slideSwitch()", 3500 );
});
