function Caroussel(elementId)
{
	this.element = document.getElementById(elementId);

	this.caroussel;
	this.clip;
	this.list;
	this.list2;
	this.leftButton;
	this.rightButton;

	this.position = 0;
	this.position2 = 0;
	this.listWidth = 0;
	this.itemWidth = 0;

	this.timer = null;

	this.addItem = function(url, title, picture)
	{
		var item = document.createElement('a');
		item.href= url;
		item.title = title;

		var img = document.createElement('img');
		img.src = picture;

		item.appendChild(img);
		item.appendChild(document.createTextNode(title));

		this.list2.appendChild(item);
	}

	this.init = function()
	{
		var parent = this.element.parentNode;

		this.caroussel = document.createElement('div');
		this.caroussel.className = 'caroussel';

		this.leftButton = document.createElement('a');
		this.leftButton.href = '#';
		this.leftButton.className = 'caroussel_left';

		this.rightButton = document.createElement('a');
		this.rightButton.href = '#';
		this.rightButton.className = 'caroussel_right';

		this.clip = document.createElement('div');
		this.clip.className = 'caroussel_clip';

		this.list = this.element;
		this.list.className = 'caroussel_list';

		this.list2 = document.createElement('ul');
		this.list2.className = 'caroussel_list';

		this.clip.appendChild(this.list);
		this.clip.appendChild(this.list2);

		this.caroussel.appendChild(this.leftButton);
		this.caroussel.appendChild(this.clip);
		this.caroussel.appendChild(this.rightButton);

		var elements = this.list.getElementsByTagName('LI');
		var nbElt = elements.length;

		for (var i = 0; i < nbElt; i++)
		{
			var element = elements[i].firstChild;

			this.addItem(element.href, element.childNodes[1].nodeValue, element.childNodes[0].src);
		}

		parent.appendChild(this.caroussel);

		this.itemWidth = this.clip.clientWidth / 4;

		this.listWidth = this.itemWidth * nbElt;
		this.list.style.width = this.listWidth + 'px';

		this.list2.style.width = this.listWidth + 'px';
		this.list2.style.left = this.listWidth + 'px';
		this.position2 = this.listWidth;
		this.list2.style.top = '-' + this.clip.clientHeight + 'px';
	}

	this.init();

	var self = this;

	this.leftButton.onclick = function()
	{
		if (self.timer)
			clearTimeout(self.timer);

		if (self.position + self.clip.clientWidth >= self.listWidth)
			self.position = self.position2 - self.listWidth;

		if (self.position2 + self.clip.clientWidth >= self.listWidth)
			self.position2 = self.position - self.listWidth;

		var animation = new Animation(self.list); 
		animation.moveLeft(self.position, self.position + self.clip.clientWidth, 15, 30, 0.5);

		var animation = new Animation(self.list2); 
		animation.moveLeft(self.position2, self.position2 + self.clip.clientWidth, 15, 30, 0.5);

		self.position = self.position + self.clip.clientWidth;
		self.position2 = self.position2 + self.clip.clientWidth;

		self.startScroll();

		return false;
	}

	this.rightButton.onclick = function()
	{
		if (self.timer)
			clearTimeout(self.timer);

		var animation = new Animation(self.list); 
		animation.moveLeft(self.position, self.position - self.clip.clientWidth, 15, 30, 0.5);

		var animation = new Animation(self.list2); 
		animation.moveLeft(self.position2, self.position2 - self.clip.clientWidth, 15, 30, 0.5);

		self.position = self.position - self.clip.clientWidth;
		self.position2 = self.position2 - self.clip.clientWidth;

		if (self.position <= 0 - self.listWidth)
			self.position = self.position2 + self.listWidth;

		if (self.position2 <= 0 - self.listWidth)
			self.position2 = self.position + self.listWidth;

		self.startScroll();

		return false;
	}

	this.clip.onmouseover = function()
	{
		if (self.timer)
			clearTimeout(self.timer);
	}

	this.clip.onmouseout = function()
	{
		self.timer = setTimeout(self.scroll, 2000);
	}

	this.scroll = function()
	{
		var animation = new Animation(self.list); 
		animation.moveLeft(self.position, self.position - self.itemWidth, 4, 20, 1);

		var animation = new Animation(self.list2); 
		animation.moveLeft(self.position2, self.position2 - self.itemWidth, 4, 20, 1);

		self.position = self.position - self.itemWidth;
		self.position2 = self.position2 - self.itemWidth;

		if (self.position <= 0 - self.listWidth)
			self.position = self.position2 + self.listWidth;

		if (self.position2 <= 0 - self.listWidth)
			self.position2 = self.position + self.listWidth;

		self.timer = setTimeout(self.scroll, 2000);
	}

	this.startScroll = function()
	{
		this.timer = setTimeout(this.scroll, 4000);
	}

	this.startScroll();
}
