function snowflakes()
{
  var max_flakes = 50;
  var flakes = [];
  var fl_img_width = 20;
  var fl_img_height = 20;
  var win_width = document.body.offsetWidth ? document.body.offsetWidth : window.innerWidth;
  var win_height = document.body.offsetHeight ? document.body.offsetHeight : window.innerHeight;
  var speed = 4.0;

  for (var i=0; i<max_flakes; i++)
  {
    var scale = (0.5 + Math.random()*0.5);
    var width = fl_img_width * scale;
    var height = fl_img_height * scale;
    var opacity = 0.8 + Math.random() * 0.2;
    var x = Math.random() * win_width - width / 2;
    var y = -(win_height + height) + Math.random()*win_height;

    var div = document.createElement('img');
    div.src = "/scr/sc-snowflakes0.png";
    div.style.position = "fixed";
    div.style.zIndex = "100000";
    div.style.width = Math.round(width)+"px";
    div.style.height = Math.round(height)+"px";
/*    div.style.MozOpacity = opacity;
    div.style.filter = "alpha(opacity=" + (Math.round(opacity * 100)) + ")";
    div.style.opacity = opacity;*/
    div.style.left = Math.round(x)+"px";
    div.style.top = Math.round(y)+"px";
    document.body.appendChild(div);

    flakes.push({
      div:      div,
      scale:    scale,
      width:    width,
      height:   height,
      opacity:  opacity,
      x:        x,
      y:        y + win_height,
      m:    1+Math.random()*2*speed,
      k:    -Math.PI+Math.random()*Math.PI,
      rad:  0
    });
  }

  function animateSnowflakes()
  {
    for (var i=0; i<flakes.length; i++)
    {
      var fl = flakes[i];
      fl.rad += (fl.k / 180.0) * Math.PI;
      fl.x -= Math.cos(fl.rad) ;
      fl.y += fl.m;
      if (fl.y >= win_height)
        fl.y = -fl.height;

      if ((fl.x >= win_width) || (fl.x <= -fl.width))
      {
        fl.x = -(win_width + fl.width) + Math.random()*win_width;
        fl.y = -fl.height;
      }
      fl.div.style.left = Math.round(fl.x)+'px';
      fl.div.style.top = Math.round(fl.y)+'px';
    }
  }
  setInterval(animateSnowflakes, 80);
}