function Fretousel(id)
{
	//properties
	this.id = id;
	this.container = null;
	this.carousel = null;
	this.carousel_height = 100;
	this.carousel_items = null;
	this.item_width = 100;
	this.item_height = 100;
	this.pages = 1;
	this.current_page = 1;
	this.scroll_speed = 1;
}

Fretousel.prototype.init = function()
{
	this.container = document.getElementById(this.id);
	if(!this.container) return false;
	this.container.style.position = "relative";
	this.container.style.overflow = "hidden";
	
	this.carousel = this.container.getElementsByTagName("ul")[0];
	if(!this.carousel) return false;
	this.carousel.style.position = "relative";
	this.carousel.style.overflow = "hidden";
	this.carousel.style.height = this.carousel_height + "px";
	this.carousel.style.padding = "0";
	this.carousel.style.margin = "0";
	this.carousel.style.listStyle = "none";
	this.carousel.style.left = "0px";
	
	this.carousel_items = this.carousel.getElementsByTagName("li");
	
	this.carousel.style.width = (this.carousel_items.length * this.item_width) + "px";
	
	for(var i = 0; i < this.carousel_items.length; i++)
	{
		this.carousel_items[i].style.cssFloat = "left";
		this.carousel_items[i].style.styleFloat = "left";
		this.carousel_items[i].style.width = this.item_width + "px";
		this.carousel_items[i].style.height = this.item_width + "px";
		this.carousel_items[i].style.margin = "0";
		this.carousel_items[i].style.padding = "0";
		this.carousel_items[i].style.textAlign="center";
	}
}

Fretousel.prototype.next = function()
{
	if(this.current_page == this.pages) return false;
	$("#" + this.id + " ul").animate({"left": "-=" + (this.scroll_speed * this.item_width) + "px"}, "slow");
	this.current_page++;
}

Fretousel.prototype.previous = function()
{
	if(this.current_page == 1) return false;
	$("#" + this.id + " ul").animate({"left": "+=" + (this.scroll_speed * this.item_width) + "px"}, "slow");
	this.current_page--;
}