function writediv(div,texte)
     {
     document.getElementById(div).innerHTML = texte;
     }


function file(fichier)
     {
     if(window.XMLHttpRequest) // FIREFOX
          xhr_object = new XMLHttpRequest();
     else if(window.ActiveXObject) // IE
          xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
     else
          return(false);
     xhr_object.open("GET", fichier, false);
     xhr_object.send(null);
     if(xhr_object.readyState == 4) return(xhr_object.responseText);
     else return(false);
     }
	 

 //tableau des image mettre le nom de toutes les images
preImages=new Array
var opaa =new Array
var opab =new Array
compteur=0

vitesse=4000;
opaa=0;
opab=100;

function precharge() { 
  for (i = 0; i < tbimage.length; i++) { 
    preImages[i] = new Image()
    preImages[i].src = 'upload/CATEGORIE/'+tbrep[i]+'/'+tbimage[i]
}
min1=setTimeout("defilmage('1','divimage1','divimage2')",vitesse);
}

function defilmage(reg,im1,im2){

oxo=reg;
if(compteur==tbimage.length-1){
compteur=-1

}
if(oxo==1){
compteur++

opaa=10;
document.getElementById(im2).src='upload/CATEGORIE/'+tbrep[compteur]+'/'+tbimage[compteur]	

oxo=0;
}

var imacibleb=document.getElementById(im1);
var imaciblea=document.getElementById(im2);

opaa+=4;
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='upload/CATEGORIE/'+tbrep[compteur]+'/'+nomimg
min1 = setTimeout("defilmage(1,'"+im1+"','"+im2+"')",vitesse);
return false
}
min1 = setTimeout("defilmage('','"+im1+"','"+im2+"')",25);

}

