	
	var CSlider = function () {
		createMethodReference(this, CElement)();
		this.moveSize = 30;
		this.moveSpeed = 40;
		this.movInterval = null;
		this.movOffset = null;
		this.maxWidth = null;
	};
	CSlider.prototype = clone(CElement.prototype);
	
	CSlider.prototype.movFunc = function () {
		if (!this.moveStep(this.movOffset * this.moveSize))
			clearInterval(this.movInterval);
	};
	
	CSlider.prototype.moveStep = function (moveto) {
		var m = this.getMargin();
		var n = Math.max(-this.maxWidth, Math.min(0, m.left + moveto));
		var changed = (n!=m.left);
		m.left = n;
		
		this.setMargin(m);
		return changed;
	};
	
	CSlider.prototype.move = function (offset) {
		if (this.maxWidth == null) {
			this.maxWidth = 0;
			for (var c = 0; c < this.element.childNodes.length; c ++) {
				if (this.element.childNodes[c].offsetWidth) {
					this.maxWidth += parseInt(this.element.childNodes[c].offsetWidth, 10);
				}
			}
			this.maxWidth -= this.element.parentNode.offsetWidth;
		}
		
		clearInterval(this.movInterval);
		this.movOffset = offset;
		this.movInterval = setInterval(createMethodReference(this, this.movFunc), this.moveSpeed);
	};
	
	CSlider.prototype.moveStop = function () {
		clearInterval(this.movInterval);
	};
	

