var marginbottom
var timer
var i_snow=0
var maxsnow=24

// Zufallsfunktion
function randommaker(range) {		
	rand=Math.floor(range*Math.random())
    return rand
}

// Initialisieren... da kommen schon die ersten Schneewolken
function initate() {
	if (document.all) {	
		marginbottom = document.body.clientHeight
		var thissnow = eval("document.all.snow"+i_snow+".style")
		thissnow.posLeft=(i_snow*40)-50
		thissnow.posTop=randommaker(marginbottom*2)-marginbottom
		if (i_snow >=maxsnow) {
			i_snow=0
			clearTimeout(timer)
			movesnow()
		}
		else {
			i_snow++
			initate()
		}	
	}
}

// bewegung, bewegung...
function movesnow() {
	if (document.all) {	
		for (i=0;i<=24;i++) {
			var thissnow = eval("document.all.snow"+i+".style")
			var rand=Math.floor(maxsnow*Math.random())
			thissnow.posLeft+=rand-12
			thissnow.posTop+=rand
			if (thissnow.posTop>=marginbottom){thissnow.posTop=-150}
		}
		timer=setTimeout("movesnow()",100)
	}
}
