var secs
var timerID = null
var timerRunning = false
var delay = 1000
var testNum = 1;
var totalTests = 5;

function InitializeTimer()
{
    // Set the length of the timer, in seconds
//    secs = 3
//    StopTheClock()
//    StartTheTimer()
	RandomTestimonial()
}

var lastDiv = "";
function showDiv(divName) {
	if (divName && document.getElementById(divName)) {
		document.getElementById(divName).className = "visibleDiv";
		lastDiv = divName;
	}
}
function hideDiv(divName){
	document.getElementById(divName).className = "hiddenDiv";
}


function RandomTestimonial() {
	var randomnumber=Math.floor(Math.random()*4) + 1
	showDiv('testimonial'+randomnumber)
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer() {
try{
    if (secs==0)
    {
        //StopTheClock()
        // Here's where you put something useful that's
        // supposed to happen after the allotted time.
        // For example, you could display a message:
		//alert("You have just wasted 10 seconds of your life.")
		if(testNum == totalTests){
			testNum = 1
			document.getElementById('partner5').style.display = "none"; 
			secs = 3
			document.getElementById('partner'+testNum).style.display = "block"; 
		} else {
			document.getElementById('partner'+testNum).style.display = "none"; 
			testNum = testNum+1
			secs = 3
			document.getElementById('partner'+testNum).style.display = "block"; 
		}
		StopTheClock()
		StartTheTimer()
    }
    else
    {
        //self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
    }
    catch(Error){}
}