
var Snow_Flake = "images/xmas/snow-flake.gif";
var Snow_no = 15;

var Snow_browser_IE_NS = (document.body.clientHeight) ? 1 : 0;
var Snow_browser_MOZ = (self.innerWidth) ? 1 : 0;
var Snow_browser_IE7 = (document.documentElement.clientHeight) ? 1 : 0;

var Snow_Time;
var Snow_dx, Snow_xp, Snow_yp;
var Snow_am, Snow_stx, Snow_sty; 
var i, Snow_Browser_Width, Snow_Browser_Height;

if (Snow_browser_IE_NS)
{
	Snow_Browser_Width = document.body.clientWidth;
	Snow_Browser_Height = document.body.clientHeight;
}
else if (Snow_browser_MOZ)
{
	Snow_Browser_Width = self.innerWidth - 40;
	Snow_Browser_Height = self.innerHeight;
}
else if (Snow_browser_IE7)
{
	Snow_Browser_Width = document.documentElement.clientWidth;
	Snow_Browser_Height = document.documentElement.clientHeight;
}


Snow_dx = new Array();
Snow_xp = new Array();
Snow_yp = new Array();
Snow_am = new Array();
Snow_stx = new Array();
Snow_sty = new Array();

for (i = 0; i < Snow_no; ++ i) 
{ 
	Snow_dx[i] = 0; 
	Snow_xp[i] = Math.random()*(Snow_Browser_Width-50);
	Snow_yp[i] = Math.random()*Snow_Browser_Height;
	Snow_am[i] = Math.random()*20; 
	Snow_stx[i] = 0.02 + Math.random()/10;
	Snow_sty[i] = 0.7 + Math.random();
	if (i == 0) document.write("<\div id=\"Snow_flake"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 15px; left: 15px;\"><\/div>");
	else document.write("<\div id=\"Snow_flake"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 15px; left: 15px;\"><\img src=\""+Snow_Flake+"\" border=\"0\"><\/div>");
}

function Snow_Weather() 
{ 

for (i = 0; i < Snow_no; ++ i) 
{ 
	Snow_yp[i] += Snow_sty[i];

	if (Snow_yp[i] > Snow_Browser_Height-40) 
	{
		Snow_xp[i] = Math.random()*(Snow_Browser_Width-Snow_am[i]-30);
		Snow_yp[i] = 0;
		Snow_stx[i] = 0.02 + Math.random()/10;
		Snow_sty[i] = 0.7 + Math.random();
	}

	Snow_dx[i] += Snow_stx[i];

	document.getElementById("Snow_flake"+i).style.top=Snow_yp[i]+"px";
	document.getElementById("Snow_flake"+i).style.left=Snow_xp[i] + Snow_am[i]*Math.sin(Snow_dx[i])+"px";
}

Snow_Time = setTimeout("Snow_Weather()", 10);

}

Snow_Weather(); 
