//<!-- Begin
var no = 20; // количество рисунков
var speed = 20; // скорость движения
var snowflake = "/javafl/snow.gif"; //адрес рисунка

var dx, xp, yp;
var am, stx, sty;
var i;

var doc_width  = document.body.clientWidth;

//document.body.offsetWidth;

var doc_height = document.body.clientHeight;


//document.body.offsetHeight;

//alert(doc_width + ' ' + doc_height);

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();


document.write("<div id=\"dot"+ i +"\" style='z-index: 254; position:absolute;left:15px;top:15px;' ");

document.write("><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
}


function snow() {
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();
}
dx[i] += stx[i];
document.getElementById("dot"+i).style.top = yp[i] + "px";
document.getElementById("dot"+i).style.left = (xp[i] + am[i]*Math.sin(dx[i])) + "px";
}
setTimeout("snow()", speed);
}


snow();

// End -->





