/*
Float Up Drifter - Java Script
Visit http://rainbow.arch.scriptmania.com/scripts/
  for this script and many more
*/
    // Configure below - change number of images to render

var no = 8; 

    // Configure speed below

var speed = 15;   // The smaller the number, the faster the movement

var pict = "_images/balloon";   // Name of image

var xp, yp;    // Coordinate and Positions variable
var i, doc_width = 800, doc_height = 1000;
var st, w;
var ns4up = (document.layers) ? 1 : 0;  // browser sniffer
var ns4 = (document.layers)?1:0;
var ns6up   = (document.getElementById&&!document.all)?1:0;
var ie4up = (document.all) ? 1 : 0;
if (ns4up) {
 doc_width = self.innerWidth;
 doc_height = self.innerHeight;
} else if (ie4up) {
 doc_width = document.body.clientWidth;
 doc_height = document.body.clientHeight;
}
xp = new Array();
yp = new Array();
st = new Array();
w = 3.14 / 360 * 2;  
for (i = 0; i < no; ++ i) {
   xp[i]=Math.random()*(doc_width-35);
   yp[i]=doc_height/2;
   st[i]=Math.random()*8+2;
  if (ns4up) {                      // set layers
   document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
   document.write("top=\"15\" visibility=\"show\"><img src=\"");
   document.write(pict+i+".gif"+ "\" border=\"0\"></layer>");
 } else
  if (ie4up) {
    document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
    document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
    document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
    document.write(pict+i+".gif"+ "\" border=\"0\"></div>");
     }
}
function floatNS() {  // Netscape main animation function
 for (i = 0; i < no; ++ i) {  // iterate for every dot  
 yp[i] = yp[i] - st[i];
 xp[i] = xp[i] + Math.sin(yp[i]*w+st[i])*2;
   if (yp[i] < -35) {
   xp[i]=Math.random()*(doc_width-35);
   yp[i]=doc_height;
   st[i]=Math.random()*8+2;
   }
 document.layers["dot"+i].top = yp[i]; 
 document.layers["dot"+i].left = xp[i];
 }
 setTimeout("floatNS()", 20);
}
function floatIE() {  // IE main animation function
 for (i = 0; i < no; ++ i) {  // iterate for every dot
 yp[i] = yp[i] - st[i];
 xp[i] = xp[i] + Math.sin(yp[i]*w+st[i])*2;
   if (yp[i] < -35) {
   xp[i]=Math.random()*(doc_width-40);
   yp[i]=doc_height;
   st[i]=Math.random()*8+2;
   }
 document.all["dot"+i].style.pixelTop = yp[i];
 document.all["dot"+i].style.pixelLeft = xp[i];
 }
 setTimeout("floatIE()", 100);
}
if (ns4up) {floatNS();} 
else if (ie4up) {floatIE();}