﻿function testimonialRotator(testimonialContainer) {
    var container = testimonialContainer;
    var hme_page_testimonials = container.find("p");
    var current = container.find("p:first");
    var timer = null;
    var startTimer = function() {
        timer = setTimeout('testimonialRotate.rotate()', 1000);
    };
    this.rotate = function() {
        current.animate({ width: 0 }, 2000, function() {
            current.css("width", "0").css("display", "none");
            current = current.next("p");
            if (current.size() == 0) current = container.find("p:first");
            current.css("display", "block").animate({ width: 500 }, 2000);
            startTimer();
        });
    };
    this.start = function() {
        startTimer();
    };
}
