function slider(width,pos,id,auto){
	this.sliderWidth = width;
	this.pos = 1;
	this.sliderId = id;
	this.sliderWrapper = $("#" + this.sliderId + " .sliderWrapper");
	this.slide = function(dir,el,p){
		if(!isNaN(p)){
			$(el).animate({
				left: (-1)*(p-1)*this.sliderWidth + "px"
			});
		}
		else {
			var left = (-1)*(this.pos-1)*this.sliderWidth;
			(dir=="left") ? left = (left+this.sliderWidth) + "px" : left = (left-this.sliderWidth) + "px";
			$(el).animate({
				left: left
			});
		}
	}
	this.slideLeft = function(){
		if(this.pos>1){
			this.slide("left",$(this.sliderWrapper));
			this.pos--;
		}
		else{
			this.slide("right",$(this.sliderWrapper),$(this.sliderWrapper).children().length);
			this.pos = $(this.sliderWrapper).children().length;
		}
	}
	this.slideRight = function(){
		if(this.pos<$(this.sliderWrapper).children().length){
			this.slide("right",$(this.sliderWrapper));
			this.pos++;
		}
		else{
			this.slide("left",$(this.sliderWrapper),1);
			this.pos = 1;
		}
	}
}
