/* Définition des variables */
var isNS = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
/* chaque objet est définit ici */
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 objet;
var coord;
var coordb = 800;
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;
/* position de l'amination en pixel */
var Xpos = 700;var ox;
var Ypos = 150;var oy;

/* On remplit le tableau avec chaque objet */
objet = new Array(div1,div2,div3)
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";
}

function mouveA(evnt) {
	Xpos = evnt.pageX;
	Ypos = evnt.pageY;
}
document.onMouseMove = mouveA;

function animation() {
/* rayon de l'animation */
 yBase = 100;xBase = 100;
 var cx;var cy;
/* on fait une boucle jusque au nombre d'objet*/
 for ( j = 0 ; j < 3 ; 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);
  placeObj(j,cx,cy);
 }
 currStep += step;
 setTimeout("animation()", 15);
}
animation();

