var no = 11; var speed = 5; var picture = "http://home.arcor.de/h.a/uebersicht/pfote.gif"; var browser_IE_NS = (document.body.clientHeight) ? 1 : 0; var browser_MOZ = (self.innerWidth) ? 1 : 0; var dx, xp, yp; var am, stx, sty; var time; var i, browser_Width, browser_Height; if (browser_IE_NS) { browser_Width = document.body.clientWidth; browser_Height = document.body.clientHeight; } else if (browser_MOZ) { browser_Width = self.innerWidth - 20; browser_Height = self.innerHeight; } 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()*(browser_Width-50); yp[i] = Math.random()*browser_Height; am[i] = Math.random()*20; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); if (i == 0) document.write("<\div id=\"flake"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 15px; left: 15px;\"><\img src=\""+picture+"\" border=\"0\"><\/div>"); else document.write("<\div id=\"flake"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 15px; left: 15px;\"><\img src=\""+picture+"\" border=\"0\"><\/div>"); } function snow() { for (i = 0; i < no; ++ i) { yp[i] += sty[i]; if (yp[i] > browser_Height-50) { xp[i] = Math.random()*(browser_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("flake"+i).style.top=yp[i] + document.body.scrollTop +"px"; document.getElementById("flake"+i).style.left=xp[i] + am[i]*Math.sin(dx[i]) + document.body.scrollLeft + "px"; } time = setTimeout("snow()", speed); } snow();