  var i;
  
  var ie4up = (document.all) ? 1 : 0;
  var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

  function iecompattest()
  {
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
  }

  var dx, xp, yp;    // coordinate and position variables
  var am, stx, sty;  // amplitude and step variables
  var i, doc_width = 800, doc_height = 600; 
  
  if (ns6up) {
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
  } else if (ie4up) {
    doc_width = iecompattest().clientWidth;
    doc_height = iecompattest().clientHeight;
  }

//  alert(doc_width+":"+doc_height)
  for (i = 0; i < 30; ++i) 
  {
    x=Math.random()*(doc_width-60);
	y=Math.random()*(doc_height-60);
	
    document.write("<div id=\"flake"+ i +"\" style=\"position: absolute; z-index: "+ 10 +"; visibility: visible; top: "+y+"px; left: "+x+"px;\"><img src='snow.gif' width=\"25\" height=\"28\"></div>");
  }

function falling()
{
  for (i = 0; i < 30; ++i) 
  {
    rawx=document.getElementById("flake"+i).style.left;
	rawy=document.getElementById("flake"+i).style.top;

//	alert(rawx+":"+rawy+"/"+rawx.substr(0,rawx.length-2));
		
	x=parseInt(rawx.substr(0,rawx.length-2));
	y=parseInt(rawy.substr(0,rawy.length-2));
//	alert(x+":"+y);
		
	y=y+2;
	if(x<doc_width-60)
	{
	   x=x+Math.random()*7-3;
	}
	if(y>doc_height-30)
	{
      x=Math.random()*doc_width-60;
      y=-30;
	}
	
//	alert(x+":"+y);
    document.getElementById("flake"+i).style.left=x+"px";
	document.getElementById("flake"+i).style.top=y+"px";
  }
  
  setTimeout("falling()", 50);
}

if (ie4up||ns6up)
{
  setTimeout("falling()", 50);
}