// il faut faire en sorte que tabWidth contient toutes les largeurs des li
function Diaporama_Counter (tabWidth) {
	this.index = 0;
	this.tabWidth = tabWidth;
	this.width = 0;
}

Diaporama_Counter.prototype = {
	// retourne la somme de toute les largeurs du début du tableau jusqu'à l'index
	getWidth: function () {
		return this.width;
	},
	// retourne un booléen pour détérminer si on peut retirer un item
	canRemove : function () {
		return this.index > 0;
	},
	// permet de savoir si on peut ajouter un item
	canAdd : function () {
		return (this.index < this.tabWidth.length - 1);
	},
	// ajoute un item
	add : function (){
		this.width = this.width + this.tabWidth[this.index];
		this.index++;
	},
	// retire un item
	remove : function () {
		this.width = this.width - this.tabWidth[this.index];
		this.index--;
	}
	
}
