function loadimg_packin() { var perc = Math.round((loaded_packin/count_el_packin)*100); // update progress bar document.getElementById("loader_perc_packin").style.width = perc + "px"; if (loaded_packin == count_el_packin) { // init slideshow startup_packin(); } else { window.setTimeout("loadimg_packin();", 200); } } loadimg_packin(); function startup_packin() { for (var a = 1; a < count_el_packin; a++) { setOpacity(0,'packin_'+a); } // set opacity to 0 for all divs document.getElementById("packin_0").style.zIndex = 10; // move first element to top opacity("loader_packin", 100, 0, 500); // fade out loader window.setTimeout("switcher_packin()", 3800); // begin loop } function switcher_packin() { old_el_packin = cur_el_packin; cur_el_packin++; if (cur_el_packin >= count_el_packin) { cur_el_packin = 0; } var this_el = "packin_"+cur_el_packin; var old_el = "packin_"+old_el_packin; changeOpac(0, this_el); // move new img div to top, and fade in document.getElementById(this_el).style.zIndex = zorder_packin; zorder_packin++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_packin()", 5000); window.setTimeout("setOpacity(0,'" + old_el + "')", 1200); // hide old img div (necessary for stacked rounded corners antialiasing issue) }