preload = { loaded: 0, count: 0, images: new Array, image: '', onComplete: function() { }, getimages: function() { var temp = document.getElementsByTagName('img'); for ( var n = 0; n < temp.length; n++ ) { preload.images[preload.images.length] = temp[n].src; } }, checkQ: function() { if ( preload.count > preload.loaded ) { window.setTimeout('preload.checkQ()',200); } else { preload.onComplete(); } }, processQ: function() { preload.count = preload.images.length; for ( var n = 0; n < preload.count; n++ ) { preload.load(preload.images[n]); } this.checkQ(); }, load: function(url) { var image = new Image(); image.onload = function() { preload.loaded++; }; image.src = url; } } var i = 0; window.addEvent('domready',function() { preload.images[preload.images.length] = 'images/home/rot/1.jpg'; preload.images[preload.images.length] = 'images/home/rot/7.jpg'; preload.images[preload.images.length] = 'images/home/rot/3.jpg'; preload.images[preload.images.length] = 'images/home/rot/5.jpg'; preload.images[preload.images.length] = 'images/home/rot/10.jpg'; preload.images[preload.images.length] = 'images/home/rot/11.jpg'; preload.images[preload.images.length] = 'images/home/rot/12.jpg'; preload.images[preload.images.length] = 'images/home/rot/2.jpg'; preload.images[preload.images.length] = 'images/home/rot/8.jpg'; preload.images[preload.images.length] = 'images/home/rot/update1.jpg'; preload.images[preload.images.length] = 'images/home/rot/update2.jpg'; var front = $('front'); var rear = $('rear'); var fader = new Fx.Tween(front,{link: 'chain',duration: 2000}); function imgrot() { i++; if ( i == preload.images.length ) i = 0; rear.setStyle('background-image','url("'+preload.images[i]+'")'); fader.start('opacity',0).chain(function(){ front.setStyle('background-image','url("'+preload.images[i]+'")'); fader.callChain(); }).start('opacity',1).chain(function(){ setTimeout(imgrot,3000); }); } preload.onComplete = function() { setTimeout(imgrot,2000); }; preload.processQ(); }); var fbi = 1; window.addEvent('domready',function(){ var box = $('fbhandle'); var fbm = new Fx.Tween(box,{link: 'chain'}); var numboxes = box.getElements('.line').length; function flashbox() { if ( fbi > numboxes-1 ) fbi = 0; fbm.start('opacity',.15).start('top',fbi*-177).start('opacity',1); fbi++; if ( fbi <= numboxes-1 ) setTimeout(flashbox,8000); } setTimeout(flashbox,5000); });