	tbimage=new Array('6.jpg','5.jpg','4.jpg','3.jpg','2.jpg','1.jpg') //tableau des image mettre le nom de toutes les images
	preImages=new Array
	var opaa=0;
	var opab=100;
	var compteur=2;
	var vitesse=40000;
	var valeurInitiale = Math.round(Math.random()*tbimage.length);
	var vB=valeurInitiale % tbimage.length;
	if (vB==0) {
		vB=1;
		//alert("vB = "+vB);
	}
	
	function init() {
		document.getElementById('imagefonduA').src='images/0.jpg';
		document.getElementById('imagefonduB').src='images/'+tbimage[vB];
	}

	function precharge() { 
		var vitesse=0;
  		for (i = valeurInitiale; i < tbimage.length+valeurInitiale; i++) { 
    			preImages[i] = new Image()
    			preImages[i].src = 'images/'+tbimage[i]
		}
		setTimeout(defilmage,vitesse);
	}
	
	function defilmage(reg){
		oxo=reg;
		if(compteur==tbimage.length-1){
			compteur=-1
		}
		if(oxo==1){
			compteur++
			opaa=10;
			document.getElementById('imagefonduB').src="images/"+tbimage[compteur];
			oxo=0;
		}
		var imacibleb=document.getElementById('imagefonduA');
		var imaciblea=document.getElementById('imagefonduB');
	
		opaa+=3;
		opab-=4;
		if(document.all && !window.opera){ 
			imaciblea.style.filter = 'alpha(opacity=' + opaa + ');';
			imacibleb.style.filter = 'alpha(opacity=' + opab + ');';
		} 
		else{ 
			imaciblea.style.opacity = opaa/100;
			imacibleb.style.opacity = opab/100;
		}
		if(opaa>=100){
			opaa=10;
			opab=100;
			var xcc=imaciblea.src.length-4
			var cxx=imaciblea.src.lastIndexOf("/")+1
			var nomimg=imaciblea.src.substring(cxx,xcc)
			imacibleb.src='images/'+nomimg
			setTimeout("defilmage(1)",vitesse);
			return false;
		}
		setTimeout("defilmage()",25);
	}
	
	if(navigator.appName.substring(0,3)=="Mic"){
		attachEvent("onload",precharge);
	}
	else{
		addEventListener("load", precharge, false);
	}
