﻿var headline_count;
var current_headline = 0;

$(document).ready(function() {
    headline_count = $("div.testimonialitem").size();
    $("div.testimonialitem:eq(" + current_headline + ")").css('top', '15px');
    setInterval(headline_rotate, 10000); //time in milliseconds
});

function headline_rotate() {
    old_headline = current_headline % headline_count;
    new_headline = ++current_headline % headline_count;
    $("div.testimonialitem:eq(" + old_headline + ")").css('top', '260px');
    $("div.testimonialitem:eq(" + new_headline + ")").show().animate({ top: 15 }, "slow");
}

