/**
 * @author ceo-zan
 */

var RotatingTreatment = Class.create ();
RotatingTreatment.prototype = {
	initialize: function( slidesarr ){		
		this.slides = slidesarr;
		this.idx = 0; 
		this.wait = 4000;
	},
	
	slideShow: function (){		
		
		if ( $(this.slides[this.idx]) != null )
			Effect.Fade(this.slides[this.idx], { duration:2, from:1.0, to:0.0 });
			 
		this.idx++;
	 	if (this.idx == this.slides.length) 
			this.idx = 0;
		 
		if ( $(this.slides[this.idx]) != null )
			Effect.Appear(this.slides[this.idx], { duration:2, from:0.0, to:1.0 });
	 }	
}

rotatingTreatment = new RotatingTreatment (new Array(
						'lady_r_02', 
						'lady_r_03',
						'lady_r_06',
						'lady_r_07',
						'lady_r_08',
						'lady_r_09',
						'lady_r_12'
						
						));

Event.observe (window, 'load', function(event){
		setInterval('rotatingTreatment.slideShow()',rotatingTreatment.wait);
	}
);

/*'lady_r_05',
						'lady_r_06',
						'lady_r_07',
						'lady_r_08',
						'lady_r_09',
						'lady_r_12'						*/
