var jbSlide = new Class( {
	imgs : new Array(),
	current : 0,
	delayTime : 6000,
	fxdur : 2000,
	initialize : function(container) {
		if($type(container)!='element') container = $(container);
		this.imgs = container.getElements('img');
		if(this.imgs.length > 1){
			this.imgs.each(function(e) {
				e.setStyle('opacity', '0');
			});
			this.imgs[0].setStyle('opacity', '.99');
			(function() {
				this.fading();
			}.bind(this)).delay(this.delayTime);
		}
	},
	fading : function() {
		nIndex = this.imgs[this.current + 1] ? this.current + 1 : 0;
		new Fx.Tween(this.imgs[nIndex], {
			'duration' : this.fxdur
		}).start('opacity', '0', '.99');
		new Fx.Tween(this.imgs[this.current], {
			'duration' : this.fxdur
		}).start('opacity', '.99', '0');
		/*
		 * this.imgs[nIndex].fade('in'); this.imgs[this.current].fade('out');
		 */
		this.current = nIndex;
		(function() {
			this.fading();
		}.bind(this)).delay(this.delayTime + this.fxdur);
	}
});
