$(document).ready(function(){	
	
	//Declare variables for carousel
	totalSlides = $('ul.overview li').size()+1;
	count = 0;
	play=true;
	activeTitle='alt';
	redSlide = false;

	
	//Stop the auto play on mouse over with any overview item
	$('ul.overview, a.buttons, div#slider-code').mouseenter(function(){ $('div#slider-code').tinycarousel_stop(); return false; });	
		
	//Call the carousel with autoplay and timer
	$('div#slider-code').tinycarousel({start:1, pager: true, interval:true, intervaltime:6000, duration: 500, callback: function(element, index){


			// Updates the number of progressed slides
			count ++;
			
			// If numbers passed is equal to number of slides...
			if(count >= totalSlides || count == totalSlides || play==false){$('#slider-code').tinycarousel_stop();}
			
			$('ul.overview li.active-slide').removeClass('active-slide');
			$(element).addClass('active-slide');
			

			
		}
	});							
});


