var nbOnglets=4;var temps=8000;var transitiondelay=100;var t2=transitiondelay+10;$(document).ready(function(){changeImage(1);setTimeout("auto(2)",temps);});var sel=0;var isChanging=false;var timer;function changeImage(img)
{if(isChanging)
return;if(img!=sel)
{$("#contenttext").animate({opacity:1},1);$("#contenttext").hide("drop",{direction:"left"},transitiondelay);$("#content").hide("drop",{direction:"left"},transitiondelay);sel=img;isChanging=true;setTimeout("showImage("+img+")",t2);}}
function showImage(img)
{ongletSelect(img);document.getElementById("content").innerHTML=document.getElementById("content"+img).innerHTML;$("#content").show("drop",{direction:"left"},transitiondelay);setTimeout("IEFix("+img+")",t2);}
function IEFix(img)
{$("#contenttext").animate({opacity:0.85},transitiondelay);setTimeout("showText("+img+")",t2);}
function showText(img)
{document.getElementById("contenttext").innerHTML=document.getElementById("contenttext"+img).innerHTML;$("#contenttext").show("drop",{direction:"left"},transitiondelay);setTimeout("Finish()",t2);}
function Finish()
{isChanging=false;}
function auto(nb)
{changeImage(nb);nb=nb+1;if(nb>nbOnglets)
nb=1;clearTimeout(timer);timer=setTimeout("auto("+nb+")",temps);}
function ongletSelect(nb)
{a=1;for(var i=1;i<=nbOnglets;i++)
{document.getElementById("onglet"+i).style.background="url(graphique/Site-Notulus-SliderArticle-Bouton230610.jpg)";document.getElementById("onglet"+i).style.backgroundPosition="top";document.getElementById("onglet"+i).onmouseover=function(){this.style.backgroundPosition="center";};document.getElementById("onglet"+i).onmouseout=function(){this.style.backgroundPosition="top";};a++;if(a==3){a=1;}}
document.getElementById("onglet"+nb).style.backgroundPosition="bottom";document.getElementById("onglet"+nb).onmouseover=function(){this.style.backgroundPosition="center"};document.getElementById("onglet"+nb).onmouseout=function(){this.style.backgroundPosition="bottom";};}
function clickOnglet(nb)
{if(isChanging)
return;var nbnext=nb+1;if(nbnext>nbOnglets)
nbnext=1;clearTimeout(timer);timer=setTimeout("auto("+nbnext+")",temps);changeImage(nb);}
