var timeout;

function playspotlight()
{
	timeout = setInterval('swap()', 5000);
	document.getElementById("playspotlightbutton").setAttribute("class", "spotlighthidden");
	document.getElementById("pausespotlightbutton").setAttribute("class", "spotlight");
}

function pausespotlight()
{
    clearInterval(timeout);
    document.getElementById("playspotlightbutton").setAttribute("class", "spotlight");
	document.getElementById("pausespotlightbutton").setAttribute("class", "spotlighthidden");
}

function swap()
{  
	if(document.getElementById("spotlight01").style.display=='block')
		displayspotlight02();
	else if(document.getElementById("spotlight02").style.display=='block')
		displayspotlight03();  
	else if(document.getElementById("spotlight03").style.display=='block')  
		displayspotlight04();
	else if(document.getElementById("spotlight04").style.display=='block')  
		displayspotlight01();  
}

function displayspotlight01()
{
	document.getElementById("spotlight01").style.display='block';  
	document.getElementById("spotlight02").style.display='none';  
	document.getElementById("spotlight03").style.display='none';
	document.getElementById("spotlight04").style.display='none';
	resetbuttons();
	document.getElementById("spotlight01button").setAttribute("class", "spotlightselected");
}
function displayspotlight02()
{
	document.getElementById("spotlight01").style.display='none';  
	document.getElementById("spotlight02").style.display='block';  
	document.getElementById("spotlight03").style.display='none';
	document.getElementById("spotlight04").style.display='none';
	resetbuttons();
	document.getElementById("spotlight02button").setAttribute("class", "spotlightselected");
}
function displayspotlight03()
{
	document.getElementById("spotlight01").style.display='none';  
	document.getElementById("spotlight02").style.display='none';
	document.getElementById("spotlight03").style.display='block';
	document.getElementById("spotlight04").style.display='none';
	resetbuttons();
	document.getElementById("spotlight03button").setAttribute("class", "spotlightselected");
}
function displayspotlight04()
{
	document.getElementById("spotlight01").style.display='none';  
	document.getElementById("spotlight02").style.display='none';
	document.getElementById("spotlight03").style.display='none';
	document.getElementById("spotlight04").style.display='block';
	resetbuttons();
	document.getElementById("spotlight04button").setAttribute("class", "spotlightselected");
}
function resetbuttons()
{
	document.getElementById("spotlight01button").setAttribute("class", "spotlight");
	document.getElementById("spotlight02button").setAttribute("class", "spotlight");
	document.getElementById("spotlight03button").setAttribute("class", "spotlight");
	document.getElementById("spotlight04button").setAttribute("class", "spotlight");
}

function fspotlight01()
{
	displayspotlight01();
	pausespotlight();
}
function fspotlight02()
{
	displayspotlight02();
	pausespotlight();
}
function fspotlight03()
{
	displayspotlight03();
	pausespotlight();
}
function fspotlight04()
{
	displayspotlight04();
	pausespotlight();
}
