/* 
** Script edited by JM armi-system.com 2010
*/

tbimage=new Array('Architecture_I','Modelisation3D_I','Production_AV_I','ConceptionSonore_I','Architecture_III','Site_Web_II','Site_Web') //tableau des image mettre le nom de toutes les images
preImages=new Array
var opaa=100;
var opab=100;
var compteur=2;
var vitesse=5000;

function precharge() { 
  for (i = 0; i < tbimage.length; i++) { 
    preImages[i] = new Image()
    preImages[i].src = 'IMG/jpg/'+tbimage[i]+'.jpg'
}
setTimeout(defilmage,vitesse);
}

function defilmage(reg){
	oxo=reg;
	if(compteur==tbimage.length-1){
		compteur=-1
	}
	if(oxo==1){
		compteur++
		opaa=10;
		document.getElementById('diapo2').src="IMG/jpg/"+tbimage[compteur]+".jpg";
		oxo=100;
	}
	var imacibleb=document.getElementById('diapo0');
	var imaciblea=document.getElementById('diapo2');
	
	opaa+=parseFloat(1);
	opab-=parseFloat(0.5);
	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;
		//i+=parseFloat(0.1);
		//imacibleb.filters.alpha.opacity -= parseFloat(3);
	}
	if(opaa>=100){
		opaa=0;
		opab=100;
		var xcc=imaciblea.src.length-4
		var cxx=imaciblea.src.lastIndexOf("/")+1
		var nomimg=imaciblea.src.substring(cxx,xcc)
		//imaciblea.filters.alpha.opacity -= parseFloat(3);
		imacibleb.src='IMG/jpg/'+nomimg+'.jpg'
		setTimeout("defilmage(1)",vitesse);
		return false
	}
	setTimeout("defilmage()",1);
}
if(navigator.appName.substring(0,3)=="Mic"){
attachEvent("onload",precharge);
}
else{
addEventListener("load", precharge, false);
}