function loadimg_jb() { var perc = Math.round((loaded_jb/count_el_jb)*100); document.getElementById("loader_perc_jb").style.width = perc + "px"; if (loaded_jb == count_el_jb) { startup_jb(); } else { window.setTimeout("loadimg_jb();", 200); } } loadimg_jb(); function startup_jb() { document.getElementById("jb_0").style.zIndex = 10; opacity("loader_jb", 100, 0, 500); window.setTimeout("switcher_jb()", 6000); } function switcher_jb() { cur_el_jb++; if (cur_el_jb >= count_el_jb) { cur_el_jb = 0; } var this_el = "jb_"+cur_el_jb; changeOpac(0, this_el); document.getElementById(this_el).style.zIndex = zorder_jb; zorder_jb++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_jb()", 5000); }