function bodyheight() {
   var D = document;
   return Math.max(
      Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
      Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
      Math.max(D.body.clientHeight, D.documentElement.clientHeight)
   );
}
var cx=0,cy=0;
function background() {
   var myWidth = 0, myHeight = 0;
   if( typeof( window.innerWidth ) == 'number' ) {
   //Non-IE
      myWidth = window.innerWidth;
      myHeight = window.innerHeight;
      // on mozilla the space used by the vertical scroll bar is included so 
      // you have to test for it and remove it.
      if (document.documentElement.clientHeight > myHeight) myWidth -= 17;
   } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
   //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
      myHeight = document.documentElement.clientHeight;
   } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
   //IE 4 compatible
      myWidth = document.body.clientWidth;
      myHeight = document.body.clientHeight;
   }
   myWidth -= 20;
   myHeight = (bodyheight() > myHeight)?bodyheight():myHeight;
   var boxsize = 40;
   cx = 0;
   cy = 0;
   for (y=10;y<myHeight-boxsize;y+=boxsize) {
      cy++;
      cx=0;
      for (x=10;x<myWidth-boxsize;x+=boxsize) {
         cx++;
         var div = document.createElement('DIV');
         div.style.position = 'absolute';
         div.style.top = y + 'px';
         div.style.left = x + 'px';
         div.style.width = (boxsize-2) + 'px';// remove border width
         div.style.height = (boxsize-2) + 'px';
         div.style.zIndex = -1;
         div.id = 'x:'+cx+',y:'+cy;
         div.className = 'bgsqhide';
         document.body.insertBefore(div,document.body.firstChild);
      }
   }
   node = document.body.firstChild;
   while(node = node.nextSibling) if (node.style && node.className != 'backsquare') node.style.zIndex = 3;
   shimmer();
}
var wait2,dx,dy,dc,step,upordown,node;
function shimmer() {
   var i;
   for (var n=0;n<100;n++) {
      dx = Math.ceil(Math.random()*cx);
      dy = Math.ceil(Math.random()*cy);
      node = document.getElementById('x:'+dx+',y:'+dy);
      if (node) {
         node.className = (node.className == 'bgsqhide')?'bgsqshow':'bgsqhide';
      } //else alert('x:'+dx+',y:'+dy);
   }
   wait2 = setTimeout("shimmer();",1000);
}

