var FiFader = new Class({
        Implements: Options,
        options: {
                delay: 7500
        },
        initialize: function(options) {
                this.setOptions(options);
				this.images = new Array();
				this.images[0] = new Asset.image("./images/fi4-small.jpg");
				this.images[1] = new Asset.image("./images/fi2-small.jpg");
				this.images[2] = new Asset.image("./images/fi3-small.jpg");
				this.images[3] = new Asset.image("./images/fi1-small.jpg");
				this.images[4] = new Asset.image("./images/fi5-small.jpg");
				this.images[5] = new Asset.image("./images/fi6-small.jpg");
				this.images[6] = new Asset.image("./images/fi7-small.jpg");
				this.image = $('fi');
				this.next = 0;
        },
        rotate: function() {
            this.periodical = this.show.bind(this).periodical(this.options.delay);
			this.image = $('fi');
        },
		alterImage: function(image, newSrc) {
				image.set('src', newSrc);
		},
        show: function() {
                this.next = (this.next==this.images.length-1)?0:this.next+1;
				var imgTween = new Fx.Tween(this.image, {
					property: 'opacity',
					duration: 500, 
					link: 'chain'
				}); 
				imgTween.addEvent('onComplete', this.alterImage.bindWithEvent(this.image, this.images[this.next].get('src')));
				imgTween.start(1, 0);
				imgTween.start(0, 1);
        }

}); 
