function loadimg_pipin() { var perc = Math.round((loaded_pipin/count_el_pipin)*100); // update progress bar document.getElementById("loader_perc_pipin").style.width = perc + "px"; if (loaded_pipin == count_el_pipin) { // init slideshow startup_pipin(); } else { window.setTimeout("loadimg_pipin();", 200); } } loadimg_pipin(); function startup_pipin() { for (var a = 1; a < count_el_pipin; a++) { setOpacity(0,'pipin_'+a); } // set opacity to 0 for all divs document.getElementById("pipin_0").style.zIndex = 10; // move first element to top opacity("loader_pipin", 100, 0, 500); // fade out loader window.setTimeout("switcher_pipin()", 3800); // begin loop } function switcher_pipin() { old_el_pipin = cur_el_pipin; cur_el_pipin++; if (cur_el_pipin >= count_el_pipin) { cur_el_pipin = 0; } var this_el = "pipin_"+cur_el_pipin; var old_el = "pipin_"+old_el_pipin; changeOpac(0, this_el); // move new img div to top, and fade in document.getElementById(this_el).style.zIndex = zorder_pipin; zorder_pipin++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_pipin()", 5000); window.setTimeout("setOpacity(0,'" + old_el + "')", 1200); // hide old img div (necessary for stacked rounded corners antialiasing issue) }