var dx, xp, yp;
var am, stx, sty;
var i;
var doc_width = document.body.clientWidth;
var doc_height = 300; 
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
  
function nevar(numcopos) {
	for (i = 0; i < numcopos; ++i) {
		yp[i] += sty[i];
 		if (yp[i] > doc_height-50) {
			xp[i] = Math.random()*(doc_width-am[i]-30);
 			yp[i] = 0;
 			stx[i] = 0.02 + Math.random()/10;
 			sty[i] = 0.7 + Math.random();
 		}
 		dx[i] += stx[i];
 		document.getElementById("copo"+i).style.top = yp[i]+'px';
 		document.getElementById("copo"+i).style.left = (xp[i] + am[i]*Math.sin(dx[i]))+'px';
 	}
	setTimeout("nevar("+numcopos+")", 35);
}

function nieve(numcopos) {
 	for (i = 0; i < numcopos; ++i) {
 		dx[i] = 0;
 		xp[i] = Math.random()*(doc_width-50);
 		yp[i] = Math.random()*doc_height;
 		am[i] = Math.random()*20;
 		stx[i] = 0.02 + Math.random()/10;
 		sty[i] = 0.7 + Math.random();
		document.write('<img src="./nieve.gif" id="copo' + i + '" style="position: absolute; z-index:1000; top:15px; left:'+xp[i]+'px;" border=0 alt="">');
 	}
 	nevar(numcopos);
}

var hoy = new Date();
var meshoy=hoy.getMonth(); 
var diahoy=hoy.getDate(); 

if (((diahoy>=8) && (meshoy==11)) || ((diahoy<=6) && (meshoy==0))) { 
	nieve(30);
}

