function loadimg_africat() { var perc = Math.round((loaded_africat/count_el_africat)*100); document.getElementById("loader_perc_africat").style.width = perc + "px"; if (loaded_africat == count_el_africat) { startup_africat(); } else { window.setTimeout("loadimg_africat();", 200); } } loadimg_africat(); function startup_africat() { document.getElementById("africat_0").style.zIndex = 10; opacity("loader_africat", 100, 0, 500); window.setTimeout("switcher_africat()", 3000); } function switcher_africat() { cur_el_africat++; if (cur_el_africat >= count_el_africat) { cur_el_africat = 0; } var this_el = "africat_"+cur_el_africat; changeOpac(0, this_el); document.getElementById(this_el).style.zIndex = zorder_africat; zorder_africat++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_africat()", 5000); }