var opacity = new Array(12); opacity[1] = 0.83; opacity[2] = 0.67; opacity[3] = 0.5; opacity[4] = 0.33; opacity[5] = 0.17; opacity[6] = 0; opacity[7] = 0; opacity[8] = 0; opacity[9] = 0; opacity[10] = 0; opacity[11] = 0; var button_opacity = 1.0; var status_box; var logo; var text; var opac = .0; var box_height = 0; var page_buffer; function start() { status_box = document.getElementById('page_stat'); logo = document.getElementById('logo'); text = document.getElementById('text'); body = document.getElementsByTagName("body")[0]; page_buffer = height = window.innerHeight/4; body.style.setProperty('margin-top', height, null); setTimeout('increaseOpac()', 100); } function increaseOpac() { opac += .01; status_box.innerHTML=opac; logo.style.opacity=opac; if(opac < 1.0) setTimeout('increaseOpac()', 8); else { opac = 0; showText(); } } function showText() { opac += .01; status_box.innerHTML=opac; text.style.opacity=opac; if(opac < 1) setTimeout('showText()', 12); } function pull(init, final, current, step, time, obj_id) { status_box.innerHTML = "pulling"; dir = "pos"; obj = document.getElementById(obj_id); if(final - init < 0) dir = "neg"; if((dir == "pos" && current < final) || (dir == "neg" && current > final)) { if(dir == "pos") current = obj.style.height = current + step; else current = obj.style.height = current - step; setTimeout('pull(' + init + ',' + final + ',' + current + ',' + step + ',' + time + ',\'' + obj_id + '\')', time); status_box.innerHTML = "pulling timeout"; } } function show_more_stati() { box = document.getElementById('box'); body = document.getElementsByTagName('body')[0]; link = document.getElementById('more_link'); var stat = new Array(12); stat[1] = document.getElementById('status_1'); stat[2] = document.getElementById('status_2'); stat[3] = document.getElementById('status_3'); stat[4] = document.getElementById('status_4'); stat[5] = document.getElementById('status_5'); stat[6] = document.getElementById('status_6'); stat[7] = document.getElementById('status_7'); stat[8] = document.getElementById('status_8'); stat[9] = document.getElementById('status_9'); stat[10] = document.getElementById('status_10'); stat[11] = document.getElementById('status_11'); status_box.innerHTML = "expanding box: " + opacity[5]; if(box_height < 260) { box_height = box.style.height = box_height + 10; if(page_buffer >= 36) { page_buffer = page_buffer - 4; body.style.setProperty('margin-top', page_buffer, null); } if(button_opacity > 0) button_opacity = link.style.opacity = button_opacity - 0.05; // Foreach isn't necesarily the best answer here but // without the php, you can't tell. Trust me. :-). if(opacity[1] < 1) opacity[1] = stat[1].style.opacity = opacity[1] + 0.05; if(opacity[2] < 1) opacity[2] = stat[2].style.opacity = opacity[2] + 0.05; if(opacity[3] < 1) opacity[3] = stat[3].style.opacity = opacity[3] + 0.05; if(opacity[4] < 1) opacity[4] = stat[4].style.opacity = opacity[4] + 0.05; if(opacity[5] < 1) opacity[5] = stat[5].style.opacity = opacity[5] + 0.05; if(opacity[6] < 1) opacity[6] = stat[6].style.opacity = opacity[6] + 0.0333; if(opacity[7] < 0.83) opacity[7] = stat[7].style.opacity = opacity[7] + 0.0333; if(opacity[8] < 0.67) opacity[8] = stat[8].style.opacity = opacity[8] + 0.0333; if(opacity[9] < 0.5) opacity[9] = stat[9].style.opacity = opacity[9] + 0.0333; if(opacity[10] < 0.33) opacity[10] = stat[10].style.opacity = opacity[10] + 0.0333; if(opacity[11] < 0.17) opacity[11] = stat[11].style.opacity = opacity[11] + 0.0333; setTimeout("show_more_stati()", .01); } else link.style.display = "none"; }