function slideshow_function(){
	if(!Array.indexOf){
	  Array.prototype.indexOf = function(obj){
	   for(var i=0; i<this.length; i++){
		if(this[i]==obj){
		 return i;
		}
	   }
	   return -1;
	  }
	}

//count total amount of slides and substract 1 so the last slide isn't used in the animation and bullet points (contact form slide)
	var item_count_1 = $("#deelnemers #items_1 > .rotating_item").size();
	var item_count_2 = $("#deelnemers #items_1 > .rotating_item").size();
	
//generare first random slide nr
	var randomItem1 = Math.ceil(Math.random()*item_count_1);
	var randomItem2 = Math.ceil(Math.random()*item_count_2);
	
	//if the first 2 items are the same calculate a new one
	while (randomItem2==randomItem1)
	{
		var randomItem2 = Math.ceil(Math.random()*item_count_2);
	}
	
	//create an array to store the allready shown items
	var shownItems = new Array();
	
	//push first 2 items in the array
	shownItems.push(randomItem1);
	shownItems.push(randomItem2);
	
//hide all slides and afterwards show the first slide
	$('#deelnemers .rotating_item').hide();
	$('#deelnemers #items_1 .rotating_item:nth-child('+randomItem1+')').show(1000);
	$('#deelnemers #items_2 .rotating_item:nth-child('+randomItem2+')').show(1000);

//slideshow animation
	function animate_slideshow(){
		
		//hide all visible slides
		$('#deelnemers .rotating_item').hide(1000).delay(1500);
		
		//generare random slide nr
		var randomItem1 = Math.ceil(Math.random()*item_count_1);
		var randomItem2 = Math.ceil(Math.random()*item_count_2);
		
		//if all items are shown clear the array
		if (shownItems.length >= item_count_1 || shownItems.length >= item_count_2)
		{
			shownItems = [];
		}
		
		//if item 1 is allready shown calculate a new one
		while (shownItems.indexOf(randomItem1) >= 0) 
		{
			var randomItem1 = Math.ceil(Math.random()*item_count_1);
		}
		
		//if item 2 is allready shown calculate a new one and check if it isn't the same as item 1
		while (shownItems.indexOf(randomItem2) >= 0 || randomItem2==randomItem1) 
		{
			var randomItem2 = Math.ceil(Math.random()*item_count_2);
		}		
		
		//push items in the array
		shownItems.push(randomItem1);
		shownItems.push(randomItem2);
					
		//animate
		$('#deelnemers #items_1 .rotating_item:nth-child('+randomItem1+')').show(1000);
		$('#deelnemers #items_2 .rotating_item:nth-child('+randomItem2+')').show(1000);
	}

	setInterval(function() {
       animate_slideshow();
    }, 6000);

}
