/**
*
*	Contient la fonction du mécanisme de carrousel à défilement automatique d'images
*
*	- Carrousel(height,width,speed) return VOID
*/

function Carrousel(height,width,speed) {
	
	this.sliderheight = height;
	this.sliderwidth = width;
	this.slidespeed = speed;
	
	this.slidebgcolor = 'transparent';
	this.leftrightslide=new Array();
	this.i=0;
	this.leftrightslide;
	this.finalslide='';
	this.copyspeed=this.slidespeed;
	this.slideshowgap=5;
	
	this.iedom=document.all||document.getElementById;
	this.actualwidth='';
	this.cross_slide=null;
	this.ns_slide=0;
	this.dec=0; // Fix du décalage des DIVs sous IE 7

	this.slideleft=function(){
		if (this.iedom){
			if (parseInt(this.cross_slide.style.left)>-(this.actualwidth+8+this.dec)){
				this.cross_slide.style.left=parseInt(this.cross_slide.style.left)-this.copyspeed+"px";
			}else{	
				this.cross_slide.style.left=parseInt(this.cross_slide2.style.left)+this.actualwidth+this.slideshowgap+"px";	
			}
			if (parseInt(this.cross_slide2.style.left)>-(this.actualwidth+8+this.dec)){
				this.cross_slide2.style.left=parseInt(this.cross_slide2.style.left)-this.copyspeed+"px";
			}else{
				this.cross_slide2.style.left=parseInt(this.cross_slide.style.left)+this.actualwidth+this.slideshowgap+"px";
			}
		}
	}
	
	this.fillup=function(){
		if (this.iedom){
			this.cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2;
			this.cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3;
		
			this.actualwidth=document.all? this.cross_slide.offsetWidth : document.getElementById("temp").offsetWidth;
			if(document.all) this.dec=this.actualwidth/2;

			this.cross_slide2.style.left=this.actualwidth+this.slideshowgap-this.dec+"px";
			this.cross_slide.style.left=parseInt(this.cross_slide.style.left)-this.dec+"px";
		}
	}
}