var rotInterval = 15;
var rotCurrent = 1;
var rotMax = 1;
var rotTimer;
var rot_entries = new Array();

function rotStart()
{
	document.getElementById("rotbutton1").style.backgroundColor = "#3C6";
	rotTimer = setInterval("rotCheckTime()",rotInterval * 1000);
}

function rotCheckTime()
{
		if(rotCurrent == rotMax)
			rotChange(1);
		else
			rotChange(rotCurrent + 1);
}

function rotChange(rotIndex)
{
	var rotButton = document.getElementById("rotbutton" + rotCurrent);
	rotButton.style.backgroundColor = "#1BAA17";

	rotCurrent = rotIndex;

	rotButton = document.getElementById("rotbutton" + rotCurrent);
	rotButton.style.backgroundColor = "#3C6";
	var rotTitle = document.getElementById("rotator-title");
	var rotDesc = document.getElementById("rotator-left");
	var rotCont = document.getElementById("rotator-right");
//	var rotCaption = document.getElementById("rotatoroverlay");
	
	rotTitle.src = rot_entries[rotCurrent - 1][0].src;
	rotDesc.innerHTML = rot_entries[rotCurrent - 1][1];
	rotCont.style.backgroundImage = "url(" + rot_entries[rotCurrent - 1][2].src + ")";
//	rotCaption.innerHTML = rot_entries[rotCurrent - 1][3];
}

function rotChangeClick(rotIndex)
{
	clearInterval(rotTimer);
	rotChange(rotIndex);
}