
	var boxSlider = function(elem, total, speed)
	{
		this.elem = elem;
		this.total = total;
		this.speed = speed;
		this.pixel = 49;
		this.width = elem.clientWidth;
		this.section = this.width / total;
		this.current = 0;
		this.set(0);
	};
	boxSlider.prototype = {
		set: function(value)
		{
			this.elem.style.left = value + 'px';
			this.value = parseInt(this.elem.style.left);
		},
		next: function()
		{
			var _ = this;
			
			if (!_.interval)
			{
				if (_.current < _.total - 1)
				{
					_.current++;
					
					_.interval = setInterval(function()
					{
						_.set(_.value - _.pixel);
						
						if (_.value == -_.section * _.current)
						{
							clearInterval(_.interval);
							_.interval = null;
						}
					}, _.speed);
				}
			}
		},
		prev: function()
		{
			var _ = this;
			
			if (!_.interval)
			{
				if (_.current > 0)
				{
					_.current--;
					
					_.interval = setInterval(function()
					{
						_.set(_.value + _.pixel);
						
						if (_.value == -_.section * _.current)
						{
							clearInterval(_.interval);
							_.interval = null;
						}
					}, _.speed);
				}
			}
		}
	};
