Carrousel = function (list,numvisable,start) {
	this.itemlist = document.getElementById(list);
	if (!this.itemlist) return;
	this.numvisable = numvisable;
	this.items = new Array();
	var elems = this.itemlist.getElementsByTagName("LI");	
	this.numitems = elems.length;
	if (!start || start >= this.numitems) {
		this.start = 0;
	} else {
		this.start = start;
	}	
	for (var i=0;i<this.numitems;i++) {
		var el = elems[0];
		this.items[this.items.length] = el.parentNode.removeChild(el);
	}
	this.populate();
}
Carrousel.prototype.populate = function() {
	this.itemlist.innerHTML = "";
	var numadded = 0;
	var pointer = this.start;
	while (numadded < this.numvisable) {
		var clone = this.items[pointer].cloneNode(true);
		this.itemlist.appendChild(clone);
		pointer++;
		if (pointer >= this.numitems) pointer=0;
		numadded++;
	}
	new Clickables(this.itemlist.id, "clickable")
}
Carrousel.prototype.turnBack = function() {
	this.start--;
	if (this.start < 0) this.start = this.numitems-1;
	this.populate();
}
Carrousel.prototype.turnForward = function() {
	this.start++;
	if (this.start >= this.numitems) this.start = 0
	this.populate();
}