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

vitesse=500;
opaa=0;
opab=100;
var NbTour=0;

function precharge() { 
  for (i = 0; i < tbimage.length; i++) { 
    preImages[i] = new Image()
    preImages[i].src = '../images/equipe/'+tbimage[i]+'.jpg'
}
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="../images/equipe/"+tbimage[compteur]+".jpg";	
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='../images/equipe/'+nomimg+'.jpg'

	if(nomimg=='fondu') {
	min1 = setTimeout("defilmage(1,'"+im1+"','"+im2+"')",50);
	} else {
	min1 = setTimeout("defilmage(1,'"+im1+"','"+im2+"')",vitesse);
	}
	return false
	}
	
	min1 = setTimeout("defilmage('','"+im1+"','"+im2+"')",5);

	if((tbimage[compteur]=='serieu')  && (NbTour!=0) && (opaa>=98)) {
		
		window.clearTimeout(min1);
		if(document.all && !window.opera){ 
			imaciblea.style.filter = 'alpha(opacity=100);' ;
			imacibleb.style.filter = 'alpha(opacity=0);';
		} 
		else{ 
			imaciblea.style.opacity = 100;
			imacibleb.style.opacity = 0;
		}
		
	}
	NbTour=1;
}
function LunchAnim() {

	//window.clearTimeout(min1);

	NbTour=0;
	min1=setTimeout("defilmage('1','divimage1','divimage2')",5);
}
function AfficheDiv(div) {
		CacheDiv('antho');
 CacheDiv('antoine');
CacheDiv('david'); 
CacheDiv('choulio');
 CacheDiv('florent');
CacheDiv('mika');
CacheDiv('valerie');
	
	document.getElementById(div).style.display='';
}
function CacheDiv(div) {


	document.getElementById(div).style.display='none';
}


preImages2=new Array
var opaa2 =new Array
var opab2 =new Array
compteur2=0

vitesse2=200;
opaa2=0;
opab2=100;


function precharge_tv() { 
  for (i = 0; i < tbimage2.length; i++) { 
    preImages2[i] = new Image()
    preImages2[i].src = '../images/tv/'+tbimage2[i]+'.png'
}
min2=setTimeout("defilmage_tv('1','divimage3','divimage4')",vitesse2);
}

function defilmage_tv(reg,im1,im2){

oxo=reg;
if(compteur2==tbimage2.length-1){
compteur2=-1

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

opaa2=10;
document.getElementById(im2).src="../images/tv/"+tbimage2[compteur2]+".png";	
oxo=0;
}



setTimeout("defilmage_tv('1','divimage3','divimage4')",vitesse2);

}



