/*ĎÂŃŠsnow - Start*/
var no = 10; // number of snows
var speed = 20; // smaller number moves the snows faster
var heart = "/images/snow.gif";//the path of snow image
var flag = new Array();
var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var dom = (document.getElementById) ? 1 : 0;
// coordinate and position variables
var dx = new Array();
var xp = new Array();
var yp = new Array();
// amplitude and step variables
var amx = new Array();
var amy = new Array();
var stx = new Array();
var sty = new Array();
var i, doc_width = 800, doc_height = 600;
if (ie4up) {
	doc_width = document.body.clientWidth;
	doc_height = document.body.scrollTop+document.body.clientHeight;
}
else {
	doc_width = window.innerWidth;
	doc_height = window.pageYOffset+window.innerHeight;
}
for (i = 0; i < no; ++ i) {
	dx[i] = 0; // set coordinate variables
	xp[i] = Math.random()*(doc_width-30)+10; // set position variables
	yp[i] = Math.random()*doc_height;
	amy[i] = 12+ Math.random()*20; // set amplitude variables
	amx[i] = 10+ Math.random()*40;
	stx[i] = 0.02 + Math.random()/10; // set step variables
	sty[i] = 0.7 + Math.random(); // set step variables
	flag[i] = (Math.random()>0.5)?1:0;
	if (ns4up) { // set layers
		if (i == 0) {
			document.write("<layer id=\"dot"+ i +"\" name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\"" + heart+ "\" border=\"0\"></layer>");
		} else {
			document.write("<layer id=\"dot"+ i +"\" name=\"dot"+ i +"\" left=\"150\" top=\"150\" visibility=\"show\"><img src=\"" + heart+ "\" border=\"0\"></layer>");
		}
	}
	else{
		if (i == 0) {
			document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src=\"" + heart + "\" border=\"0\"></div>");
		}
		else {
			document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 150px; LEFT: 150px;\"><img src=\"" + heart+ "\" border=\"0\"></div>");
		}
	}
}
function snow(){
	for (i = 0; i < no; ++ i) { // iterate for every dot
		if (yp[i] > doc_height-50) {
			xp[i] = 10+ Math.random()*(doc_width-amx[i]-30);
			yp[i] = 0;
			stx[i] = 0.02 + Math.random()/10;
			sty[i] = 0.7 + Math.random();
			flag[i]=(Math.random()<0.5)?1:0;
			if (ie4up) {
				doc_width = document.body.clientWidth;
				doc_height = document.body.clientHeight;
			}
			else{
				doc_width = window.innerWidth;
				doc_height = window.innerHeight;
			}
		}
		if (flag[i])
			dx[i] += stx[i];
		else
			dx[i] -= stx[i];
		if (Math.abs(dx[i]) > Math.PI) {
			yp[i]+=Math.abs(amy[i]*dx[i]);
			xp[i]+=amx[i]*dx[i];
			dx[i]=0;
			flag[i]=!flag[i];
		}
		idot="dot"+i;
		c=(dom)? document.getElementById(idot).style : (ie4up)? document.all[idot].style : (ns4up)? document.layers[idot] : "";
		theTop=yp[i] + amy[i]*(Math.abs(Math.sin(dx[i])+dx[i]));
		theLeft=xp[i] + amx[i]*dx[i];
		if (ns4up) {
			c.top=theTop;
			c.left=theLeft;
		}
		else if(ie4up){
			c.pixelTop=theTop;
			c.pixelLeft=theLeft;
		}
		else if(dom){
			c.top=theTop+"px";
			c.left=theLeft+"px";
		};
	}
}
/*ĎÂŃŠ snow - End*/
window.setInterval("snow()", speed);//ĎÂŃŠŁŹsnow