<!-- Hide from old browsers

// Functions used for the snow

//  function getScrollXY() {
//    var scrOfX = 0, scrOfY = 0;
//    if( typeof( window.pageYOffset ) == 'number' ) {
//      //Netscape compliant
//      scrOfY = window.pageYOffset;
//      scrOfX = window.pageXOffset;
//    } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
//      //DOM compliant
//      scrOfY = document.body.scrollTop;
//      scrOfX = document.body.scrollLeft;
//    } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
//      //IE6 standards compliant mode
//      scrOfY = document.documentElement.scrollTop;
//      scrOfX = document.documentElement.scrollLeft;
//    }
//    return [ scrOfX, scrOfY ];
//  }

  function snowNS()
  {  // Netscape main animation function
    for (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]-180);  // indent a bit so as not to go off the side of the page
        yp[i] = 0;
        stx[i] = 0.02 + Math.random()/10;
        sty[i] = 0.7 + Math.random();
        doc_width = self.innerWidth;
        doc_height = self.innerHeight;
		//doc_height = doc_height * 1.1;  // added to let snowflake go off bottom of page 
      }
      dx[i] += stx[i];
      document.layers["dot"+i].top = yp[i];
      document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
    }
    setTimeout("snowNS()", 10);
  }

  function snowIE_NS6()
  {  // IE and NS6 main animation function
    for (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]-180);  // indent a bit so as not to go off the side of the page
        yp[i] = 0;
        stx[i] = 0.02 + Math.random()/10;
        sty[i] = 0.7 + Math.random();
        doc_width = ns6up?window.innerWidth : document.body.clientWidth;
		doc_height = ns6up?window.innerHeight : document.body.clientHeight;
      }
      dx[i] += stx[i];
      if (ie4up)
      {
        document.all["dot"+i].style.pixelTop = yp[i];
        document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
      }
      else if (ns6up)
      {
        document.getElementById("dot"+i).style.top=yp[i];
        document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i]);
      }   
    }
    setTimeout("snowIE_NS6()", 10);
  }

// Main javascript code for the snow

  var snowsrc;                            // URL path to the snowflake image - set lower down dynamically
  var no = 10;                            // number of snow flakes to render to fall
  var ns4up = (document.layers) ? 1 : 0;  // browser sniffer
  var ie4up = (document.all) ? 1 : 0;
  var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
  var dx, xp, yp;    // coordinate and position variables
  var am, stx, sty;  // amplitude and step variables
  var i, doc_width = 800, doc_height = 600;

  var v_offset_horiz, v_offset_vert;

  var now = new Date();
  var thismonth = now.getMonth();

// if we're in December (11), January (0), February (1) or March (2) then let it snow...depending - change accordingly

  if ( ( thismonth == 11 ) || ( thismonth == 0 ) || ( thismonth == 1 ) )
  {

//    v_offset_horiz, v_offset_vert = getScrollXY();

    if (ns4up||ns6up)
    {
      doc_width = self.innerWidth;
      doc_height = self.innerHeight;
    }
    else if (ie4up) 
    {
      doc_width = document.body.clientWidth;
      doc_height = document.body.clientHeight;
    }

    dx = new Array();
    xp = new Array();
    yp = new Array();
    am = new Array();
    stx = new Array();
    sty = new Array();
  
    for (i = 0; i < no; ++ i)
    {  
      // random snow flakes - uses 4 snowflake images snow0.gif to snow3.gif
      snowsrc = "images/xmas/snow" + Math.round(Math.random()*3) + ".gif";

      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
      if (ns4up) 
      {                      // set layers
        document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\""+snowsrc+"\" border=\"0\"></layer>");
      }
      else if (ie4up||ns6up)
      {                      // this fires for IE
        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ (i + (-1)) +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src=\""+snowsrc+"\" border=\"0\"></div>");
      }
    }
  
    if (ns4up) 
    {
      snowNS();
    }
    else if (ie4up||ns6up) 
    {
      snowIE_NS6();
    }
  
  }


// end hiding script from old browsers -->
