<head><title>Disco Lights</title></head> <body> <script language="javascript"> <!-- z=100 flash=0.75 // permanent flash.time light is off before next light is lit. higher flashrate leaves light on longer timez="" thisnum=0
function checknum(){ //prevent showing the same colour light in sequence. ie red after red lastnum=thisnum count=Math.round(Math.random()*5) if(count==lastnum){ checknum()} else{ thisnum=count preview() } }
function preview(){ clearTimeout(timez) red=100+Math.round(Math.random()*155) green=100+Math.round(Math.random()*155) blue=100+Math.round(Math.random()*155)
speed=50+Math.round(Math.random()*400) //100=minspeed, 100+400=maxspeed //flash=0.1+Math.random()*0.9 // for random flash rate each run. higher flashrate leaves light on longer flashrate=speed*flash // time light is off before next light is lit.
//count=Math.round(Math.random()*5) // transfered to function checknum
function clearme(){ test.filters.Light(1).clear(); document.all.test.filters.Light(0).Addambient(50,50,50,50) // colour and intensity of background light return }