var homeSwap = {
	current: 0,
	fx: null,
	loopsDone: 0,
	loopsToDo: 10,
	lastEl: null,
	init: function() {
		setTimeout(homeSwap.tick,8000);
	},
	tick: function() {
//		if (!dropdowns.active) {
			if (homeSwap.current >= 4) {
				homeSwap.current = 1;
			} else {
				homeSwap.current++;
				homeSwap.loopsDone++;
			}
			homeSwap.fx = new Fx.Styles('layer'+homeSwap.current, {duration:2000, wait: true, transition: Fx.Transitions.linear, onComplete: function() {
				if (this.element.getStyle('z-index') < 1) {
					this.element.setStyle('z-index',100-homeSwap.current);
				}
				this.element.setStyle('z-index',this.element.getStyle('z-index')-4);
				if (homeSwap.lastEl) homeSwap.lastEl.setStyle('opacity',1);
				homeSwap.lastEl = this.element;
			}});
			homeSwap.fx.start({'opacity':0})
//		}
		if (homeSwap.loopsDone < homeSwap.loopsToDo) setTimeout(homeSwap.tick,8000);
	}
}
window.addEvent('domready',homeSwap.init);

/*
window.addEvent('domready', function() {
	slideshow.init($('intro'),
	4,
	'images/home-intro-'
)});
*/