var effectNews = new Class({
					   
    initialize: function(instance,slider,box_news,durationEffect,sens,taille_box_w,taille_box_h){
        this.instance 		= instance;
		this.slider 		= slider;
		this.box_news 		= box_news;
		this.taille_box_w	= taille_box_w;
		this.taille_box_h	= taille_box_h;
		this.sens 			= sens;
		this.durationEffect	= durationEffect;
				
		this.effectA 		= null;
		this.periodical 	= null;
		
		if(this.sens == 'top')		this.decalage = taille_box_h;
		else if(this.sens == 'left') this.decalage = taille_box_w;
		else 						{this.decalage = taille_box_w;this.sens='left';}
		
		this.decal			= 0;
		this.nbMax			= 0;
		this.maxDecal		= 0;
		
		this.initGallery();
    },
	initGallery: function(){

		this.nbMax = this.box_news.length;
		
		this.maxDecal = -(this.decalage*this.nbMax);
		
		this.effectA = new Fx.Tween(this.slider, {
							duration: (this.durationEffect),
							link: 'cancel',
							property: 'margin-'+this.sens
						});
		
		this.periodical = this.AutoDecal.periodical(this.durationEffect+4000,this);
    },		
	AutoDecal: function(){
		var posatm = this.slider.getStyle('margin-'+this.sens).toInt();
		if(posatm-this.decalage<=this.maxDecal) this.decal=0;
		else this.decal= posatm - this.decalage;
		
		this.effectA.start(this.decal);
	}
});
