/**
 * @author yetik
 */
var Fade_slide = new Class({
	
	initialize: function () {
		
		//element przesuwany
		this.cont = $('slide_cont').getElements('img');		
		var count = this.count = this.cont.length;
		this.iter = this.count -1;

		
		this.next.periodical(6000, this);

	},

	next: function () {

		
		this.cont[this.iter].set('tween', { duration: 1500}).tween('opacity', 0 )
		if (this.iter == 0) {
			this.iter = this.count;			
		}
		this.iter--;
		this.cont[this.iter].set('tween', { duration: 1500}).tween('opacity', 1);		
		

		

	}
})


window.addEvent ('domready', function () {
	 
	try {
		new Fade_slide;
	} catch (e) {}
})

