function loadimg_ba() { var perc = Math.round((loaded_ba/count_el_ba)*100); // update progress bar document.getElementById("loader_perc_ba").style.width = perc + "px"; if (loaded_ba == count_el_ba) { // init slideshow startup_ba(); } else { window.setTimeout("loadimg_ba();", 200); } } loadimg_ba(); function startup_ba() { for (var a = 1; a < count_el_ba; a++) { setOpacity(0,'ba_'+a); } // set opacity to 0 for all divs document.getElementById("ba_0").style.zIndex = 10; // move first element to top opacity("loader_ba", 100, 0, 500); // fade out loader window.setTimeout("switcher_ba()", 3800); // begin loop } function switcher_ba() { old_el_ba = cur_el_ba; cur_el_ba++; if (cur_el_ba >= count_el_ba) { cur_el_ba = 0; } var this_el = "ba_"+cur_el_ba; var old_el = "ba_"+old_el_ba; changeOpac(0, this_el); // move new img div to top, and fade in document.getElementById(this_el).style.zIndex = zorder_ba; zorder_ba++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_ba()", 5000); window.setTimeout("setOpacity(0,'" + old_el + "')", 1200); // hide old img div (necessary for stacked rounded corners antialiasing issue) }