/*
  fencing arrows in the plan page
*/

var arrowR = {

arrowStyle:null, shift:520,

start:function()
{
  this.arrowStyle = document.getElementById('flecheR').style;

  this.move();
},

move:function()
{
  if(this.shift == 520)
  {
    this.shift = -103;

    this.arrowStyle.top = Math.floor(40 * Math.random()); 
  }

  this.shift++;

  this.arrowStyle.left = this.shift; 

  setTimeout("arrowR.move()",20);
}
}

var arrowL = {

arrowStyle:null, shift:-103,

start:function()
{
  this.arrowStyle = document.getElementById('flecheL').style;

  this.move();
},

move:function()
{
  if(this.shift == -103)
  {
    this.shift = 520;

    this.arrowStyle.top = Math.floor(40 * Math.random()); 
  }

  this.shift--;

  this.arrowStyle.left = this.shift; 

  setTimeout("arrowL.move()",20);
}
}        

var arrowD = {

arrowStyle:null, shift:80,

start:function()
{
  this.arrowStyle = document.getElementById('flecheD').style;

  this.move();
},

move:function()
{
  if(this.shift == 80)
  {
    this.shift = -90;

    this.arrowStyle.left = Math.floor(480 * Math.random()); 
  }

  this.shift++;

  this.arrowStyle.top = this.shift; 

  setTimeout("arrowD.move()",20);
}
}

var arrowU = {

arrowStyle:null, shift:-90,

start:function()
{
  this.arrowStyle = document.getElementById('flecheU').style;

  this.move();
},

move:function()
{
  if(this.shift == -90)
  {
    this.shift = 80;

    this.arrowStyle.left = Math.floor(480 * Math.random()); 
  }

  this.shift--;

  this.arrowStyle.top = this.shift; 

  setTimeout("arrowU.move()",20);
}
}


var arrow315 = {

arrowStyle:null, shiftL:0, shiftT:80,

start:function()
{
  this.arrowStyle = document.getElementById('fleche315').style;

  this.move();
},

move:function()
{
  if(this.shiftT == 80 || this.shiftL == 520)
  {
    this.shiftT = -60;

    this.shiftL = -60 + Math.floor(520 * Math.random()); 

    this.arrowStyle.left = this.shiftL; 
  }

  this.shiftL++;
  this.shiftT++;

  this.arrowStyle.left = this.shiftL; 
  this.arrowStyle.top  = this.shiftT; 

  setTimeout("arrow315.move()",20);
}
}

var arrow45 = {

arrowStyle:null, shiftL:0, shiftT:-60,

start:function()
{
  this.arrowStyle = document.getElementById('fleche45').style;

  this.move();
},

move:function()
{
  if(this.shiftT == -60 || this.shiftL == 520)
  {
    this.shiftT = 80;

    this.shiftL = -60 + Math.floor(520 * Math.random()); 

    this.arrowStyle.left = this.shiftL; 
  }

  this.shiftL++;
  this.shiftT--;

  this.arrowStyle.left = this.shiftL; 
  this.arrowStyle.top  = this.shiftT; 

  setTimeout("arrow45.move()",20);
}
}

var arrow225 = {

arrowStyle:null, shiftL:0, shiftT:80,

start:function()
{
  this.arrowStyle = document.getElementById('fleche225').style;

  this.move();
},

move:function()
{
  if(this.shiftT == 80 || this.shiftL == -60)
  {
    this.shiftT = -60;

    this.shiftL = Math.floor(520 * Math.random()); 

    this.arrowStyle.left = this.shiftL; 
  }

  this.shiftL--;
  this.shiftT++;

  this.arrowStyle.left = this.shiftL; 
  this.arrowStyle.top  = this.shiftT; 

  setTimeout("arrow225.move()",20);
}
}

var arrow135 = {

arrowStyle:null, shiftL:0, shiftT:-60,

start:function()
{
  this.arrowStyle = document.getElementById('fleche135').style;

  this.move();
},

move:function()
{
  if(this.shiftT == -60 || this.shiftL == -60)
  {
    this.shiftT = 80;

    this.shiftL = Math.floor(520 * Math.random()); 

    this.arrowStyle.left = this.shiftL; 
  }

  this.shiftL--;
  this.shiftT--;

  this.arrowStyle.left = this.shiftL; 
  this.arrowStyle.top  = this.shiftT; 

  setTimeout("arrow135.move()",20);
}
}

var arrows = {

start:function()
{
  arrowR.start();

  setTimeout("arrowL.start()",2000);

  setTimeout("arrowD.start()",4000); 

  setTimeout("arrowU.start()",5000);

  setTimeout("arrow315.start()",7000);

  setTimeout("arrow45.start()",8000); 

  setTimeout("arrow225.start()",9000);

  setTimeout("arrow135.start()",10000);
}
}

