var curr_no = 1;
var timer_no = 1;
var rotate_timer = "";
var max_no = $(".slide").length;
//
function showItem(no){
	if(curr_no!=no){
		if(no > max_no){
			showItem(1);
		} else if(no < 1){
			showItem(max_no);
		} else{
			/* Afbeelding animaties */
			var currentIMG = $("#slide-"+curr_no);
			var nextIMG = $("#slide-"+no);
			nextIMG.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 1000);
			currentIMG.animate({opacity: 0.0}, 1000).removeClass('show');
			//
			curr_no = no;
			timer_no = no;
		}
	}
}
//
function RotateSlides(){
	/* CSS voor de afbeeldingen */
	$(".slide").css({opacity: 0.0});
	$(".slide.show").css({opacity: 1.0});
	//
	/* Start de slideshow */
	showItem(timer_no);
	timer_no++;
	if(timer_no>max_no){
		timer_no=1;
	}
	rotate_timer = setTimeout("RotateSlides()", 6000);
}
