//Configure below to change URL path to the snow image
  var snowsrc="images/snow.gif";
  var basrc="images/bonneannee2010.png";
  // Configure below to change number of snow to render
  var no = 10;

  
  var dx, xp, yp;    // coordinate and position variables
  var am, stx, sty;  // amplitude and step variables
  var doc_width = 800, doc_height = 600;
  var dneige = null;

function neigeOn() {  
  doc_width = window.innerWidth ? window.innerWidth : document.body.clientWidth;
  doc_height = window.innerHeight ? window.innerHeight : document.body.clientHeight;

  dx = new Array();
  xp = new Array();
  yp = new Array();
  am = new Array();
  stx = new Array();
  sty = new Array();
  
  for (var i = 0; i < no; i++) {  
    dx[i] = 0;                        // set coordinate variables
    xp[i] = Math.random()*(doc_width-50);  // set position variables
    yp[i] = Math.random()*doc_height;
    am[i] = Math.random()*20;         // set amplitude variables
    stx[i] = 0.02 + Math.random()/10; // set step variables
    sty[i] = 0.7 + Math.random();     // set step variables
    
    dneige = document.createElement('div');
    document.body.appendChild(dneige);
    dneige.id = "dot"+ i;
    dneige.style.position = "absolute";
    dneige.style.zIndex = i;
    dneige.style.visibility = "visible";
    dneige.style.top = "15px";
    dneige.style.left = "15px";
      if (i == 0) {
       dneige.innerHTML = "<img src='"+basrc+"' border='0'>";
      } else {
       dneige.innerHTML = "<img src='"+snowsrc+"' border='0'>";
      }
    
  }
 
  snowNS();
  
}  
  
  function snowNS() {  // Netscape main animation function
    for (var i = 0; i < no; i++) {  // iterate for every dot
      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();
        doc_width = window.innerWidth ? window.innerWidth : document.body.clientWidth;
        doc_height = window.innerHeight ? window.innerHeight : document.body.clientHeight;
      }
      dx[i] += stx[i];
      document.getElementById("dot"+i).style.top = yp[i] + "px";
      document.getElementById("dot"+i).style.left = xp[i] + am[i]*Math.sin(dx[i])+ "px";
    }
    setTimeout("snowNS()", 10);
  }

  

  
