--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
<script language="JavaScript1.2">
var snowsrc="/texiao/zzsc_demo/snow.gif"
var no = 10;
var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
var dx, xp, yp;
var am, stx, sty;
var I, doc_width = 800, doc_height = 600;
if (ns4up||ns6up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
for (I = 0; I < no; ++ I) {
dx[I] = 0;
xp[I] = Math.random()*(doc_width-50);
yp[I] = Math.random()*doc_height;
am[I] = Math.random()*20;
stx[I] = 0.02 + Math.random()/10;
sty[I] = 0.7 + Math.random();
if (ns4up) {
if (I == 0) {
document.write("<layer name=\"dot"+ I +"\" left=\"15\" top=\"15\" visibility=\"show\"><a href=\"http://smallrain.net/\"><img src='"+snowsrc+"' border=\"0\"></a></layer>");
} else {
document.write("<layer name=\"dot"+ I +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"></layer>");
}
} else if (ie4up||ns6up) {
if (I == 0) {
document.write("<div id=\"dot"+ I +"\" style=\"POSITION: absolute; Z-INDEX: "+ I +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://smallrain.net\"><img src='"+snowsrc+"' border=\"0\"></a></div>");
} else {
document.write("<div id=\"dot"+ I +"\" style=\"POSITION: absolute; Z-INDEX: "+ I +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"></div>");
}
}
}
function snowNS() {
for (I = 0; I < no; ++ I) {
yp[I] += sty[I];
if (yp[I] > doc_height-50) {
xp[I] = Math.random()*(doc_width-am[I]-30);
yp[I] = 0;
stx[I] = 0.02 + Math.random()/10;
sty[I] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[I] += stx[I];
document.layers["dot"+I].top = yp[I];
document.layers["dot"+I].left = xp[I] + am[I]*Math.sin(dx[I]);
}
setTimeout("snowNS()", 10);
}
function snowIE_NS6() {
for (I = 0; I < no; ++ I) {
yp[I] += sty[I];
if (yp[I] > doc_height-50) {
xp[I] = Math.random()*(doc_width-am[I]-30);
yp[I] = 0;
stx[I] = 0.02 + Math.random()/10;
sty[I] = 0.7 + Math.random();
doc_width = ns6up?window.innerWidth : document.body.clientWidth;
doc_height = ns6up?window.innerHeight : document.body.clientHeight;
}
dx[I] += stx[I];
if (ie4up){
document.all["dot"+I].style.pixelTop = yp[I];
document.all["dot"+I].style.pixelLeft = xp[I] + am[I]*Math.sin(dx[I]);
}
else if (ns6up){
document.getElementById("dot"+I).style.top=yp[I];
document.getElementById("dot"+I).style.left=xp[I] + am[I]*Math.sin(dx[I]);
}
}
setTimeout("snowIE_NS6()", 10);
}
if (ns4up) {
snowNS();
} else if (ie4up||ns6up) {
snowIE_NS6();
}
</script>