Code
<!--Simply copy and paste just above </body></html> in your page.-->
<SCRIPT LANGUAGE="JavaScript">
<!-- Crazy Worm from Rainbow Arch -->
<!-- This script and many more from : -->
<!-- http://rainbow.arch.scriptmania.com -->
<!-- Crazy Worm from http://rainbow.arch.scriptmania.com
//Choose colours. Minimum of 2
colours=new Array('#ff0000','#00ff00','#ff00ff','#ffa500','#ffff00','#ffffff','#4488ff');
//Nothing needs altering past here
n4=(document.layers);
n6=(navigator.appName=="Netscape" && parseFloat(navigator.appVersion) >= 5)?true:false;
ie=(document.all);
o6=(navigator.appName.indexOf("Opera") != -1)?true:false;
num=(n6)?10:16;
psp=(n6)?num/3:num/4;
fix=(n6)?14:0;
y=10;
x=10;
py=0;
px=0;
vel=15;
rnd=0;
cnt=0;
alt=10;
dx=0;
vx=0;
hx=0;
dir=Math.floor(Math.random()*60+10);
if (n4){
for (i=0; i < num; i++)
document.write('<LAYER NAME="t'+i+'" LEFT=0 TOP=0 CLIP="0,0,'+i/psp+','+i/psp+'"></LAYER>');
}
else{
if (ie)
document.write('<div id="ies" style="position:absolute;top:0;left:0"><div style="position:relative">');
for (i=0; i < num; i++)
document.write('<div id="t'+i+'" style="position:absolute;top:0;left:0;width:'+i/psp+';height:'+i/psp+';font-size:1px">.</div>');
if (ie)
document.write('</div></div>');
}
function followleader(){
sy=(ie)?0:window.pageYOffset;
sx=(ie)?0:window.pageXOffset;
if (ie){
ies.style.top=document.body.scrollTop;
ies.style.left=document.body.scrollLeft;
}
for (i=0; i < num; i++){
randcol=colours[Math.floor(Math.random()*colours.length)];
temp1=(n4)?document.layers["t"+i]:document.getElementById("t"+i).style;
if (i < num-1){
temp2=(n4)?document.layers["t"+(i+1)]:document.getElementById("t"+(i+1)).style;
temp1.top=temp2.top;
temp1.left=temp2.left
}
else{
temp1.top=py+sy;
temp1.left=px+sx;
}
if (n4)temp1.bgColor=randcol;
else temp1.background=randcol;
}
}
function pth(){
cnt=0;
alt=Math.floor(5+Math.random()*10);
turns=new Array(40,-40,0,0,1,-1,4,-4,7,-7,10,-10,20,-20,2);
rnd=turns[Math.floor(Math.random()*turns.length)];
if (rnd==40||rnd==-40) alt=3;
else if (rnd==2){
vel=0;alt=20;
}
else{
vel=15;
alt=Math.floor(5+Math.random()*10);
}
}
function ani(){
cnt++;
if (cnt>=alt) pth();
h=(ie)?document.body.clientHeight:window.innerHeight;
w=(ie)?document.body.clientWidth:window.innerWidth;
dx=dir+=rnd;
y = vel*Math.sin(dx*Math.PI/180);
x = vel*Math.cos(dx*Math.PI/180);
if (dir < 0) dir+=360;
py+=y;
px+=x;
vx=180-dir;
hx=0-dir;
if ((py < 1) && (px < 1)) {py=1;px=1;dir=45}
if ((py < 1) && (px > w)) {py=1;px=w;dir=135}
if ((py > h) && (px < 1)) {py=h;px=1;dir=315}
if ((py > h) && (px > w)) {py=h;px=w;dir=225}
if (py < 1) {py=1;dir=hx;}
if (py > h-psp) {py=h-psp;dir=hx;}
if (px < 1) {px=1;dir=vx;}
if (px > w-(psp+fix)) {px=w-(psp+fix);dir=vx;}
followleader();
setTimeout('ani()',20);
}
ani();
//-->
</SCRIPT>
Example : http://maxx.ucoz.lv/Sc/crazywormszzz.html