function loadimg_rates() { var perc = Math.round((loaded_rates/count_el_rates)*100); document.getElementById("loader_perc_rates").style.width = perc + "px"; if (loaded_rates == count_el_rates) { startup_rates(); } else { window.setTimeout("loadimg_rates();", 200); } } loadimg_rates(); function startup_rates() { document.getElementById("rates_0").style.zIndex = 10; opacity("loader_rates", 100, 0, 500); window.setTimeout("switcher_rates()", 3000); } function switcher_rates() { cur_el_rates++; if (cur_el_rates >= count_el_rates) { cur_el_rates = 0; } var this_el = "rates_"+cur_el_rates; changeOpac(0, this_el); document.getElementById(this_el).style.zIndex = zorder_rates; zorder_rates++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_rates()", 5000); }