<!--	
var	noPx = document.childNodes ? 'px' : 0;
var availx = (document.layers) ? innerWidth : document.body.clientWidth;
var wind = 2; // wind direction neg left, 0 down, pos right
var numFlakes = 15;
var fallRange = 10;
var availy = 800;
var fallRate = new Array(numFlakes);  // holder for each flakes fall rate
var curX, curY, flakeRef, flakeString, timeID;

function distributeFlakes() {
	for (i=0; i<numFlakes; i++) {
		fallRate[i] = random(fallRange);
		y = (-1 * random(350));
		flakeString = 'flake' + i;
		flakeRef = getRefToDiv(flakeString);
		if (flakeRef.style) {flakeRef = flakeRef.style;}
		flakeRef.left = random(availx) + noPx;
		flakeRef.top = y + noPx;
	}
}

function genSnow() {
	snow();
	timeID = setTimeout("genSnow()",100);
}

function getRefToDiv(divID,oDoc) {
	if (!oDoc) {oDoc = document;}
	if (document.layers) {
		if (oDoc.layers[divID]) {
			return oDoc.layers[divID];
		} else {
			for (var x=0,y; !y && x < oDoc.layers.length; x++) { y = getRefToDiv(divID,oDoc.layers[x].document); }
			return y;
		}
	}
	if (document.getElementById) {return document.getElementById(divID);}
	if (document.all) {return document.all[divID];}
	return false;
}	

function init() {
	slidePiano(availy);
	distributeFlakes();
	genSnow();
}

function random(limit) {
	return (Math.round(((Math.random())*1000))%limit)+1;
}

function resizeIt() {
	clearTimeout(timeID);
	top.location.reload();
}

function slidePiano(currentY) {
	if (currentY > stopYpiano) {
		currentY -=3
		pianoRef = getRefToDiv('pianoLayer');
		if (pianoRef.style) {pianoRef = pianoRef.style;}
		pianoRef.top = currentY;
		setTimeout('slidePiano('+currentY+')',1);
	}
}

function snow() {
    for (i=0; i<numFlakes; i++) {
		flakeString = 'flake' + i;
		flakeRef = getRefToDiv(flakeString);
		if (flakeRef.style) {flakeRef = flakeRef.style;}
		// determine flakes current coordinates
		curX = parseInt(flakeRef.left);
		curY = parseInt(flakeRef.top);
		if (curY > availy) {
			curY = (-1 * random(100));
			fallRate[i] = random(fallRange);
			curX = random(availx);
			wind = random(5) - 3;
		}
		if (curX < 80) {
			curX = availx;
		} else if (curX > availx) {
			curX = 80;
		}
		flakeRef.left = (curX + wind) + noPx;
		flakeRef.top = (curY + fallRate[i]) + noPx;
	}
}
	
window.onload = init;
// -->
