var index = 0;
var g_numlights = 1;
var xpos = 200;
var ypos = 0;
var zpos = 0;
var stren = 90;
function DoOnLoad()
{
//scriptfx.onmousemove=mousehandler;
setTimeout("setlights()",500);
setTimeout("SwapColor()",100);
}

function killlights()
{
scriptfx.filters[0].Enabled = false;
}

function setlights(){
scriptfx.filters[0].clear();
scriptfx.filters[0].addAmbient(130,80,140,100);
setTimeout("setcone()",1500);
} // End setlights

function setcone()
{
scriptfx.filters[0].addcone(50,600,20,xpos,ypos,220,200,255,90,20);
setTimeout("movelight()",2000);
}

function keyhandler(){
g_numlights = (g_numlights += 1)%5;
setlights();
}

function movelight()
{
xpos = xpos + 15;
ypos = ypos + 10;
scriptfx.filters[0].movelight(1,xpos,ypos,20,1);
if ( xpos < 490 )
{
	setTimeout("movelight()",100);
}
else
{
	setTimeout("killlights()",2000);
}
}

function SwapColor()
{
var vorigeIndex = index -1;
if ( vorigeIndex > -1 )
{
	var vorigId = "l" + vorigeIndex;
	document.getElementById(vorigId).style.color = "yellow";
}

var id = "l" + index;
document.getElementById(id).style.color = "#99CCFF";
setTimeout("SwapColor()",100);
index++;
if ( index > 22 )
{
	index = 0;
}
if ( index == 0 )
{
	setTimeout("SwapLastColor()",200);
}
}	// end SwapColor

function SwapLastColor()
{
document.getElementById("l22").style.color = "yellow";
}
