﻿// JScript File
$(function(){
    var swapSpeed = 3000;
    var testimonials = $(".speaker-widget");
    var currentTestimonial = 0;
    window.setTimeout(function(){SwapTestimonial()}, swapSpeed);
    
    function SwapTestimonial()
    {
        testimonials.eq(currentTestimonial).fadeOut("slow").hide();
       
        //1-2-3-4-1-2-3-4-1-2-3-4 logic
        if((currentTestimonial + 1) == testimonials.length) currentTestimonial = 0;
        else currentTestimonial++;

        testimonials.eq(currentTestimonial).fadeIn("slow").show();
        window.setTimeout(function(){SwapTestimonial()}, swapSpeed);
    }
});

