function loadimg_bul() { var perc = Math.round((loaded_bul/count_el_bul)*100); // update progress bar document.getElementById("loader_perc_bul").style.width = perc + "px"; if (loaded_bul == count_el_bul) { // init slideshow startup_bul(); } else { window.setTimeout("loadimg_bul();", 200); } } loadimg_bul(); function startup_bul() { for (var a = 1; a < count_el_bul; a++) { setOpacity(0,'bul_'+a); } // set opacity to 0 for all divs document.getElementById("bul_0").style.zIndex = 10; // move first element to top opacity("loader_bul", 100, 0, 500); // fade out loader window.setTimeout("switcher_bul()", 3800); // begin loop } function switcher_bul() { old_el_bul = cur_el_bul; cur_el_bul++; if (cur_el_bul >= count_el_bul) { cur_el_bul = 0; } var this_el = "bul_"+cur_el_bul; var old_el = "bul_"+old_el_bul; changeOpac(0, this_el); // move new img div to top, and fade in document.getElementById(this_el).style.zIndex = zorder_bul; zorder_bul++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_bul()", 5000); window.setTimeout("setOpacity(0,'" + old_el + "')", 1200); // hide old img div (necessary for stacked rounded corners antialiasing issue) }