tl = 49; lvl = 1; stl = 1; fnm = ''; sx = '.jpg'; blh = 194; rtm = 90; rtr = 3; perlevel = tl/lvl; var n = 40; var o = null; imP = 1; loadingcomplete = false; function g(j) { rotate(); } function i(j) { h(); } function h() { clearTimeout(o); if ( (rtm != 0) && (rtr != 0) ) { setTimeout('a()',Math.abs(rtr * 1000)); } } function a() { clearTimeout(o); yposition = Math.ceil(imn/perlevel); xposition = imn-((yposition-1)*perlevel); if ( rtm > 0 ) xpositionnew = xposition + 1; if ( rtm < 0 ) xpositionnew = xposition - 1; ypositionnew = yposition; if ( xpositionnew < 1 ) xpositionnew = (tl/lvl); if ( xpositionnew > (tl/lvl) ) xpositionnew = 1; imagenumbernew = ((ypositionnew-1)*perlevel)+xpositionnew; imn = imagenumbernew; document.getElementById('ctr').style.background = "url("+ imf[imn].src+ ") no-repeat 250px 20px"; o = setTimeout('a()',Math.abs(rtm)); } function e(m,k) { filled = m; for (i=0;i<(k-m.length);i++) { filled = '0'+filled; } return(filled); } function preloadImages() { imf = new Array(); for ( u=1; u<=tl; u++) { imf[u] = new Image(); imagenumberstring = u.toString(); imagename = fnm+e(imagenumberstring,4); imf[u].src = 'images/'+imagename+sx; setTimeout('b('+u+')' ,30); } } function b(l) { (imf[l].complete)? c() : setTimeout('b('+l+')', 10); } function c() { imP++; document.getElementById('loadingbar').width = blh - (Math.ceil (blh / (tl / imP))); if (imP >= imf.length ) { setTimeout('d();', 500); } } function d() { document.getElementById('loadingbar').width = 0; loadingcomplete = true; imn = (((stl-1)*perlevel)+1); document.getElementById('ctr').style.background = "url("+ imf[imn].src+ ") no-repeat 250px 20px"; document.images['loading'].width = 0; document.images['loading'].height = 0; if ( (rtm != 0) ) { a(); } }