function LiveshoppingManager(type,name) { 
	this._arrayShow = new Array();
	
	this._dataAllowEffect = '';
	this._dataTimeEffect = '';
	this._dataNbPerPage = '';
	this._dataSpeedEffect = '';
	this._dataNbPage = '';
	this._dataIds = '';
	this._type = type;
	this._name = name;
	
	this._npage = 0;
} 

LiveshoppingManager.prototype = { 
		
	
	init: function()
	{
		this._dataAllowEffect = $('dataAllowEffect'+this._type).readAttribute('value');
		this._dataTimeEffect = $('dataTimeEffect'+this._type).readAttribute('value');
		this._dataNbPerPage = $('dataNbPerPage'+this._type).readAttribute('value');
		this._dataSpeedEffect = $('dataSpeedEffect'+this._type).readAttribute('value');
		this._dataIds = $('dataIds'+this._type).readAttribute('value');
		tableau = this._dataIds.split(';');
		this._dataNbPage = tableau.length-1;
		
		var i = 0;
		while(tableau[i])
		{
			this._arrayShow[i] = tableau[i];
			i++;
		}
		
		this.updateShow();
	},

	updateShow: function() 
	{ 
		this.fadeout();

			if(this._npage < this._dataNbPage-1)
				this._npage++;
			else
				this._npage = 0;
			
			i++;
		window.setTimeout(this._name+'.updateShow();',this._dataTimeEffect);
	},
	
	fadeout: function()
	{
		var o = this;

		new Effect.Opacity('content_all_div_'+this._type, { 
			afterFinish: function() {


			var i = 0;
			while(i < o._dataNbPage)
			{		
				if(i >= o._npage && 
				i <= o._npage+(o._dataNbPerPage-1))
				{
					$('block_liveshopping_menu_'+o._type+'_'+o._arrayShow[i]).show();
				}
				else
				{
					$('block_liveshopping_menu_'+o._type+'_'+o._arrayShow[i]).hide();
				}
				
				i++;
			}
			
			
			
		
		new Effect.Opacity('content_all_div_'+o._type, {
			duration:o._dataSpeedEffect, 
			from:0.0, 
			to:1.0
		});	
			
		},
			duration:this._dataSpeedEffect,
			from:1.0, to:0.0
		});
	},
	
	function1: function(e)
	{
		console.log('+++content_all_div_'+e._type);
//		try{
//		var i = 0;
//		while(i < this._dataNbPage)
//		{		
//			if(i >= this._npage && 
//			i <= this._npage+(this._dataNbPerPage-1))
//			{
//				$('block_liveshopping_menu_'+this._type+'_'+this._arrayShow[i]).show();
//			}
//			else
//			{
//				$('block_liveshopping_menu_'+this._type+'_'+this._arrayShow[i]).hide();
//			}
//			
//			i++;
//		}
//	}catch(e){}
//	new Effect.Opacity('content_all_div_'+this._type, {
//		duration:this._dataSpeedEffect, 
//		from:0.0, 
//		to:1.0
//	});	
		
		
	}
} 

 

