
function MotionGallery(NomClasse,monObj,options){
	/***********************************************
	* CMotion Image Gallery- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
	* Visit http://www.dynamicDrive.com for source code
	* This copyright notice must stay intact for legal use
	* Modified for autowidth and optional starting positions in
	* http://www.dynamicdrive.com/forums/showthread.php?t=11839 by jschuer1 8/5/06
	***********************************************/
	
	 //1) Set width of the "neutral" area in the center of the gallery.
	this.restarea=20;
	 //2) Set top scroll speed in pixels. Script auto creates a range from 0 to top speed.
	this.maxspeed=5;
	 //3) Set to maximum width for gallery - must be less than the actual length of the image train.
	this.maxwidth=1000;
	 //4) Set to 1 for left start, 0 for right, 2 for center.
	this.startpos=0;
	 //5) Set message to show at end of gallery. Enter "" to disable message.
	this.endofgallerymsg =''  //='<span style="font-size: 11px;">End of Gallery</span>';
	
	this.bounce=0;
	// nbre de pixels de défilement auto
	
	this.bounceSpeed=20;
	// millisec entre chaque déplacement si défilement auto 
	
	////NO NEED TO EDIT BELOW THIS LINE////////////
	
	this.iedom=document.all||document.getElementById
	this.scrollspeed=0
	this.movestate=''
	this.actualwidth=''
	this.cross_scroll
	this.statusdiv
	this.loadedyes=0
	this.lefttime
	this.righttime
	
	this.bounceTime
	this.bounceInAction=false
	
	// gerer le parametre options
	
	if(typeof options != 'undefined') { this.options = options; } else { this.options = {}; }
	if(this.options.endofgallerymsg) { this.endofgallerymsg = this.options.endofgallerymsg; }
	if(this.options.restarea) { this.restarea = this.options.restarea; }
	if(this.options.maxspeed) { this.maxspeed = this.options.maxspeed; }
	if(this.options.maxwidth) { this.maxwidth = this.options.maxwidth; }
	if(this.options.startpos) { this.startpos = this.options.startpos; }
	if(this.options.bounce) { this.bounce = this.options.bounce; }
	if(this.options.bounceSpeed) { this.bounceSpeed = this.options.bounceSpeed; }
	
	
	if(this.options.endofgallerymsg) { this.endofgallerymsg = this.options.endofgallerymsg; }
	
	// Fin gerer le parametre options
	
	this.ietruebody=function (){
		
		return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
	}
	this.getposOffset=function (what, offsettype){
		var totaloffset=(offsettype=="left")? what.offsetLeft: what.offsetTop;
		var parentEl=what.offsetParent;
		while (parentEl!=null){
			totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
			parentEl=parentEl.offsetParent;
		}
		return totaloffset;
	}	
	this.creatediv=function(){
		this.statusdiv=document.createElement("div")
		this.statusdiv.setAttribute("id",NomClasse+"statusdiv")
		document.getElementById(NomClasse+"_motioncontainer").appendChild(this.statusdiv)
		this.statusdiv=document.getElementById(NomClasse+"statusdiv")
		this.showhidediv("hidden");
		this.statusdiv.innerHTML=this.endofgallerymsg
	}
	
	this.positiondiv=function(){
		var mainobjoffset=this.getposOffset(crossmain, "left"),
		menuheight=parseInt(crossmain.offsetHeight),
		mainobjoffsetH=this.getposOffset(crossmain, "top");
		this.statusdiv.style.left=mainobjoffset+(menuwidth/2)-(this.statusdiv.offsetWidth/2)+"px";
		this.statusdiv.style.top=menuheight+mainobjoffsetH+"px";
	}
	
	this.showhidediv=function (what){
		if (this.endofgallerymsg!="") {
			this.positiondiv();
			this.statusdiv.style.visibility=what;
		}
	}
	
	this.moveleft=function (){
		//status=this.scrollspeed
		if (this.loadedyes){
			this.movestate="left";
			if (this.iedom&&parseInt(this.cross_scroll.style.left)>(menuwidth-this.actualwidth)){
				this.cross_scroll.style.left=parseInt(this.cross_scroll.style.left)-this.scrollspeed+"px";
				this.showhidediv("hidden");
				this.lefttime=setTimeout(monObj+".moveleft()",((this.bounceInAction)?this.bounceSpeed:10));
			}
			else{
				this.showhidediv("visible");
				if(this.bounceInAction){
						this.lefttime=setTimeout(monObj+".moveright()",30);
				}
			}
		}
		
	}
	
	this.moveright=function (){
		//status=this.scrollspeed
		if (this.loadedyes){
			this.movestate="right";
			if (this.iedom&&parseInt(this.cross_scroll.style.left)<0){
				this.cross_scroll.style.left=parseInt(this.cross_scroll.style.left)+this.scrollspeed+"px";
				this.showhidediv("hidden");
				this.righttime=setTimeout(monObj+".moveright()",((this.bounceInAction)?this.bounceSpeed:10) );
			}
			else{
					this.showhidediv("visible");
					if(this.bounceInAction){
						this.righttime=setTimeout(monObj+".moveleft()",30);
					}
			}
			}
		
		
	}
	
	this.autobounce=function(compteur){
		if (this.bounce!=0){
			clearTimeout(this.bounceTime);
			this.bounceInAction=true
			this.scrollspeed=Math.abs(this.bounce);
			clearTimeout(this.righttime);
			clearTimeout(this.lefttime);
			if (this.bounce<0){
				this.moveright();
			}else{
				this.moveleft();
			}
		}
	}
	
	this.motionengine=function (e){
		clearTimeout(this.bounceTime);
		this.bounceInAction=false
		var mainobjoffset=this.getposOffset(crossmain, "left"),
		dsocx=(window.pageXOffset)? pageXOffset: this.ietruebody().scrollLeft;
		dsocy=(window.pageYOffset)? pageYOffset : this.ietruebody().scrollTop;
		curposy=window.event? event.clientX : e.clientX? e.clientX: "";
		curposy-=mainobjoffset-dsocx;
		var leftbound=(menuwidth-this.restarea)/2;
		var rightbound=(menuwidth+this.restarea)/2;
		if (curposy>rightbound){
			this.scrollspeed=(curposy-rightbound)/((menuwidth-this.restarea)/2) * this.maxspeed;
			clearTimeout(this.righttime);
			if (this.movestate!="left") this.moveleft();
		}
		else if (curposy<leftbound){
			this.scrollspeed=(leftbound-curposy)/((menuwidth-this.restarea)/2) * this.maxspeed;
			clearTimeout(this.lefttime);
			if (this.movestate!="right") this.moveright();
		}
		else
		this.scrollspeed=0;
	}
	
	this.contains_ns6=function (a, b) {
		if (b!==null)
		while (b.parentNode)if ((b = b.parentNode) == a)return true;
		return false;
	}
	
	this.stopmotion=function (e){
		if (!window.opera||(window.opera&&e.relatedTarget!==null))
		if ((window.event&&!crossmain.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !this.contains_ns6(e.currentTarget, e.relatedTarget))){
			clearTimeout(this.lefttime);
			clearTimeout(this.righttime);
			this.movestate="";
		}
	}
	
	this.fillup=function (){
		
		// creation auto des DIV :
		//<div id="motioncontainer" style="height:170;position:relative;overflow:hidden;">
		//<div id="motiongallery" style="position:relative;left:0;top:0;white-space: nowrap;">
		if(false && document.createElement){
			alert("...")
			// creation auto des DIV :
			//<div id="motioncontainer" style="height:170;position:relative;overflow:hidden;">
			//<div id="motiongallery" style="position:relative;left:0;top:0;white-space: nowrap;">
			
			var objAll=document.getElementById? document.getElementById(NomClasse) : document.all[NomClasse];
			
				var div2=document.createElement('div');
				div2.name=NomClasse+"_motiongallery"
				div2.id=NomClasse+"_motiongallery"
				div2.style.position='relative';
				div2.style.left=0;
				div2.style.top=0;
				div2.style.whitespace="nowrap";
				
				//div2.appendChild(objAll);
				
				var div1=document.createElement('div');
				div1.name=NomClasse+"_motioncontainer"
				div1.id=NomClasse+"_motioncontainer"
				div1.style.position='relative';
				div1.style.overflow='hidden';
				
				
				div1.appendChild(div2);
				//alert(div1.outerHTML)
				

			//	alert(div1)
			//	objAll.parentNode.removeChild(objAll);
			//objAll.parentNode.appendChild(div1,objAll)
			alert(objAll.parentNode.outerHTML)
			alert(div1.outerHTML)
			//objAll.parentNode.insertBefore(div1,objAll)
			alert("ok")
		}else{
			//return false;
		}
		if (this.iedom){
				
			crossmain=document.getElementById? document.getElementById(NomClasse+"_motioncontainer") : document.all[NomClasse+"_motioncontainer"];
			
			
			if(typeof crossmain.style.maxWidth!=='undefined')crossmain.style.maxWidth=this.maxwidth+'px';
			
			menuwidth=parseInt(crossmain.offsetWidth);
			if(false && menuwidth==0){
				menuwidth=parseInt(crossmain.style.width);
				this.cross_scroll=document.getElementById? document.getElementById(NomClasse+"_motiongallery") : document.all[NomClasse+"_motiongallery"];
				this.actualwidth=document.getElementById? document.getElementById(NomClasse).style.width : document.all[NomClasse].style.width;
			}else{
				this.cross_scroll=document.getElementById? document.getElementById(NomClasse+"_motiongallery") : document.all[NomClasse+"_motiongallery"];
				this.actualwidth=document.getElementById? document.getElementById(NomClasse).offsetWidth : document.all[NomClasse].offsetWidth;
			}
			//alert("menuwidth="+menuwidth)
			//status=("this.actualwidth="+this.actualwidth)
			
			if (this.startpos)this.cross_scroll.style.left=(menuwidth-this.actualwidth)/this.startpos+'px';
			
			
			crossmain.onmousemove=function(e){
				clearTimeout(this.bounceTime);
				eval(monObj).bounceInAction=false
				eval(monObj).motionengine(e);
				
			}
			
			crossmain.onmouseout=function(e){
				eval(monObj).stopmotion(e);
				eval(monObj).showhidediv("hidden");
				if(eval(monObj).bounce!=0){
					eval(monObj).bounceTime=setTimeout(monObj+".autobounce(0)",2000);
					//this.lefttime=setTimeout(monObj+".moveleft()",10);
				}
				
			}
		}
		this.loadedyes=1
		if (this.endofgallerymsg!=""){
			this.creatediv();
			this.positiondiv();
		}
		
		this.bounceTime=setTimeout(monObj+".autobounce(0)",200);
		
		/*
		if (document.body.filters){
			
			if (typeof motioncontainer!=='undefined'&&motioncontainer.filters){
				motioncontainer.style.width="0";
				motioncontainer.style.width="";
				motioncontainer.style.width=Math.min(motioncontainer.offsetWidth, this.maxwidth)+'px';
			}
			menuwidth=crossmain.offsetWidth;
			this.cross_scroll.style.left=this.startpos? (menuwidth-this.actualwidth)/this.startpos+'px' : 0;			
		}
		*/
	}
	
	
	
	
	
	
	this.addLoadEvent=function (func) {
	  var oldonload = window.onload;
	  if (typeof window.onload != 'function') {
	    window.onload = func;
	  } else {
	    window.onload = function() {
	      if (oldonload) {//avoid a runtime error in IE 7
	        oldonload();
	      }
	      func();
	    }
	  }
	}
	
	//self=this
	//this.addLoadEvent( self.fillup )
	
	setTimeout(monObj+".fillup()",1000);
	
	//setTimeout(monObj+".fillup()",20);
	
}







function FishEye(nomClass,monObj , options){
	
	this.ImgBigRatio=1
	this.ImgSmallRatio=1
	this.TitleRGBon="0,0,0"
	this.TitleRGBoff="255,255,255"
	
	if (!this.replaceFromSmall)this.replaceFromSmall="-sm.gif"
	if (!this.replaceToBig)this.replaceToBig=".gif"
	
	// gerer le parametre options
	
	if(typeof options != 'undefined') { this.options = options; } else { this.options = {}; }
	if(this.options.replaceFromSmall) { this.replaceFromSmall = this.options.replaceFromSmall; }
	if(this.options.replaceToBig) { this.replaceToBig = this.options.replaceToBig; }
	if(this.options.ImgBigRatio) { this.ImgBigRatio = this.options.ImgBigRatio; }
	if(this.options.ImgSmallRatio) { this.ImgSmallRatio = this.options.ImgSmallRatio; }
	if(this.options.TitleRGBon) { this.TitleRGBon = this.options.TitleRGBon; }
	if(this.options.TitleRGBoff) { this.TitleRGBoff = this.options.TitleRGBoff; }
	
	// Fin gerer le parametre options

	////NO NEED TO EDIT BELOW THIS LINE////////////
	
	this.IncrStepW=3
	this.IncrStepH=3
	
	this.ImgCurrentArray=new Array();// Tailles des SmallVignettesSize 
	
	this.ImgBigCacheArray=new Array();
	this.ImgSmallCacheArray=new Array();
	this.ab=10;
	this.t=0;
	this.u=0;
	this.n=0;
	
	this.numImage=0;
	this.w=false;
	this.title="";
	this.p=0;
	this.o=new Date();

	this.TitleRGBOnArray=this.TitleRGBon.split(",")
	this.TitleRGBOffArray=this.TitleRGBoff.split(",")
	this.difR=Math.round(parseInt(this.TitleRGBOnArray[0])-this.TitleRGBOffArray[0])
	this.difG=Math.round(parseInt(this.TitleRGBOnArray[1])-this.TitleRGBOffArray[1])
	this.difB=Math.round(parseInt(this.TitleRGBOnArray[2])-this.TitleRGBOffArray[2])

	this.findPos=function(obj) {
		var curleft = curtop = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft
			curtop = obj.offsetTop
			while (obj = obj.offsetParent) {
				curleft += obj.offsetLeft
				curtop += obj.offsetTop
			}
		}
		return [curleft,curtop];
	}
	
	this.ts_check = function(o,c){
	 	return new RegExp('\\b'+c+'\\b').test(o.className);
	}	
	this.d=function(ac){
		for(var i=1;i<this.ImgBigCacheArray.length;i++){
			if((this.ImgBigCacheArray[i].name)==(ac.id)){
				this.numImage=i;
				break;
			}
		}
		this.o=new Date();
		setTimeout(monObj+".gidle()",20);
	}
	this.e=function(ac){
		this.numImage=0;
		this.w=false;
		this.o=new Date();
		setTimeout(monObj+".gidle()",20);
	}
	
	this.init=function(){
		//recuperer tous les id de <img ayant comme class="nomClass"
		//pour avoir la liste des images big
		
		//alert(monObj)
		var num=0
		
		num++
		var sels=document.getElementsByTagName('img');
		for(var i=0;i<sels.length;i++){
			if (this.ts_check(sels[i],nomClass))
			{
				if (num<2 && !document.getElementById(monObj+nomClass+"TestImage")) {
					var img=document.createElement('img');
					img.name=monObj+nomClass+"TestImage"
					img.id=monObj+nomClass+"TestImage"
					//img.src="/images/shim.gif"
					img.border=0
					img.style.visibility='hidden';
					img.style.position='absolute';
					img.style.top="-2000px"
					sels[i].parentNode.insertBefore(img,sels[i].nextSibling)
				}
				
				
				var oldonmouseover = sels[i].onmouseover;
				if(typeof oldonmouseover!='function'){
					sels[i].onmouseover=function(){eval(monObj).d(this);}
				}else{
					sels[i].onmouseover=function(){oldonmouseover(); eval(monObj).d(this);}
				}
				
				
				
				var oldonmouseout = sels[i].onmouseover;
				if(typeof oldonmouseout!='function'){
					sels[i].onmouseout=function(){eval(monObj).e(this);}
				}else{
					sels[i].onmouseout=function(){oldonmouseout();eval(monObj).e(this);}
				}
				
				sels[i].id=nomClass+"Image"+num
				sels[i].name=nomClass+"Image"+num
				
				this.ImgBigCacheArray[num]=new Image();
				myself=this
				this.ImgBigCacheArray[num].onreadystatechange=function(){
						myself.imageBigDownloaded( myself, num)
				}
				this.ImgBigCacheArray[num].src=sels[i].src.replace(this.replaceFromSmall,this.replaceToBig) //.replace("_Small","_Screen")
				this.ImgBigCacheArray[num].name=sels[i].id
				
				this.ImgSmallCacheArray[num]=new Image();
				myself=this
				this.ImgSmallCacheArray[num].onreadystatechange=function(){
						myself.imageSmallDownloaded(myself , num)
				}
				
				this.ImgSmallCacheArray[num].src=sels[i].src
				this.ImgSmallCacheArray[num].name=sels[i].id
				this.ImgSmallCacheArray[num].width=sels[i].width
				this.ImgSmallCacheArray[num].height=sels[i].height

				num++
			}
		}	
		this.ImgBigCacheArray[0]="null"
		this.ImgSmallCacheArray[0]="null"
		
		this.ImgCurrentArray=new Array(num)
		for(var j=1;j<num;j++){
			this.ImgCurrentArray[j]=new Image();
			this.ImgCurrentArray[j].width=this.ImgSmallCacheArray[j].width
			this.ImgCurrentArray[j].height=this.ImgSmallCacheArray[j].height
		}

		this.start()
		//FIN recuperer tous les id de <img ayant comme class="FishEye" 
	}
	this.start=function(){
		
		num=this.ImgSmallCacheArray.length  
		
		//recherche du DIV du titre
		var sels=document.getElementsByTagName('div');
		for(var i=0;i<sels.length;i++){
			if (this.ts_check(sels[i],nomClass))
			{
				sels[i].id=nomClass+"_title"
				sels[i].name=nomClass+"_title"
				this.title=nomClass+"_title";
				break;
			}
		}	
		
		this.TitleRGBOnArray=this.TitleRGBon.split(",")
		this.TitleRGBOffArray=this.TitleRGBoff.split(",")
		this.difR=Math.round(parseInt(this.TitleRGBOnArray[0])-this.TitleRGBOffArray[0])
		this.difG=Math.round(parseInt(this.TitleRGBOnArray[1])-this.TitleRGBOffArray[1])
		this.difB=Math.round(parseInt(this.TitleRGBOnArray[2])-this.TitleRGBOffArray[2])
		this.TitleRGBOnArray[0]=parseInt(this.TitleRGBOnArray[0])
		this.TitleRGBOnArray[1]=parseInt(this.TitleRGBOnArray[1])
		this.TitleRGBOnArray[2]=parseInt(this.TitleRGBOnArray[2])
		
		setTimeout(monObj+".gidle()",2000);
	}


	
	this.imageBigDownloaded=function(TheObject , num){
		if(this.ImgBigCacheArray[num] && (this.ImgBigCacheArray[num].readyState  || this.ImgBigCacheArray[num].complete )){
			if (this.ImgBigCacheArray[num].readyState  == "complete" || this.ImgBigCacheArray[num].complete){
				var ObjToTest=document.getElementById( monObj+nomClass+"TestImage" )

				ObjToTest.src=this.ImgBigCacheArray[num].src
				this.ImgBigCacheArray[num].width=ObjToTest.width
				this.ImgBigCacheArray[num].height=ObjToTest.height
				//status=this.ImgBigCacheArray[num].src +"--"+ObjToTest.width +"**"+ObjToTest.height
				return true;
			}else{
				TheObject.ImgBigCacheArray[num].onreadystatechange=function(){
						TheObject.imageBigDownloaded(TheObject,num)
				}
				return false;
			}
			
		}
		return false;
	}
	this.imageSmallDownloaded=function(TheObject, num){
		//status="imageSmallDownloaded-1"
		if (this.ImgSmallCacheArray[num] && ( this.ImgSmallCacheArray[num].readyState || this.ImgSmallCacheArray[num].complete ) ){
			//status="imageSmallDownloaded-2"
			if (this.ImgSmallCacheArray[num].readyState  == "complete" || this.ImgSmallCacheArray[num].complete ){
				var ObjToTest=document.getElementById( nomClass+"Image"+num )
				ObjToTest.src=this.ImgSmallCacheArray[num].src
				this.ImgSmallCacheArray[num].width=ObjToTest.width
				this.ImgSmallCacheArray[num].height=ObjToTest.height
				//status="imageSmallDownloaded-3 ObjToTest.width="+ObjToTest.width+" ObjToTest.height="+ObjToTest.height
				return true;
			}else{
				//status="imageSmallDownloaded-4"
				TheObject.ImgSmallCacheArray[num].onreadystatechange=function(){
						TheObject.imageSmallDownloaded(TheObject,num)
						//status="imageSmallDownloaded-5"
				}
				//status="imageSmallDownloaded-6"
				return false;
			}
			//status="imageSmallDownloaded-7"
		}
		//status="imageSmallDownloaded-8"
		return false;
	}
	
	
	this.gidle=function(){
		var objTitle= document.getElementById(this.title)
		this.IncrStepW=3
		this.IncrStepH=3
		myself=this
		for(var i=1;i<this.ImgCurrentArray.length;i++){
			if(!this.ImgBigCacheArray[i].width || !this.ImgBigCacheArray[i].height)this.imageBigDownloaded(myself , i)
			if(!this.ImgSmallCacheArray[i].width || !this.ImgSmallCacheArray[i].height)this.imageSmallDownloaded(myself , i)
			
			
			if(this.ImgSmallCacheArray[i].width && this.ImgBigCacheArray[i].width && this.ImgSmallCacheArray[i].height && this.ImgBigCacheArray[i].height){
				
				this.IncrStepW=Math.round(( (this.ImgBigCacheArray[i].width*this.ImgBigRatio)-(this.ImgSmallCacheArray[i].width*this.ImgSmallRatio))/15)
				this.IncrStepH=Math.round(( (this.ImgBigCacheArray[i].height*this.ImgBigRatio)-(this.ImgSmallCacheArray[i].height*this.ImgSmallRatio))/15)
				if(this.IncrStepW==0)this.IncrStepW=1
				if(this.IncrStepH==0)this.IncrStepH=1
				var imagename=nomClass+"Image"+i;
				var imageElem=document.getElementById(imagename);
				if(this.numImage!=i){
					if( this.ImgCurrentArray[i].width>(this.ImgSmallCacheArray[i].width*this.ImgSmallRatio) || this.ImgCurrentArray[i].height>(this.ImgSmallCacheArray[i].height*this.ImgSmallRatio )){
						//On diminue la taille de l'image
						this.ImgCurrentArray[i].width-=this.IncrStepW;
						this.ImgCurrentArray[i].height-=this.IncrStepH;
						if(this.ImgCurrentArray[i].width<=(this.ImgSmallCacheArray[i].width*this.ImgSmallRatio)  ){
							this.ImgCurrentArray[i].width=this.ImgSmallCacheArray[i].width*this.ImgSmallRatio;
							imageElem.src=this.ImgSmallCacheArray[i].src
						}
						if( this.ImgCurrentArray[i].height<=(this.ImgSmallCacheArray[i].height*this.ImgSmallRatio) ){
							this.ImgCurrentArray[i].height=this.ImgSmallCacheArray[i].height*this.ImgSmallRatio;
							imageElem.src=this.ImgSmallCacheArray[i].src
						}
						imageElem.width=this.ImgCurrentArray[i].width;
						imageElem.height=this.ImgCurrentArray[i].height;
						if(this.numImage==0 && this.title!=""){
							var ratio=(100-100*(this.ImgCurrentArray[i].width-(this.ImgSmallCacheArray[i].width*this.ImgSmallRatio))/(this.ImgSmallCacheArray[i].width*this.ImgSmallRatio)) /100;
							if(ratio>1)ratio=1
							if(ratio<0)ratio=0
							r=Math.round( (this.TitleRGBOnArray[0]) -( this.difR*ratio ))
							g=Math.round( (this.TitleRGBOnArray[1]) -( this.difG*ratio ))
							b=Math.round( (this.TitleRGBOnArray[2]) -( this.difB*ratio ))
							objTitle.style.color="rgb("+r+","+g+","+b+")";
						}
						this.p=1
					}
				}
			}
		}
		
		if(this.numImage!=0 && (this.ImgCurrentArray[this.numImage].width && this.ImgBigCacheArray[this.numImage].width && this.ImgCurrentArray[this.numImage].height && this.ImgBigCacheArray[this.numImage].height) && (this.ImgCurrentArray[this.numImage].width<(this.ImgBigCacheArray[this.numImage].width*this.ImgBigRatio) || this.ImgCurrentArray[this.numImage].height<(this.ImgBigCacheArray[this.numImage].height*this.ImgBigRatio))  ){
			//agrandir la taille de l'image
			
			
			if(this.ImgSmallCacheArray[this.numImage].height>this.ImgBigCacheArray[this.numImage].height || this.ImgSmallCacheArray[this.numImage].width>this.ImgBigCacheArray[this.numImage].width){
				//alert(this.ImgSmallCacheArray[this.numImage].height +"\n"+ this.ImgBigCacheArray[this.numImage].height +"\n"+ this.ImgSmallCacheArray[this.numImage].width +"\n"+ this.ImgBigCacheArray[this.numImage].width )
				this.imageSmallDownloaded(myself , this.numImage)
				this.imageBigDownloaded(myself , this.numImage)
			}else{
			
				
				imagename=nomClass+"Image"+this.numImage;
				imageElem=document.getElementById(imagename);
				if(this.w==false){
					this.w=true;
					if(this.title!="")objTitle.innerHTML=imageElem.alt
				}
				
				this.IncrStepW=Math.round(( (this.ImgBigCacheArray[this.numImage].width*this.ImgBigRatio)-(this.ImgSmallCacheArray[this.numImage].width*this.ImgSmallRatio))/15)
				this.IncrStepH=Math.round(( (this.ImgBigCacheArray[this.numImage].height*this.ImgBigRatio)-(this.ImgSmallCacheArray[this.numImage].height*this.ImgSmallRatio))/15 )
				//status=this.IncrStepW +"---"+ this.IncrStepH
				if(this.IncrStepW==0)this.IncrStepW=1
				if(this.IncrStepH==0)this.IncrStepH=1
				
				this.ImgCurrentArray[this.numImage].width+=this.IncrStepW;
				this.ImgCurrentArray[this.numImage].height+=this.IncrStepH;
				this.p=1;
				
				//status=this.ImgCurrentArray[this.numImage].height +"--"+ this.ImgBigCacheArray[this.numImage].height +"***"+ this.ImgSmallCacheArray[this.numImage].height +"***"+ this.IncrStepH;
				
				if(this.ImgCurrentArray[this.numImage].width>(this.ImgBigCacheArray[this.numImage].width*this.ImgBigRatio)){
					this.ImgCurrentArray[this.numImage].width=this.ImgBigCacheArray[this.numImage].width*this.ImgBigRatio
				}
				if( this.ImgCurrentArray[this.numImage].height>(this.ImgBigCacheArray[this.numImage].height*this.ImgBigRatio) ){
					this.ImgCurrentArray[this.numImage].height=this.ImgBigCacheArray[this.numImage].height*this.ImgBigRatio
				}
				imageElem.width=this.ImgCurrentArray[this.numImage].width;
				imageElem.height=this.ImgCurrentArray[this.numImage].height;
				if(imageElem.src!=this.ImgBigCacheArray[this.numImage].src)imageElem.src=this.ImgBigCacheArray[this.numImage].src
			}
		}
		
		
		
		if(this.numImage!=0  && this.title!="" && objTitle && objTitle.style && objTitle.style.color ){
			var ratio=( ((this.ImgBigCacheArray[this.numImage].width*this.ImgBigRatio) - (this.ImgCurrentArray[this.numImage].width) )*100  / ((this.ImgBigCacheArray[this.numImage].width*this.ImgBigRatio) - (this.ImgSmallCacheArray[this.numImage].width*this.ImgSmallRatio)) )  /100
			if(ratio>1)ratio=1
			if(ratio<0)ratio=0
			if(ratio==='NaN')ratio=0
			r=Math.round( (this.TitleRGBOnArray[0]) -( this.difR*ratio ))
			g=Math.round( (this.TitleRGBOnArray[1]) -( this.difG*ratio ))
			b=Math.round( (this.TitleRGBOnArray[2]) -( this.difB*ratio ))
			
			if(r<256 && r>=0 && g<256 && g>=0 && b<256 && b>=0) {
				objTitle.style.color="rgb("+r+","+g+","+b+")";
			}else{
				objTitle.style.color="rgb("+ this.TitleRGBOnArray[0] +","+ this.TitleRGBOnArray[1] +","+ this.TitleRGBOnArray[2] +")";
			}
			//else{
			//	alert( this.ImgBigCacheArray[this.numImage].width +"xxx"+ this.ImgBigRatio +"uuu"+ this.ImgCurrentArray[this.numImage].width +"ooooo"+ this.ImgBigCacheArray[this.numImage].width +"mmmmm"+ this.ImgSmallCacheArray[this.numImage].width +"pppppp"+ this.ImgSmallRatio )
			//}
		}
		
		var ad=new Date();
		this.ab=ad.getTime()-this.o.getTime();
		this.o=ad;
		this.t+=this.ab;
		this.u++;
		this.n=this.t/this.u;
		this.IncrStepW=3;
		this.IncrStepH=3;
		
		if(this.u>4){
			if(this.n>30){this.IncrStepW=5;this.IncrStepH=5}
			if(this.n>60){this.IncrStepW=10;this.IncrStepH=10}
			if(this.n>90){this.IncrStepW=20;this.IncrStepH=20}
		}
		if(this.p){
			setTimeout(monObj+".gidle()",20);
			this.p=0
		}
		
	}
	
	
	this.addLoadEvent=function (func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		}
		else {
			window.onload = function() {
				oldonload();
				func();
			}
		}
		return true
	}
	setTimeout(monObj+".init()",1000);
	
	
	
}

function addLoadEvent (func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		}
		else {
			window.onload = function() {
				oldonload();
				func();
			}
		}
		return true
}





var Accordion_AccordionInUse = new Array();

function Accordion(objId, options) {  //options = {duration:1 , classGroup:MonGroupe }
	this.obj = document.getElementById(objId);
	this.duration = 1;
	
		isDOM=document.getElementById?true:false
		isOpera=isOpera5=window.opera && isDOM
		isOpera6=isOpera && window.print
		isOpera7=isOpera && document.readyState
		isMSIE=isIE=document.all && document.all.item && !isOpera
		isStrict=document.compatMode=='CSS1Compat'
		isNN=isNC=navigator.appName=="Netscape"
		isNN4=isNC4=isNN && !isDOM
		isMozilla=isNN6=isNN && isDOM
	

	this.getWidth=function(o){
		if(isMSIE || isMozilla || isOpera7) return parseInt(o.offsetWidth)
		if(isOpera) return parseInt(this.css.pixelWidth)
		if(isNN4) return parseInt(o.document.width)
	}
	
	this.getHeight=function(o){
		if(isMSIE || isMozilla || isOpera7) return parseInt(o.offsetHeight)
		if(isOpera) return parseInt(this.css.pixelHeight)
		if(isNN4) return parseInt(o.document.height)
		return 900;
	}
	
	/*
	//on crée un div pour voir ca taille
	this.creatediv=function(){
		this.statusdiv=document.createElement("div")
		this.statusdiv.setAttribute("id",objId+"statusdiv")
		document.getElementById(objId).appendChild(this.statusdiv)
		this.statusdiv=document.getElementById(objId+"checkSize")
		this.showhidediv("hidden");
		this.statusdiv.innerHTML=this.endofgallerymsg
	}
	*/
	//status=this.obj
	this.height = (parseInt(this.obj.style.height)+""==="NaN")?this.getWidth(this.obj):parseInt(this.obj.style.height);

	this.width = (parseInt(this.obj.style.width)+""==="NaN")?this.getHeight(this.obj):parseInt(this.obj.style.width);
	
	//alert(parseInt(this.obj.style.height) +'---'+ (parseInt(this.obj.style.height)+""==="NaN"))
	//alert( this.getHeight(this.obj) )
//	this.width=getWidth(this.obj)
//	this.height=getHeight(this.obj)
	

	
	//alert("this.width="+this.width +"---this.height="+ this.height)
	
	this.classGroup=""	//Si indiqué, reduit tous les autres ayant cette valeur dans leur class="NomValeur"
	
	if(typeof options != 'undefined') { this.options = options; } else { this.options = {}; }
	if(this.options.duration) { this.duration = this.options.duration; }
	if(this.options.classGroup) { this.classGroup = this.options.classGroup; }



		
	this.closeUp = function() {
		//alert(this.obj.offsetHeight)
		this.curSize = this.height;
		
		this.newSize = '1';
		var ad=new Date();
		
		if(Accordion_AccordionInUse[objId] != true) {
			var tempoDisplay=this.obj.style.display;
			var tempoVisibility=this.obj.style.visibility;
			this.obj.style.visibility ='hidden';
			this.obj.style.display = 'block';
			var tempoHeight = this.getHeight(this.obj);
			this.obj.style.display = tempoDisplay;
			this.obj.style.visibility =tempoVisibility;
			
			var finishTime = this.AccordionAction("height");
			//status=finishTime
			
			window.setTimeout("Accordion('"+objId+"').finishup('height',"+tempoHeight+");",finishTime);
		}
	}
	
	this.openDown = function(bOnOff) {
		//alert(this.obj.offsetHeight)
		if (this.obj.style.display === 'none'){
			this.curSize = '1';
			if(Accordion_AccordionInUse[objId] != true) {
				if (this.classGroup!=""){
					var LesObjArray=this.getElementsByClass(this.classGroup,document,"DIV")
					var i=1
					for (var elts in LesObjArray){
						if(LesObjArray[elts].style.display !='none' && LesObjArray[elts].id != objId ){
							window.setTimeout("Accordion('"+ LesObjArray[elts].id +"',{duration:"+ (this.duration/2) +" }).closeUp();",30+(10 * i++));
						}
					}
				}
				this.obj.style.visibility ='hidden'
				this.obj.style.display = 'block';
				this.height = this.getHeight(this.obj);
				this.obj.style.height = '1px';
				this.newSize = this.height;
				this.obj.style.visibility ='visible'
				this.AccordionAction("height");
			}
		}else{
			if(bOnOff && Accordion_AccordionInUse[objId] != true) {
				window.setTimeout("Accordion('"+ objId +"',{duration:"+ (this.duration/2) +" }).closeUp();",30);
			}
		}
	}
	
	
	
	
	this.openRight = function() {
		if (this.classGroup!=""){
			var LesObjArray=this.getElementsByClass(this.classGroup)
			for (var elts in LesObjArray){
				if(LesObjArray[elts].style.display =='block' && LesObjArray[elts].id != objId ){
					window.setTimeout("Accordion('"+ LesObjArray[elts].id +"',{duration:"+ (this.duration/2) +" }).closeLeft();",30);
				}
			}
		}
		if (this.obj.style.display === 'none'){
			this.newSize = this.width;
			this.curSize = '1';
			if(Accordion_AccordionInUse[objId] != true) {
				this.obj.style.visibility ='hidden'
				this.obj.style.display = 'block';
				this.width = this.getWidth(this.obj);
				this.obj.style.width = '1px';
				this.newSize = this.width;
				this.obj.style.visibility ='visible'
				this.AccordionAction("width");
			}
		}
	}
	this.closeLeft = function() {
		this.curSize = this.width;
		this.newSize = '1';
		if(Accordion_AccordionInUse[objId] != true) {
			var finishTime = this.AccordionAction("width");
			window.setTimeout("Accordion('"+objId+"').finishup('width',"+this.width+");",finishTime);
		}
	}
	
	
	

	
	this.getElementsByClass=function (searchClass,node,tag) {
		if ( node == null )
			node = document;
		if ( tag == null )
			tag = '*';
		//alert(node.parentNode.tagName)
		var myNode=node
		var cheminObj=""
		while (myNode.parentNode){
			myNode=myNode.parentNode
			cheminObj=myNode.tagName +"~"+ cheminObj
		}
		cheminObj=searchClass +"_"+ cheminObj + "_" +tag
		//alert(cheminObj)
		
		
		
		var classElements = new Array();
		
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		//status=elsLen
		var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
		var j=0
		for (var i = 0; i < elsLen; i++) if ( pattern.test(els[i].className) ) classElements[j++] = els[i];
		
		
		return classElements;
	
	}
	
	this.AccordionAction = function(whichWay) { //whichWay = height / width
		Accordion_AccordionInUse[objId] = true;
		var frames = 30 * duration; // Running at 30 fps

		var tIncrement = (duration*1000) / frames;
		tIncrement = Math.round(tIncrement);
		var sIncrement = (this.curSize-this.newSize) / frames;

		var frameSizes = new Array();
		for(var i=0; i < frames; i++) {
			if(i < frames/2) {
				frameSizes[i] = (sIncrement * (i/frames))*4;
			} else {
				frameSizes[i] = (sIncrement * (1-(i/frames)))*4;
			}
		}
		//status=tIncrement
		for(var i=0; i < frames; i++) {
			this.curSize = this.curSize - frameSizes[i];
			window.setTimeout("document.getElementById('"+objId+"').style."+ whichWay +"='"+Math.round(this.curSize)+"px';",tIncrement * i);
		}
		//window.setTimeout("document.getElementById('"+objId+"').style."+ whichWay +"='"+ (this.newSize )+"px';",(tIncrement * i)+1000);
		
		//alert( "delete(Accordion_AccordionInUse['"+objId+"']);alert('Fin"+ objId +"')" )
		window.setTimeout("delete(Accordion_AccordionInUse['"+objId+"']);",(tIncrement * i));
		
		if(this.options.onComplete) {
			window.setTimeout(this.options.onComplete, tIncrement * (i-2));
		}
		
		return tIncrement * i;
	}
	
	this.finishup = function(whichWay , size) {
		this.obj.style.display = 'none';
		if (size!=""){size=size+"px"}
		if(whichWay=="width"){
			this.obj.style.width = size ;
		}else{
			this.obj.style.height = size ;
		}
	}
	
	return this;
}




/*
 * (c)2006 Jesse Skinner/Dean Edwards/Matthias Miller/John Resig
 * Special thanks to Dan Webb's domready.js Prototype extension
 * and Simon Willison's addLoadEvent
 *
 * For more info, see:
 * http://www.thefutureoftheweb.com/blog/adddomloadevent
 * http://dean.edwards.name/weblog/2006/06/again/
 * http://www.vivabit.com/bollocks/2006/06/21/a-dom-ready-extension-for-prototype
 * http://simon.incutio.com/archive/2004/05/26/addLoadEvent
 * 
 *
 * To use: call addDOMLoadEvent one or more times with functions, ie:
 *
 *    function something() {
 *       // do something
 *    }
 *    addDOMLoadEvent(something);
 *
 *    addDOMLoadEvent(function() {
 *        // do other stuff
 *    });
 *
 */
 
addDOMLoadEvent = (function(){
    // create event function stack
    var load_events = [],
        load_timer,
        script,
        done,
        exec,
        old_onload,
        init = function () {
            done = true;

            // kill the timer
            clearInterval(load_timer);

            // execute each function in the stack in the order they were added
            while (exec = load_events.shift())
                exec();

            if (script) script.onreadystatechange = '';
        };

    return function (func) {
        // if the init function was already ran, just run this function now and stop
        if (done) return func();

        if (!load_events[0]) {
            // for Mozilla/Opera9
            if (document.addEventListener)
                document.addEventListener("DOMContentLoaded", init, false);

            // for Internet Explorer
            /*@cc_on @*/
            /*@if (@_win32)
                document.write("<script id=__ie_onload defer src=//0><\/scr"+"ipt>");
                script = document.getElementById("__ie_onload");
                script.onreadystatechange = function() {
                    if (this.readyState == "complete")
                        init(); // call the onload handler
                };
            /*@end @*/

            // for Safari
            if (/WebKit/i.test(navigator.userAgent)) { // sniff
                load_timer = setInterval(function() {
                    if (/loaded|complete/.test(document.readyState))
                        init(); // call the onload handler
                }, 10);
            }

            // for other browsers set the window.onload, but also execute the old window.onload
            old_onload = window.onload;
            window.onload = function() {
                init();
                if (old_onload) old_onload();
            };
        }

        load_events.push(func);
    }
})();
