function loadimg_lodge() { var perc = Math.round((loaded_lodge/count_el_lodge)*100); document.getElementById("loader_perc_lodge").style.width = perc + "px"; if (loaded_lodge == count_el_lodge) { startup_lodge(); } else { window.setTimeout("loadimg_lodge();", 200); } } loadimg_lodge(); function startup_lodge() { document.getElementById("lodge_0").style.zIndex = 10; opacity("loader_lodge", 100, 0, 500); window.setTimeout("switcher_lodge()", 3000); } function switcher_lodge() { cur_el_lodge++; if (cur_el_lodge >= count_el_lodge) { cur_el_lodge = 0; } var this_el = "lodge_"+cur_el_lodge; changeOpac(0, this_el); document.getElementById(this_el).style.zIndex = zorder_lodge; zorder_lodge++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_lodge()", 5000); }