
$(window).load(function(){
						   
	// Fly-out bar on pages					   
						   
	$("#greenslide li ").hide();
  	$("#greenslide").animate({  width: "568px" }, 1500, function() {
		$("#greenslide li ").fadeIn();
	});
	
	
	$("#greentabs li ").hide();
	$("#greentabs").animate({  width: "568px" }, 1500, function() {
		$("#greentabs li ").fadeIn();
	});



// Fadein-out images


    var currentItem = 0;
    var selectItem;
    var itemInterval;
    var itemCnt = $("div.slide-item").size();
    if(itemCnt > 1){
        item_interval = setInterval(slideNext,4000);
    }
	
    function slideNext(){
        if (currentItem == (itemCnt-1)){
            selectItem = 0;
        }
        else{
            selectItem = (currentItem+1);
        } 
        $("#slide-item-"+currentItem).hide();
        $("#slide-item-"+selectItem).fadeIn("slow");
        currentItem = selectItem;
    }
	

// Jquery Tabs


	$('#tabs div').hide(); // Hide all divs
	$('#tabs div:first').show(); // Show the first div
	$('#greentabs li a:first').addClass('huidige'); // Set the class of the first link to active
	
	$('#greentabs li a').click(function(){ //When any link is clicked
		$('#greentabs li a').removeClass('huidige'); // Remove active class from all links
		$(this).parent().addClass('huidige'); //Set clicked link class to active
		var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
		$('#tabs div').hide(); // Hide all divs
		$(currentTab).show(); // Show div with id equal to variable currentTab
		return false;
	});


//Swap Image on Click


			
	$(".detailoverzicht a").click(function(){
		
		
		var mainImage = $(this).attr("href"); //Find Image Name
		$("#LargeImg").attr({ src: mainImage });
			
		var Title = $(this).attr("href");
		$("#thumblink").attr({ href: Title });
					
		return false;		
	});

// Open links in a new window				


				
	$('a[href^="http://"]').attr({ 
		target: "_blank", 
    	title: "Deze link opent zich in een nieuw tabblad of scherm"
  	});
    							

// Fancybox call

	$("a.thickbox").fancybox({
					'titleShow'		: false,
					'transitionIn'	: 'elastic',
					'transitionOut'	: 'fade'
	});
});




