<!--

var maxX=2;  // MAX HORIZ PIXEL STEPS
var maxY=2;  // MAX VERT PIXEL STEPS

var ns4FCC=(document.layers)?true:false;
var ie4FCC=(document.all && !document.getElementById)?true:false;
var ie5FCC=(document.all && document.getElementById)?true:false;
var ns6FCC=(document.getElementById&&navigator.appName.indexOf("Netscape")>=0)?true:false;
var w3c=(document.getElementById)?true:false;
var ww=0; var wh=0;
var ydir=true; var xdir=true;
var floatobj; 
var xpos=0; var ypos=0;
var stepX=1;
var stepY=1;

function getwindowsize(){
ww=(ie4FCC||ie5FCC)?document.body.clientWidth:window.innerWidth;
wh=(ie4FCC||ie5FCC)?document.body.clientHeight:window.innerHeight;
}

function randomdir(){
if(Math.floor(Math.random()*2))stepX=Math.floor(Math.random()*maxX)+1;
if(Math.floor(Math.random()*2))stepY=Math.floor(Math.random()*maxY)+1;
if(Math.floor(Math.random()*2))xdir=(Math.floor(Math.random()*2))?false:true;
if(Math.floor(Math.random()*2))ydir=(Math.floor(Math.random()*2))?false:true;
setTimeout('randomdir()', Math.floor(Math.random()*5000)+600);
}

function moveid(id,xpos,ypos){
if(ns4FCC)id.moveTo(xpos,ypos);
else{
id.style.left=xpos+'px';
id.style.top=ypos+'px';
}}

function animate(){
var sx=(ie4FCC||ie5FCC)?document.body.scrollLeft:pageXOffset;
var sy=(ie4FCC||ie5FCC)?document.body.scrollTop:pageYOffset;
var tp=(ns4FCC)?floatobj.top:parseInt(floatobj.style.top);
var lf=(ns4FCC)?floatobj.left:parseInt(floatobj.style.left);
var tx,ty;
if(ydir){
if(tp+stepY>=wh+sy-floatobj.ih-4){
ydir=false;
ty=tp-stepY;
}else ty=tp+stepY;
}else{
if(tp-stepY<=sy){
ydir=true;
ty=tp+stepY;
}else ty=tp-stepY;
}
if(xdir){
if(lf+stepX>=ww+sx-floatobj.iw-3){
xdir=false;
tx=lf-stepX;
}else tx=lf+stepX;
}else{
if(lf-stepX<=sx){
xdir=true;
tx=lf+stepX;
}else tx=lf-stepX;
}
moveid(floatobj,tx,ty);
}

window.onload=function(){
  floatobj=(ns4FCC)?document.layers['floatobj']:(ie4FCC)?document.all['floatobj']:document.getElementById('floatobj');
  floatobj.iw=(ns4FCC)?floatobj.document.images["float"].width:document.images["float"].width;
  floatobj.ih=(ns4FCC)?floatobj.document.images["float"].height:document.images["float"].height;
  if(ns6FCC){
  floatobj.iw+=10;
  floatobj.ih+=10;
  } 
  getwindowsize();
  xpos=ww/2;
  ypos=wh/2;
  moveid(floatobj,xpos,ypos);
  randomdir();
  setInterval('animate()',50);
}


window.onresize=function(){
  if(ns4FCC)setTimeout('history.go(0)',400);
  else getwindowsize();
}
-->
