$(function() {
    setInterval("rotateTestimonial()", 15000);
    var $active = $("#testimonials .testimonial:nth-child(" + Math.floor(Math.random()*11) + ")");
    $active.addClass("active");
});

function rotateTestimonial() {
  var $active = $("#testimonials .active");
  if ($active.length == 0) $active = $("#testimonials .testimonial:first");
  var $next =  $active.next().length ? $active.next() : $("#testimonials .testimonial:first");

  $active.removeClass("active").fadeOut(500, function() {
  	$next.fadeIn(500).addClass("active");
	});
}
