function loadimg_handlin() { var perc = Math.round((loaded_handlin/count_el_handlin)*100); // update progress bar document.getElementById("loader_perc_handlin").style.width = perc + "px"; if (loaded_handlin == count_el_handlin) { // init slideshow startup_handlin(); } else { window.setTimeout("loadimg_handlin();", 200); } } loadimg_handlin(); function startup_handlin() { for (var a = 1; a < count_el_handlin; a++) { setOpacity(0,'handlin_'+a); } // set opacity to 0 for all divs document.getElementById("handlin_0").style.zIndex = 10; // move first element to top opacity("loader_handlin", 100, 0, 500); // fade out loader window.setTimeout("switcher_handlin()", 3800); // begin loop } function switcher_handlin() { old_el_handlin = cur_el_handlin; cur_el_handlin++; if (cur_el_handlin >= count_el_handlin) { cur_el_handlin = 0; } var this_el = "handlin_"+cur_el_handlin; var old_el = "handlin_"+old_el_handlin; changeOpac(0, this_el); // move new img div to top, and fade in document.getElementById(this_el).style.zIndex = zorder_handlin; zorder_handlin++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_handlin()", 5000); window.setTimeout("setOpacity(0,'" + old_el + "')", 1200); // hide old img div (necessary for stacked rounded corners antialiasing issue) }