var number = 0;
window.addEvent('domready', function(){
	$('showcase').getElements('.bigimage').each(function(i,x) {
		i.setStyles({'opacity':'0'});
	});
});
window.addEvent('load', function(){
	animation();
});
function animation() {
var loc = $('showcase');
	if (number > loc.getElements('.bigimage').length-1) {number = 0;}
	var fx = loc.effects({duration: 1000, transition: Fx.Transitions.Quart.easeOut});
	fx.start().chain(
		function(){this.start(showshowcase(number));},
		function(){this.start(number = number + 1);},
		function(){this.start(animation());}
	);
}
function showshowcase(number) {
	var big = 'showcase-' + number + '-big';
	$('showcase').getElements('.bigimage').each(function(i) {
		var fx = $(i).effects({duration: 2000, transition: Fx.Transitions.Quart.easeOut});
		if (i.get('id') !== big) {
			fx.start({'opacity':'0'});
		}
		else {
			fx.start({'opacity':'1'});
		}
	});
}
//code modified from Jon Plante's blog
//Thanks Jon
//http://jonplante.com/blog/showcase-slideshow-with-mootools/