/* HappyPointer par E.D Prod 1998
   etiennedeb@ifrance.com
   http://javascript.lab.cc
*/

CreerObj("etoile0",0,0,20,20,1,0,"<IMG SRC='ball.gif' WIDTH=20 HEIGHT=20 BORDER=0>","",0);
CreerObj("etoile1",0,0,20,20,1,0,"<IMG SRC='ball.gif' WIDTH=20 HEIGHT=20 BORDER=0>","",0);
CreerObj("etoile2",0,0,20,20,1,0,"<IMG SRC='ball.gif' WIDTH=20 HEIGHT=20 BORDER=0>","",0);
CreerObj("etoile3",0,0,20,20,1,0,"<IMG SRC='ball.gif' WIDTH=20 HEIGHT=20 BORDER=0>","",0);
CreerObj("etoile4",0,0,20,20,1,0,"<IMG SRC='ball.gif' WIDTH=20 HEIGHT=20 BORDER=0>","",0);

var coord;
var coordb = 800;
coord = new Array()

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;

function happyp() {
 yBase = 200;xBase = 300;
 var cx;var cy;
 for ( j = 0 ; j < 5 ; j++ ) {
  cx=SourisX() + 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=SourisY() + Math.cos((20*Math.sin(currStep/(20+j)))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);

   ty=TailleY();tx=TailleX();
   ox=OffsetX();oy=OffsetY();

  if (cx>ox+0 && cx<ox+tx-40 && cy>oy+0 && cy<oy+ty-40) {
   VoirObj("etoile"+j);PlacerObj("etoile"+j,cx,cy);
  }
  else {
   CacherObj("etoile"+j);PlacerObj("etoile"+j,0,0);
  }
 }
 currStep += step;
 setTimeout("happyp()", 1);
}


