function ScrollArea(name, element) {
	// Prepare
	this._name = name;
	this._element = null;
	this._scrollSpeed = 2;
	this._scrollPositionTop = 0;
	this._scrollPositionLeft = 0;
	this._timeout = 1;
	this._timeoutId = null;
	this._element = element;
}

ScrollArea.prototype.stopScroll = function() {
	clearTimeout(this._timeoutId);
}

ScrollArea.prototype.scrollUp = function() {
	if (this._element) {
		if ((this._scrollPositionTop - this._scrollSpeed) < 0) {
			this._scrollPositionTop = 0;
		} else {
			this._scrollPositionTop = (this._scrollPositionTop - this._scrollSpeed);
		}

		this._element.scrollTop = this._scrollPositionTop;
		this._timeoutId = setTimeout(this._name + ".scrollUp()", this._timeout);
	}
}

ScrollArea.prototype.scrollLeft = function() {
	if (this._element) {
		if ((this._scrollPositionLeft - this._scrollSpeed) < 0) {
			this._scrollPositionLeft = 0;
		} else {
			this._scrollPositionLeft = (this._scrollPositionLeft - this._scrollSpeed);
		}

		this._element.scrollLeft = this._scrollPositionLeft;
		this._timeoutId = setTimeout(this._name + ".scrollLeft()", this._timeout);
	}
}

ScrollArea.prototype.scrollDown = function() {
	if (this._element) {
		if ((this._scrollPositionTop + this._scrollSpeed) > (this._element.scrollHeight - this._element.offsetHeight)) {
			this._scrollPositionTop = (this._element.scrollHeight - this._element.offsetHeight);
		} else {
			this._scrollPositionTop += this._scrollSpeed;
		}

		this._element.scrollTop = this._scrollPositionTop;
		this._timeoutId = setTimeout(this._name + ".scrollDown()", this._timeout);
	}
}

ScrollArea.prototype.scrollRight = function() {
	if (this._element) {
		if ((this._scrollPositionLeft + this._scrollSpeed) > (this._element.scrollWidth - this._element.offsetWidth)) {
			this._scrollPositionLeft = (this._element.scrollWidth - this._element.offsetWidth);
		} else {
			this._scrollPositionLeft += this._scrollSpeed;
		}

		this._element.scrollLeft = this._scrollPositionLeft;
		this._timeoutId = setTimeout(this._name + ".scrollRight()", this._timeout);
	}
}

ScrollArea.prototype.resetScroll = function() {
	if (this._elementj) {
		this._element.scrollTop = 0;
		this._element.scrollLeft = 0;
		this._scrollPositionTop = 0;
		this._scrollPositionLeft = 0;
	}
}