--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
<script language="JavaScript1.2">
grphcs=new Array(6)
Image0=new Image();
Image0.src=grphcs[0]="/texiao/zzsc_demo/ye01.gif";
Image1=new Image();
Image1.src=grphcs[1]="/texiao/zzsc_demo/ye02.gif"
Image2=new Image();
Image2.src=grphcs[2]="/texiao/zzsc_demo/ye03.gif"
Image3=new Image();
Image3.src=grphcs[3]="/texiao/zzsc_demo/ye04.gif"
Image4=new Image();
Image4.src=grphcs[4]="/texiao/zzsc_demo/ye05.gif"
Image5=new Image();
Image5.src=grphcs[5]="/texiao/zzsc_demo/ye06.gif"
Amount=8;
Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
ns=(document.layers)?1:0;
ns6=(document.getElementById&&!document.all)?1:0;
if (ns){
for (I = 0; I < Amount; I++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write("<LAYER NAME='sn"+I+"' LEFT=0 TOP=0><img src="+rndPic+"></LAYER>");
}
}
else{
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (I = 0; I < Amount; I++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write('<img id="si'+I+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');
}
document.write('</div></div>');
}
WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
for (I=0; I < Amount; I++){
Ypos[I] = Math.round(Math.random()*WinHeight);
Xpos[I] = Math.round(Math.random()*WinWidth);
Speed[I]= Math.random()*5+3;
Cstep[I]=0;
Step[I]=Math.random()*0.1+0.05;
}
function fall(){
var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;
var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;
for (I=0; I < Amount; I++){
sy = Speed[I]*Math.sin(90*Math.PI/180);
sx = Speed[I]*Math.cos(Cstep[I]);
Ypos[I]+=sy;
Xpos[I]+=sx;
if (Ypos[I] > WinHeight){
Ypos[I]=-60;
Xpos[I]=Math.round(Math.random()*WinWidth);
Speed[I]=Math.random()*5+3;
}
if (ns){
document.layers['sn'+I].left=Xpos[I];
document.layers['sn'+I].top=Ypos[I]+hscrll;
}
else if (ns6){
document.getElementById("si"+I).style.left=Math.min(WinWidth,Xpos[I]);
document.getElementById("si"+I).style.top=Ypos[I]+hscrll;
}
else{
eval("document.all.si"+I).style.left=Xpos[I];
eval("document.all.si"+I).style.top=Ypos[I]+hscrll;
}
Cstep[I]+=Step[I];
}
setTimeout('fall()',20);
}
window.onload=fall
</script>