﻿var currentItem = 1;
var testimonialCount = 4;
var tickInterval = 7000;
var fadeTime = 500;
            
$(document).ready(function() 
{
    for(var i=2; i<= testimonialCount; i++)
    {
        $('#testimonial'+i).hide();
    }
});

function tick()
{
    var current = '#testimonial'+currentItem;
    if(++currentItem > testimonialCount)
    {
        currentItem = 1;
    }
    var next = '#testimonial'+(currentItem);
    $(current).fadeTo(fadeTime, 0.1, function()
                                {
                                    $(next).fadeTo(fadeTime, 1);
                                    $(current).hide();
                                });
    setTimeout('tick()', tickInterval);
}

setTimeout('tick()', tickInterval);