	var cntTestimonials = 0
	//Define scroll height
	var testimonialsScrollY = 115
	//Define delay between 2 testimonials
	var scrollDelay = 4000
	
	$(document).ready(function(){
		$("#testSideNext").live('click',function(){
			cntTestimonials++
			changeTestimonial()
		})
	
		$("#testSidePrev").live('click',function(){
			cntTestimonials--
			changeTestimonial()
		})
				
		//Start looping through testimonials
		loopTestimonials();
	})
	
	// Testimonials will loop if loop is set to true
	function changeTestimonial(loop) {
		if(!loop) {
			loop = false
			$("#testimonials-side").stopTime();
		}
		$("#testimonials-side-container div").animate({top:'-'+(cntTestimonials*testimonialsScrollY)+'px'})
		
		//Show/hide buttons
		if(cntTestimonials) $("#testSidePrev").css('display','block')
		else $("#testSidePrev").css('display','none')
		
		if(cntTestimonials < totalTestimonials) $("#testSideNext").css('display','block')
		else $("#testSideNext").css('display','none')
		
		if(loop) {
			loopTestimonials()
		}
	}
	
	function loopTestimonials() {
		$("#testimonials-side").oneTime(scrollDelay,function(){
			if(cntTestimonials != totalTestimonials) cntTestimonials++
			else cntTestimonials = 0
			changeTestimonial(true);
		});
	}
