/* HappyPointer par E.D Prod 1998
   etiennedeb@ifrance.com
   http://javascript.lab.cc
*/

var isNS = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
if (isNS==0) 
{var vara='DIV ID';
var varb='/DIV';
var styl='STYLE="position:absolute;TOP:0px;LEFT:0px;width:20px;height:20px;"';
}
else 
{var vara='LAYER NAME';
var varb='/LAYER';
var styl='';}

var chaine='<'+vara+' = "obj1" '+styl+'>';
chaine+='<IMG SRC="/gen/gen_img/ball.gif" WIDTH=20 HEIGHT=20 BORDER=0>';
chaine+='<'+varb+'>\n';
chaine+='<'+vara+' = "obj2" '+styl+'>';
chaine+='<IMG SRC="/gen/gen_img/ball.gif" WIDTH=20 HEIGHT=20 BORDER=0>';
chaine+='<'+varb+'>\n';
chaine+='<'+vara+' = "obj3" '+styl+'>';
chaine+='<IMG SRC="/gen/gen_img/ball.gif" WIDTH=20 HEIGHT=20 BORDER=0>';
chaine+='<'+varb+'>\n';
chaine+='<'+vara+' = "obj4" '+styl+'>';
chaine+='<IMG SRC="/gen/gen_img/ball.gif" WIDTH=20 HEIGHT=20 BORDER=0>';
chaine+='<'+varb+'>\n';
chaine+='<'+vara+' = "obj5" '+styl+'>';
chaine+='<IMG SRC="/gen/gen_img/ball.gif" WIDTH=20 HEIGHT=20 BORDER=0>';
chaine+='<'+varb+'><BR>\n';

//alert(isNS+'\n'+chaine);
document.write(chaine);

var div1 = (isNS) ? document.obj1 : document.all.obj1.style;
var div2 = (isNS) ? document.obj2 : document.all.obj2.style;
var div3 = (isNS) ? document.obj3 : document.all.obj3.style;
var div4 = (isNS) ? document.obj4 : document.all.obj4.style;
var div5 = (isNS) ? document.obj5 : document.all.obj5.style;
//alert(div1+' '+div2+' '+div3+' '+div4+' '+div5);
//var objet = new Object;
//var coord;
var coordb = 800;
var objet = new Array(div1,div2,div3,div4,div5);


var coord = new Array();

function placeObj(i,px,py) {
 objet[i].left=px;
 objet[i].top=py;
}

function voirObj(i) {
 objet[i].visibility="visible";
}

function cacheObj(i) {
 objet[i].visibility="hidden";
}

var userAgent=navigator.appName + " " + navigator.appVersion;
var agentInfo=userAgent.substring(0, 12);
var yBase = 0;
var xBase = 0;
var delay = 15;
var yAmpl = 10;
var yMax = 40;
var step = .1;
var ystep = .5;
var currStep = 0;
var tAmpl=1;
var Xpos = 50;var ox;
var Ypos = 50;var oy;
var j = 0;

if(agentInfo >= "Netscape 4.0") {
 document.captureEvents(Event.MOUSEMOVE);
 function mouveA(evnt) {
  Xpos = evnt.pageX;
  Ypos = evnt.pageY+16;
 }
 document.onMouseMove = mouveA;
}
else {
 function mouveB() {
  ofy=document.body.scrollTop;ofx=document.body.scrollLeft;
  Xpos = event.clientX+ofx;
  Ypos = event.clientY+ofy+16;
 }
 document.onmousemove = mouveB;
}

function animation() 
{
 yBase = 200;xBase = 300;
 var cx;var cy;
 for ( j = 0 ; j < 5 ; j++ ) {
  cx=Xpos + Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/(10+j))+0.2)*Math.cos((currStep + j*25)/10);
  cy=Ypos + Math.cos((20*Math.sin(currStep/(20+j)))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
  if (navigator.appName=="Microsoft Internet Explorer") {
   ty=document.body.clientHeight;tx=document.body.clientWidth;
   oy=document.body.scrollTop;ox=document.body.scrollLeft;
  }
  else {
   ty=window.innerHeight;tx=window.innerWidth;
   oy=window.pageYOffset;ox=window.pageXOffset;
  }
  if (cx>ox+0 && cx<ox+tx-24 && cy>oy+0 && cy<oy+ty-24) {
   voirObj(j);placeObj(j,cx,cy);
  }
  else {
   cacheObj(j);placeObj(j,0,0);
  }
 }
 currStep += step;
 setTimeout("animation()", 5);
}

animation();

