rainSpeed = 3;trajectory = 0;image="/Quickstart/SiteSparks/WeatherEffects/snowflakes.gif";	maxradius = 20;//for oscillatory trajectory
	rainAngle = 20;
	maxdrops = 15;

	maxx = document.body.clientWidth-20
	maxy = document.body.clientHeight-10

	drops = new Array();
function degToRad (cangle) {
	return (cangle/ 180) * 3.142;
}

//object of a drop/flake
function dropObject(new_id)
{
	var angle, speed;

	this.radius = Math.ceil(Math.random()*maxradius);
	this.curx =Math.ceil(Math.random()*this.radius);
	this.increment = 0.5;

	document.write('<div style="position:absolute" id="'+new_id+'"><img src="'+image+'"></div>');
	this.id = new_id;
	this.dlink = document.getElementById(new_id);
	//set random location
	this.dlink.style.pixelLeft = Math.random()*(maxx-100);
	this.dlink.style.pixelTop = document.body.scrollTop - (maxy*Math.random());

	speed = rainSpeed*Math.random();
	while(speed<(rainSpeed-4) || speed<1)
		speed = rainSpeed*Math.random();
	angle = degToRad(rainAngle);

	//make it move
	this.dropMove = function()
	{
		switch (trajectory) {
			case 0:
				if (this.curx == this.radius+1) this.increment = -0.5;
				if (this.curx == -this.radius) this.increment = 0.5;
				this.dlink.style.pixelLeft = this.dlink.style.pixelLeft + this.increment;
				this.curx += this.increment;
				break;
			case 1:
				this.dlink.style.pixelLeft = this.dlink.style.pixelLeft - (Math.tan(angle)*speed);
				break;
			case 2:
				this.dlink.style.pixelLeft = this.dlink.style.pixelLeft + (Math.tan(angle)*speed);
				break;
		}

		this.dlink.style.pixelTop = this.dlink.style.pixelTop + speed;

		if ((this.dlink.style.pixelLeft + (Math.tan(angle)*speed) + 5) > maxx) {
			this.dlink.style.pixelLeft = (Math.tan(angle)*speed) + 10 }
		if ((this.dlink.style.pixelLeft - (Math.tan(angle)*speed) - this.dlink.style.pixelWidth - 5) < 0) {
			this.dlink.style.pixelLeft = maxx - this.dlink.style.pixelWidth - 16 }

		//move'em to top if they are in bottom
		if ((maxy - this.dlink.style.pixelTop - this.dlink.style.pixelHeight - 10) < speed) {
			this.dlink.style.pixelTop = document.body.scrollTop - (0.1*maxy*Math.random());
		}
	}
}

//makes all drops/flakes to make 1 move
function allMove()
{
	for (i=0;i<maxdrops;i++) {
		drops[i].dropMove();
	}
}

function checkConstraints()
{
	maxx = document.body.clientWidth-10
	maxy = document.body.clientHeight+document.body.scrollTop-5
}
//cretae drops/flakes
for (i=0;i<maxdrops;i++) {
	drops[i] = new dropObject('drop_'+i);
}

setInterval('allMove()', '25');
setInterval('checkConstraints()', '25');