var deplacement = new Array();
var vitesse = new Array();
var slideshowId = new Array();
var direction = new Array();
var largeur = new Array();
var hauteur = new Array();
var couleurfond = new Array();
var contenu = new Array();
var reprise = new Array();
var next=0;


var operbr=navigator.userAgent.toLowerCase().indexOf('opera');

if(operbr==-1&&navigator.product&&navigator.product=="Gecko")
{
	var agt = navigator.userAgent.toLowerCase();
	var rvStart = agt.indexOf('rv:');
	var rvEnd = agt.indexOf(')', rvStart);
	var check15 = agt.substring(rvStart+3, rvEnd);
	if(parseFloat(check15)>=1.8)
		operbr=0;
}

if (navigator.appVersion.indexOf("Mac")!=-1)
	operbr=0;

function initSlideshow()
{
	for(i=0;i<slideshowId.length;i++)
	{
		reprise[i] = deplacement[i];

		divId=eval(document.getElementById(slideshowId[i]));
		divId.innerHTML=('<nobr>'+contenu[i]+'</nobr>');
		if(operbr!=-1)
		{
			divOpera=eval(document.getElementById(slideshowId[i]+'opera'));
			divOpera.innerHTML=('<nobr>'+contenu[i]+'</nobr>');
		}
		if(direction[i]=='gauche')
		{
			divId.style.left=largeur[i]+"px";
		}
		else if(direction[i]=='droite')
		{
			divId.style.right=largeur[i]+"px";
		}
		else if(direction[i]=='haut')
		{
			divId.style.top=hauteur[i]+"px";
			divId.style.left="0px";
		}
		else if(direction[i]=='bas')
		{
			divId.style.bottom=hauteur[i]+"px";
			divId.style.left="0px";
		}
	
	}
	slideshow(0);
}

function slideshow(x)
{
	if (x >= slideshowId.length)
		x=0;
	next=x+1;

	divId2=eval(document.getElementById(slideshowId[x]));
	divLarg=divId2.offsetWidth;
	if(divId2.offsetHeight)
	{
		divHaut=divId2.offsetHeight;
	}
	else if(divId2.style.pixelHeight)
	{
		divHaut=divId2.style.pixelHeight;
	}
	if(direction[x]=='gauche')
	{
		if(parseInt(divId2.style.left)>=divLarg*(-1))
		{
			divId2.style.left=parseInt(divId2.style.left)-deplacement[x]+"px";
			setTimeout("slideshow(next)",vitesse[x]);
		}
		else
		{
			divId2.style.left=largeur[x]+"px";
			slideshow(next);
		}
	}
	else if(direction[x]=='droite')
	{
		if(parseInt(divId2.style.right)>=divLarg*(-1))
		{
			divId2.style.right=parseInt(divId2.style.right)-deplacement[x]+"px";
			setTimeout("slideshow(next)",vitesse[x]);
		}
		else
		{
			divId2.style.right=largeur[x]+"px";
			slideshow(next);
		}
	}
	else if(direction[x]=='haut')
	{
		if(parseInt(divId2.style.top)>=divHaut*(-1))
		{
			divId2.style.top=parseInt(divId2.style.top)-deplacement[x]+"px";
			setTimeout("slideshow(next)",vitesse[x]);
		}
		else
		{
			divId2.style.top=hauteur[x]+"px";
			slideshow(next);
		}
	}
	else if(direction[x]=='bas')
	{
		if(parseInt(divId2.style.bottom)>=divHaut*(-1))
		{
			divId2.style.bottom=parseInt(divId2.style.bottom)-deplacement[x]+"px";
			setTimeout("slideshow(next)",vitesse[x]);
		}
		else
		{
			divId2.style.bottom=hauteur[x]+"px";
			slideshow(next);
		}
	}
}

function affiche_slideshow(numero)
{
	  if(document.getElementById || document.all)
	  {
      document.write('<span style="width:'+largeur[numero]+'px;"><div style="position:relative;overflow:hidden;width:'+largeur[numero]+'px;height:'+hauteur[numero]+'px;clip:rect(0 '+largeur[numero]+'px '+hauteur[numero]+'px 0);background-color:'+couleurfond[numero]+';" onMouseover="deplacement['+numero+']=0;" onMouseout="deplacement['+numero+']=reprise['+numero+']">');
      if(operbr!=-1)
	   document.write('<div id="'+slideshowId[numero]+'opera" style="position:absolute;visibility:hidden;"></div>');

      document.write('<div id="'+slideshowId[numero]+'" style="position:absolute;"></div></div></span>');
	  }
}