
var tableColorLignes = new Class({
							  
	Implements: [Options, Events],
	
	options: {
		nbrColors: 2,
		classes: ['ligne_a','ligne_b'],
		classPremier: 'first',
		classDernier: 'last'
	},

	initialize: function(classTable, options){
		this.setOptions(options);
		this.tables		= $$('.'+classTable);
		this.tables.each(function(table,i){
			this.updateTable(table);
		}.bind(this));
	},
	
	updateTable: function(table){
		tBody 	= table.getElement('tbody');
		trs 	= tBody.getElements('tr');
		//------------------
		var counter 	= 0
		trs.each(function(tr,i){
			var tds		= tr.getElements('td');
			if(tds.length > 0){
				tds.each(function(td,j){
					td.addClass(this.options.classes[counter]);
					if(j==0) 				td.addClass(this.options.classPremier);
					if(j==(tds.length-1))	td.addClass(this.options.classDernier);
				}.bind(this));
				counter++;
				if(counter == this.options.nbrColors) counter = 0;
			}
		}.bind(this));
	}
	
});
