Stripped = Class.create();
Stripped.prototype =
{
	initialize: function(name, width, options)
	{
		this.busy = false;
		this.name = name;
		this.element = $(this.name);
		options = options || {};
		this.leftButton = options.left || false;
		this.rightButton = options.right || false;
		this.leftOffset = 0;
		this.maxOffset = -width+440;
		if (this.leftButton)
		{
			$(this.leftButton).style.cursor = "pointer";
			Event.observe(this.leftButton, 'mousedown', this.leftStart.bindAsEventListener(this), false);
		}
		if (this.rightButton)
		{
			$(this.rightButton).style.cursor = "pointer";
			Event.observe(this.rightButton, 'mousedown', this.rightStart.bindAsEventListener(this), false);
		}
		Event.observe(document, 'mouseup', this.unlock.bindAsEventListener(this), false);
	},
	
	rightStart: function()
	{
		this.lock();
		this.rightAction();
	},
	
	leftStart: function()
	{
		this.lock();
		this.leftAction();
	},
	
	rightAction: function()
	{
		if (this.isLocked())
		{
			newLeft = this.leftOffset - 10;
			if (newLeft > this.maxOffset)
			{
				this.leftOffset = newLeft;
				$(this.name).style.left = this.leftOffset.toString() + "px";
				this.rightAction.bind(this).delay(0.05);
			}
		}
	},
	
	leftAction: function()
	{
		if (this.isLocked())
		{
			newLeft = this.leftOffset + 10;
			if (newLeft < 0)
			{
				this.leftOffset = newLeft;
				$(this.name).style.left = this.leftOffset.toString() + "px";
				this.leftAction.bind(this).delay(0.05);
			}
		}
	},
	
	lock: function()
	{
		this.busy = true;
	},
	
	unlock: function()
	{
		this.busy = false;
	},
	
	isLocked: function()
	{
		return this.busy;
	}
};

