
if( snowsrc != 'aucun' ){  
  
  if( document.all )
	var no = 10;  // Nombre de flocons a l'ecran sous IE (seulement 10 car IE est une grosse bouse)
  else
    var no = 20; // Nombre de flocons a l'ecran sous Firefox
	
  //----------------------------------------------------------
  
  for( var i=0; i<no; i++ )
	document.write("<div id='dott"+i+"' style='POSITION: absolute; Z-INDEX: "+i+"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;'><img src='"+snowsrc+"' border='0'></div>");
  
  var dx, xp, yp;    // coordinate and position variables
  var am, stx, sty;  // amplitude and step variables
  var i, doc_width = 800, doc_height = 600;
  
  doc_width = document.body.clientWidth;
  doc_height = document.body.clientHeight;
  var doc_x, doc_y;

  dx = new Array();
  xp = new Array();
  yp = new Array();
  am = new Array();
  stx = new Array();
  sty = new Array();
  
  for (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
  }

  function snow() {
        if (window.innerWidth) { doc_width = window.innerWidth; }
        else if (document.documentElement) { doc_width = document.documentElement.clientWidth; }
        else if (document.body) { doc_width = document.body.clientWidth; }

        if (window.innerHeight) { doc_height = window.innerHeight; }
        else if (document.documentElement) { doc_height = document.documentElement.clientHeight; }
        else if (document.body) { doc_height = document.body.clientHeight; }

        if (window.pageXOffset ) { doc_x = window.pageXOffset ; }
        else if (document.documentElement ) { doc_x = document.documentElement.scrollLeft }
        else if (document.body ) { doc_x = document.body.scrollLeft  }
 
        if (window.pageXOffset) { doc_y = window.pageYOffset ; }
        else if (document.documentElement ) { doc_y = document.documentElement.scrollTop }
        else if (document.body ) { doc_y = document.body.scrollTop }


    for (i = 0; i < no; ++ i) {  // iterate for every dot
      yp[i] += sty[i];
      if (yp[i] > doc_height + doc_y -50 || yp[i] < doc_y || xp[i] < doc_x || xp[i] > doc_x + doc_width) {
        xp[i] = doc_x + Math.random()*(doc_width-am[i]-30);
        yp[i] = doc_y + 0;
        stx[i] = 0.02 + Math.random()/10;
        sty[i] = 0.7 + Math.random();
      }
      dx[i] += stx[i];
      //document.write(document.getElementById("dott1").style.left);
      document.getElementById("dott" + i).style.top = Math.round(yp[i]) + "px";
      document.getElementById("dott" + i).style.left = Math.round(xp[i] + am[i]*Math.sin(dx[i])) + "px";
    }
    setTimeout("snow()", 10);
  }

  snow();

}