<!--
// On définit le navigateur utilisé
var IE4 = (document.all) ? true : false;
var NS4 = (document.layers) ? true : false;
var NS6 = (document.getElementById) ? true : false;
var DOM = (IE4 || NS6);
var NS  = (NS4 || NS6);
var MAC = (navigator.appVersion.indexOf('Macintosh')>0)? true:false;
if (NS4) MAC=true;

//scrolling text js sheet
function GetNS4Object(MyID,MyDocument)	{
	var MyObject= eval('MyDocument.'+MyID);

	if (!(MyObject))
	  	for(var i=0;i<MyDocument.layers.length;i++) {
			MyObject = GetNS4Object(MyID,MyDocument.layers[i].document);
			if (MyObject) break;
		}
  	return MyObject;
}

function GetObject(MyID) {
	if (DOM) return document.getElementById(MyID);
	if (IE4) return document.all[MyID];
	if (NS4) return GetNS4Object(MyID,window.document);

	return 0;
} 

function GetCSS(MyObject) {
	if (DOM || IE4) return MyObject.style;
	else if (NS4) return MyObject;
	else return 0;
}

function GetHeight(MyObject) { 
	if (DOM || IE4) return MyObject.offsetHeight;
	else if (NS4) return MyObject.clip.height;
	else return 0;
}
	
function GetWidth(MyObject) { 
	if (DOM || IE4) return MyObject.offsetWidth;
	else if (NS4) return MyObject.clip.width;
	else return 0;
}

function GetTop(MyObject) { 
	if (DOM || IE4) return (MyObject.offsetTop);
	if (NS4) return MyObject.y;
  	return 0;
}

function GetLeft(MyObject) { 
	if (DOM || IE4) return MyObject.offsetLeft;
	if (NS4) return MyObject.x;
	return 0;
}

function MoveObject(myX,myY) {
	this.X = myX;
	this.Y = myY;
	this.CSS.left=this.X;
	this.CSS.top=this.Y;
}

function MoveObjectUp(mystep) {
	this.Y -= mystep;
	this.CSS.top=this.Y;
}

function MoveObjectDown(mystep)	{
	this.Y += mystep;
	this.CSS.top=this.Y;
}

function MoveObjectLeft(mystep) {
	this.X -= mystep;
	this.CSS.left=this.X;
}

function MoveObjectRight(mystep)	{
	this.X += mystep;
	this.CSS.left=this.X;
}

function CreateObject(DivId,MyObject) {
    if (MyObject)
    	this.Object = MyObject;
    else
    	this.Object = GetObject(DivId);
    
    if (this.Object)
    	{
      this.CSS = GetCSS(this.Object);
      this.Height = GetHeight(this.Object);
      this.Width = GetWidth(this.Object);
      this.X = GetTop(this.Object);
      this.Y = GetLeft(this.Object);
      this.Move = MoveObject;
      this.Up = MoveObjectUp;
      this.Down = MoveObjectDown;
      this.ToLeft = MoveObjectLeft;
      this.ToRight = MoveObjectRight;
      }
    return this;
    }

function DelTextNode(MyObject)
	{
  var node = MyObject.firstChild;
  var next;

  while (node)
  	{
    next = node.nextSibling;
    if (node.nodeType == 3)
      MyObject.removeChild(node);
    node = next;
  	}
  }

function CreateChildren(MyObject,HoriSpacer,VertSpacer)
	{
  var i=0;
  var MyChildren = new Array();
  if (DOM)
  	{
    DelTextNode(MyObject);
    for (i=0;i<MyObject.childNodes.length;i++)
    	{
    	MyChildren[i] = new CreateObject(0,MyObject.childNodes[i]);
      MyChildren[i].Move(i*HoriSpacer,i*VertSpacer);
      }
    return MyChildren;
    }
  if (IE4)
  	{
    for (i=0;i<MyObject.children.length;i++)
    	{
      MyChildren[i] = new CreateObject(0,MyObject.children(i));
      MyChildren[i].Move(i*HoriSpacer,i*VertSpacer);
      }
    return MyChildren;
    }
  if (NS4)
  	{
    for (i=0;i<MyObject.document.layers.length;i++)
    	{
      MyChildren[i] = new CreateObject(0,MyObject.layers[i]);
      MyChildren[i].Move(i*HoriSpacer,i*VertSpacer);
      }
    return MyChildren;   
    }
  }

function ScrollUp()
	{
  var MyInterval = this.Interval1;
  this.stop();
  if (this.Children[this.FirstChildren].Y<-this.threshold)
  	{
    MyInterval = this.Interval2;
 	  this.Children[this.FirstChildren].Down(this.TotalHeight);
    if (this.FirstChildren<this.Children.length-1)
    	{
    	this.FirstChildren++;
      this.threshold += this.Children[this.FirstChildren].Height;
      }
    else
    	{
    	this.FirstChildren = 0;
      this.threshold = this.Children[this.FirstChildren].Height+this.Spacer;
      }
    }
	for (var i=0;i<this.Children.length;i++)
  	{
    this.Children[i].Up(this.Step);    
    }
  this.ProcessId = setTimeout(this.name + '.start()', MyInterval);
  }

 function ScrollLeft()
	{
  var MyInterval = this.Interval1;
  this.stop();
  if (this.Children[this.FirstChildren].X<-this.threshold)
  	{
    MyInterval = this.Interval2;
 	  this.Children[this.FirstChildren].ToRight(this.TotalWidth);
    if (this.FirstChildren<this.Children.length-1)
    	{
    	this.FirstChildren++;
      this.threshold += this.Children[this.FirstChildren].Width;
      }
    else
    	{
    	this.FirstChildren = 0;
      this.threshold = this.Children[this.FirstChildren].Width+this.Spacer;
      }
    }
	for (var i=0;i<this.Children.length;i++)
  	{
    this.Children[i].ToLeft(this.Step);    
    }
  this.ProcessId = setTimeout(this.name + '.start()', MyInterval);
  }
 
function ScrollStop()
	{
  if (this.ProcessId)
    clearTimeout(this.ProcessId);
  this.ProcessId = null;
	}

function Box(BoxName, DivId, myStep, myTempo1, myTempo2, mySpacer)
	{
  this.name     = BoxName;
  this.Step  = myStep ? myStep : 1;
  this.Interval1 = myTempo1 ? myTempo1 : 100;
  this.Interval2 = myTempo2 ? myTempo2 : 100;
  this.Spacer = mySpacer ? mySpacer : 0;
  this.ProcessId	= null;
  this.Container = new CreateObject(DivId);
  this.Children = new CreateChildren(this.Container.Object,0,mySpacer);
  this.FirstChildren = 0;
  this.LastChildren = this.Children.length-1;
  this.threshold = this.Children[0].Width+this.Spacer;
  var myHeight = 0;
  for (var i=0;i<this.Children.length;i++) 
  	{
    myHeight += (this.Children[i].Height + this.Spacer);
    }
  this.TotalHeight = myHeight;
  var myWidth = 0;
  for (var i=0;i<this.Children.length;i++) 
  	{
    myWidth += (this.Children[i].Width + this.Spacer);
    }
  this.TotalWidth = myWidth;
  this.Container.visibility = 'visible';
}

Box.prototype.start = ScrollLeft;
Box.prototype.stop = ScrollStop;

var largeurPage = 758;

/* Fonction calculant les coordonnées des calques en fonction de la taille de la fenêtre */
function init_Width() {
	
	l = 0;

	if (NS) l = window.innerWidth;
	if (IE4) l = document.body.offsetWidth;

	if (l<largeurPage) {
		xInfo = 379;
	} else {
		xInfo = l/2;
		xInfo -= ((IE4) ? 13 : 5);		
	}
	
		
	if (IE4) { 
		//document.all["infos"].style.left = xInfo;
		document.all["infos"].style.visibility = 'visible';
	}
	if (NS6) { 
		//document.getElementById("infos").style.left = (xInfo+5)+'px';
		document.getElementById("infos").style.visibility = 'visible';
	}
	if (NS4) { 
		//document.infos.left = xInfo;
		document.infos.visibility = 'show';
	}

} // init_Width()

function init() {
	
	// On calcule l'emplacement des calques
	init_Width();

	
	// Initilisation de la boîte des infos
	MyBox = new Box('MyBox', 'infos', 2, 50, 200, 5);
	//MyBox = new Box('MyBox', 'infos', 2, 50, 200, 5);
	MyBox.start();
	
}


//-->
