var step = 2 ;
var speed = 100;
var collection;
function floaters_move() {
  this.items    = [];
  this.addItem  = function(id,x,y,content) {
   document.write('<div id='+id+' style="z-index:2; position:absolute;">'+content+'</div>');
   var newItem = {};
   newItem.object = document.getElementById(id);
   newItem.xPos = x;
   newItem.yPos = y;
   newItem.xon = 0;
   newItem.yon = 0;
   this.items[this.items.length] = newItem;
  }
  this.play = function() {
  collection = this.items
   setInterval('move_play()',speed);
  }
}
   function move_play() {
  for(var i=0;i<collection.length;i++) {
   var followObj        = collection[i].object;
   var followObj_x        = followObj.offsetWidth;
   var followObj_y        = followObj.offsetHeight;
   followObj.style.left = collection[i].xPos + document.documentElement.scrollLeft+'px';
   followObj.style.top = collection[i].yPos + document.documentElement.scrollTop+'px';
   if(collection[i].xon) {
    collection[i].xPos += step;
   } else {
    collection[i].xPos -= step;
   }
   if(collection[i].yon) {
    collection[i].yPos += step;
   } else {
    collection[i].yPos -= step;
   }
   if(collection[i].xPos >= (document.documentElement.clientWidth-followObj_x)) {
    collection[i].xon = 0;
    collection[i].xPos = document.documentElement.clientWidth-followObj_x;
   }
   if(collection[i].xPos < 0) {
    collection[i].xon = 1;
    collection[i].xPos = 0;
   }
   if(collection[i].yPos >= (document.documentElement.clientHeight-followObj_y)) {
    collection[i].yon = 0;
    collection[i].yPos = document.documentElement.clientHeight-followObj_y;
   }
   if(collection[i].yPos < 0) {
    collection[i].yon = 1;
    collection[i].yPos = 0;
   }
  }
}