El problema viene cuando llamo a la función f1(x).
Código
var sel=0; function f1(n){ sel=n; document.images['slider_main'].src=slider[n].img; document.getElementById("slider_title").innerHTML=slider[n].title; document.getElementById("slider_description").innerHTML=slider[n].description; for(var i=0;i<5;i++){ if(i!=n){ document.getElementById("css_slider_flag"+i).className = "slider-mini-flag"; document.getElementById("text_slider_flag"+i).innerHTML=slider[i].title; } else { document.getElementById("css_slider_flag"+i).className = ""; document.getElementById("text_slider_flag"+i).innerHTML=""; } } } function mysetTimeout(){ alert(sel); f1(3); if(sel<4)sel=sel+1; else sel=0; setTimeout("mysetTimeout()",1000); } mysetTimeout();