// <body  bgcolor="#CC0000" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0" onLoad="snow()">

SnowFlakeImage = "/asfvolley/themes/standard/images/ball_grey.gif";
NbFlakes = 5;
Y = new Array();
X = new Array();
S = new Array();
A = new Array();
B = new Array();
M = new Array();
V = (document.layers ? 1 : 0);
H = 0;
W = 0;
T = 0;
L = 0;

function snow(img, count)
{
	SnowFlakeImage = img;
	NbFlakes = count;
	iH = (V ? window.innerHeight : window.document.body.clientHeight - 30);
	iW = (V ? window.innerWidth : window.document.body.clientWidth - 50);
	
	for (i=0; i < NbFlakes; i++)
	{
		Y[i]=Math.round(Math.random()*iH);
		X[i]=Math.round(Math.random()*iW);
		S[i]=Math.round(Math.random()*5+1);
		A[i]=0;
		B[i]=Math.random()*0.1+0.1;
		M[i]=Math.round(Math.random()*1+5);
		obj = document.getElementById('si'+i);
		obj.src = img;
	}
	/******
	if (V)
	{
		for (i = 0; i < NbFlakes; i++)
		{
			document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 ><img src='"+snowsrc+"'></LAYER>")
		}
	}
	else
	{
		for (i = 0; i < NbFlakes; i++)
		{
			document.write('<img id="si'+i+'" style="position:absolute;top:0;left:0;" src="+snowsrc+">')
		}
	}
	***/
	setTimeout('snow_repeat()',75);
}
function snow_repeat()
{
	H =(document.layers)?window.innerHeight:window.document.body.clientHeight - 30;
	W =(document.layers)?window.innerWidth:window.document.body.clientWidth - 50;
	T =(document.layers)?window.pageYOffset:document.body.scrollTop;
	L =(document.layers)?window.pageXOffset:document.body.scrollLeft;
	for (i=0; i < NbFlakes; i++)
	{
		sy=S[i]*Math.sin(90*Math.PI/180);
		sx=S[i]*Math.cos(A[i]);
		Y[i]+=sy;
		X[i]+=sx;
		if (Y[i] > H)
		{
			Y[i]=-10;
			X[i]=Math.round(Math.random()*W);
			M[i]=Math.round(Math.random()*1+1);
			S[i]=Math.round(Math.random()*5+2);
		}
		if (V)
		{
			document.layers['sn'+i].left=X[i];
			document.layers['sn'+i].top=Y[i]+T
		}
		else
		{
			obj = document.getElementById('si'+i);
			obj.style.visibility = "visible";
			obj.style.left=X[i];
			obj.style.top=Y[i]+T
		}
		A[i]+=B[i];
	}
	setTimeout('snow_repeat()',75);
}
//-->

