
var current;
var rotations = 1;
$(document).ready(function() {
 	$(".nieuwsbanner").hide();
 	$(".informatie").hide();
	$("#nieuwsbanner_1").show();
	$("#informatie_1").slideDown();
	$("#1").addClass("highlighted");
	current = 1;
	rotationtime = 5000;
	actieveinstantie = 0;
	$(".topic").click(function  () {
                var nieuweinstantie;
		if(current!=$(this).attr('id')) {
			current = parseInt($(this).attr('id'));
			$('.nieuwsbanner').fadeOut("slow");
			$('#nieuwsbanner_'+current).fadeIn();
			$(".topic").removeClass("highlighted");
			$("#"+current).addClass("highlighted");
			$(".informatie").slideUp("300");
			$("#informatie_"+current).delay("300").slideDown("300");

		}
                nieuweinstantie = ++actieveinstantie;
                setTimeout(function() { loop(nieuweinstantie); }, rotationtime);
	});
	var changedzoeken;
	$("#zoeken").click(function() {
		if(changedzoeken != 1) {
			changedzoeken = 1;
			$(this).attr("value","") ;
		}
	});
        function next() {
                current = current+1;
                if(current == 5) {
                    current = 1;
                    rotations += 1;
                }
                $('.nieuwsbanner').fadeOut("slow");
                $('#nieuwsbanner_'+current).fadeIn();
                $(".topic").removeClass("highlighted");
                $("#"+current).addClass("highlighted");
                $(".informatie").slideUp("300");
                $("#informatie_"+current).delay("300").slideDown("300");
        }
        function loop(instantie) {
            if(instantie == actieveinstantie) {
                next();
                if(rotations !=5) {
                    setTimeout(function () { loop(instantie); },rotationtime);
                }
            }
        }
        setTimeout(function() { loop(++actieveinstantie); }, rotationtime);
        $("#youtube_box").hide();
        bijlagen = 0;
        youtube = 0;
        $("#youtube_icon").click(function() {
           switch (youtube) {
               case 0:
                    $("#youtube_box").fadeIn();
                    youtube++;
                    break;
               case 1:
                    $("#youtube_box").fadeOut();
                    $("#youtube").val("");
                    youtube--;
                    break;
           }

        });

        $(".albumgroep").hide();
        $(".albumcategorie").click(function() {
            $(".albumgroep").hide();
            $(this).find("ul").fadeIn();
        });
});




Cufon.replace("#menu, #footer",{ fontFamily: 'Rockwell'})


