ÿþ<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 if(count==0){ document.all.test.filters.Light(1).addcone(50,70,z,50,70,0,green,0,100,90); dim=setTimeout("clearme()",flashrate) } if(count==1){ document.all.test.filters.Light(1).addcone(150,70,z,150,70,green,green,0,100,90); //yellow dim=setTimeout("clearme()",flashrate) } if(count==2){ document.all.test.filters.Light(1).addcone(250,70,z,250,70,red,0,0,100,90); dim=setTimeout("clearme()",flashrate) } if(count==3){ document.all.test.filters.Light(1).addcone(350,70,z,350,70,0,0,blue,100,90); dim=setTimeout("clearme()",flashrate) } if(count==4){ document.all.test.filters.Light(1).addcone(450,70,z,450,70,red,0,blue,100,90); dim=setTimeout("clearme()",flashrate) } if(count==5){ document.all.test.filters.Light(1).addcone(550,70,z,550,70,red,green,blue,100,90); dim=setTimeout("clearme()",flashrate) } timez=setTimeout("checknum()",speed) } 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 } setTimeout("checknum()",1000) // --> </script> <div id="test" style="position:absolute;left:80; top:100;filter:Light(1);width:600;height:140;background-color:white; border:10 ridge black;text-align:center;font-size:100"></div> <div align=center><a href="http://jsbank.topcities.com">jsbank.topcities.com</a></div> </body>