//Detection du navigateur 
/* renvoi un objet qui contient comme propriété les noms des navigateurs (ie6, ns4...).
* Chaque propriété est positionnée à VRAI ou FAUX en fonctions du navigateur.
*/
function NavCheck()
{ 
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.NC=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
// Fonction pour déplacer un calque en fonction d'un pas donné
function moveCalque(calque, pas, depart, destination)
{	
	// Définition du Navigateur Client
	Navigateur = NavCheck();	
	// Netscape 4
	if(Navigateur.ns4)
		calqueToMove = window.document.layers[calque];
	// Internet Explorer
	else if(Navigateur.ie)
		calqueToMove = window.document.all[calque];
	// W3C - Navigateur compatible DOM
	else if(Navigateur.dom)
		calqueToMove = 	window.document.getElementById(calque);
	
	// Initialisation du point de départ	
	if (calqueToMove.style.left == "")
		calqueToMove.style.left = depart;
	
	// Transofrmation de la position en numérique
	var posX = calqueToMove.style.left.split("px");
	var positionCalque = posX[0] * 1;
	
	// Test la position du calque 
	if ((positionCalque) < destination)
	{
		// Déplacement de calque
		calqueToMove.style.left = (positionCalque) + pas;		
	}
	else
	{
		// Arrêt de la minuterie
		window.clearInterval(moveInterval);
	}
}

function timerMove(calque, pas, depart, destination, interval)
{	
	moveInterval = setInterval ('moveCalque(\'' + calque + '\', '+pas+', '+depart+', '+destination+')', interval);
}