var index; var tabMetier= new Array(); var tabAcccroche= new Array(); var tabImage= new Array(); tabAcccroche[0]='Traitement des eaux des piscines collectives'; tabMetier[0]='Nos métiers'; tabImage[0]='20100216181538.jpg'; tabAcccroche[1]='Produits pour les piscines privées'; tabMetier[1]='Nos métiers'; tabImage[1]='20100216150640.jpg'; tabAcccroche[2]='Traitement des fontaines et bassins'; tabMetier[2]='Nos métiers'; tabImage[2]='20100216171806.jpg'; tabAcccroche[3]='Potabilisation de l\'eau'; tabMetier[3]='Nos métiers'; tabImage[3]='20100218150051.jpg'; tabAcccroche[4]='Traitement à usage industriel'; tabMetier[4]='Nos métiers'; tabImage[4]='20100216152421.jpg'; tabAcccroche[5]='Traitement des eaux des piscines collectives'; tabMetier[5]='Nos métiers'; tabImage[5]='20100216164702.jpg'; tabAcccroche[6]='Traitement des eaux des piscines collectives'; tabMetier[6]='Nos métiers'; tabImage[6]='20100217090211.jpg'; tabAcccroche[7]='Traitement des fontaines et bassins'; tabMetier[7]='Nos métiers'; tabImage[7]='20100216181828.jpg'; tabAcccroche[8]='Produits pour les piscines privées'; tabMetier[8]='Nos métiers'; tabImage[8]='20100216165415.jpg'; tabAcccroche[9]='Traitement à usage industriel'; tabMetier[9]='Nos métiers'; tabImage[9]='20100702170718.jpg'; var nbImg; var intervalDiapo; var fonduEnCours = false; var sensRotation = "croissant"; function Diaporama(nombre, courrante, chemin, nom, extension){ nbImg = nombre; index = courrante; this.chemin = chemin; this.nom = nom; this.extension = extension; /* * Fonction qui permet de passer à l'image suivante lors du click sur le bouton next */ this.suivante = function() { if (index < nbImg-1 && fonduEnCours==false) { fonduEnCours =true; clearInterval(intervalDiapo); index++; jQuery('#diapo'+index).fadeIn(1000,function(){ intervalDiapo=setInterval(diapoAutomatique,5000);fonduEnCours= false; }); window.document.getElementById('diapo_accroche').innerHTML=tabAcccroche[index]; window.document.getElementById('diapo_metier').innerHTML=tabMetier[index]; actualiseAffichageFleches(index); } else if(fonduEnCours==false && index==nbImg-1) { index =0; for(j=1;j 0 && fonduEnCours == false && sensRotation == "croissant") { fonduEnCours = true; clearInterval(intervalDiapo); jQuery('#diapo'+index).fadeOut(1000,function(){ intervalDiapo=setInterval(diapoAutomatique,5000);fonduEnCours = false; }); window.document.getElementById('diapo_accroche').innerHTML=tabAcccroche[index-1]; window.document.getElementById('diapo_metier').innerHTML=tabMetier[index-1]; index--; actualiseAffichageFleches(index); } else if(fonduEnCours==false && index==0) { for(j=nbImg-1;j>0;j--) { fonduEnCours=true; if(j==nbImg-1) { jQuery('#diapo'+j).fadeIn(1000,function(){ if(i==2){intervalDiapo=setInterval(diapoAutomatique,5000); }fonduEnCours=false;afficheAutreImg();}); } fonduEnCours=false; } clearInterval(intervalDiapo); index=nbImg-1; } }; for (var i=0; i < nbImg; i++){ document.write(''); } else{ document.write('"/>'); } } intervalDiapo = setInterval(diapoAutomatique,5000); } function diapoAutomatique() { if (index < nbImg-1 && sensRotation == "croissant" ) { index++; jQuery('#diapo'+index).fadeIn(1000); window.document.getElementById('diapo_accroche').innerHTML=tabAcccroche[index]; window.document.getElementById('diapo_metier').innerHTML=tabMetier[index]; if(index == nbImg-1){ sensRotation = "decroissant"; index =0; } actualiseAffichageFleches(index); } else { index=0; for(j=1;j< nbImg;j++) { //alert("fadeIn du diapo "+j); if(j!=nbImg-1){jQuery('#diapo'+j).fadeOut(10);}else{jQuery('#diapo'+j).fadeOut(1000);} } window.document.getElementById('diapo_accroche').innerHTML=tabAcccroche[index]; window.document.getElementById('diapo_metier').innerHTML=tabMetier[index]; sensRotation = "croissant"; actualiseAffichageFleches(index); } } function actualiseAffichageFleches(num) { /* if (num==0){ window.document.getElementById('btn_prec').style.display='none';}else{ window.document.getElementById('btn_prec').style.display='block'; } if (num==nbImg-1){ window.document.getElementById('btn_suiv').style.display='none';}else{ window.document.getElementById('btn_suiv').style.display='block'; }*/ } function afficheAutreImg() { for(j=nbImg-2;j>0;j--) { jQuery('#diapo'+j).fadeIn(10); } }