function loadimg_conve() { var perc = Math.round((loaded_conve/count_el_conve)*100); // update progress bar document.getElementById("loader_perc_conve").style.width = perc + "px"; if (loaded_conve == count_el_conve) { // init slideshow startup_conve(); } else { window.setTimeout("loadimg_conve();", 200); } } loadimg_conve(); function startup_conve() { for (var a = 1; a < count_el_conve; a++) { setOpacity(0,'conve_'+a); } // set opacity to 0 for all divs document.getElementById("conve_0").style.zIndex = 10; // move first element to top opacity("loader_conve", 100, 0, 500); // fade out loader window.setTimeout("switcher_conve()", 3800); // begin loop } function switcher_conve() { old_el_conve = cur_el_conve; cur_el_conve++; if (cur_el_conve >= count_el_conve) { cur_el_conve = 0; } var this_el = "conve_"+cur_el_conve; var old_el = "conve_"+old_el_conve; changeOpac(0, this_el); // move new img div to top, and fade in document.getElementById(this_el).style.zIndex = zorder_conve; zorder_conve++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_conve()", 5000); window.setTimeout("setOpacity(0,'" + old_el + "')", 1200); // hide old img div (necessary for stacked rounded corners antialiasing issue) }