function loadimg_warehousin() { var perc = Math.round((loaded_warehousin/count_el_warehousin)*100); // update progress bar document.getElementById("loader_perc_warehousin").style.width = perc + "px"; if (loaded_warehousin == count_el_warehousin) { // init slideshow startup_warehousin(); } else { window.setTimeout("loadimg_warehousin();", 200); } } loadimg_warehousin(); function startup_warehousin() { for (var a = 1; a < count_el_warehousin; a++) { setOpacity(0,'warehousin_'+a); } // set opacity to 0 for all divs document.getElementById("warehousin_0").style.zIndex = 10; // move first element to top opacity("loader_warehousin", 100, 0, 500); // fade out loader window.setTimeout("switcher_warehousin()", 3800); // begin loop } function switcher_warehousin() { old_el_warehousin = cur_el_warehousin; cur_el_warehousin++; if (cur_el_warehousin >= count_el_warehousin) { cur_el_warehousin = 0; } var this_el = "warehousin_"+cur_el_warehousin; var old_el = "warehousin_"+old_el_warehousin; changeOpac(0, this_el); // move new img div to top, and fade in document.getElementById(this_el).style.zIndex = zorder_warehousin; zorder_warehousin++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_warehousin()", 5000); window.setTimeout("setOpacity(0,'" + old_el + "')", 1200); // hide old img div (necessary for stacked rounded corners antialiasing issue) }