function loadimg_contacts() { var perc = Math.round((loaded_contacts/count_el_contacts)*100); document.getElementById("loader_perc_contacts").style.width = perc + "px"; if (loaded_contacts == count_el_contacts) { startup_contacts(); } else { window.setTimeout("loadimg_contacts();", 200); } } loadimg_contacts(); function startup_contacts() { document.getElementById("contacts_0").style.zIndex = 10; opacity("loader_contacts", 100, 0, 500); window.setTimeout("switcher_contacts()", 3000); } function switcher_contacts() { cur_el_contacts++; if (cur_el_contacts >= count_el_contacts) { cur_el_contacts = 0; } var this_el = "contacts_"+cur_el_contacts; changeOpac(0, this_el); document.getElementById(this_el).style.zIndex = zorder_contacts; zorder_contacts++; opacity(this_el, 0, 100, 1200); window.setTimeout("switcher_contacts()", 5000); }