function TMS(referenz,container,content,contentTop,contentLeft) {
	this.scrollContainer = container;
	this.scrollContent = content;
	this.scrollContentTop = contentTop;
	this.scrollContentLeft = contentLeft;
	this.ref = referenz;
	this.scrollInit = false;
}

TMS.prototype.TMScrollInit = function() {
	if (isDOM) {
		this.scrollRahmenEbene = TMGetEl(this.scrollContainer);
		this.scrollEbene = TMGetEl(this.scrollContent);
		this.hPosition = this.scrollContentLeft;
		this.scrollRechtsMaximum = - this.scrollEbene.offsetWidth + this.scrollRahmenEbene.offsetWidth;
		this.scrollLinksMaximum = 0;
		this.vPosition = this.scrollContentTop;
		this.scrollDownMaximum = - this.scrollEbene.offsetHeight + this.scrollRahmenEbene.offsetHeight;
		this.scrollUpMaximum = 0;
		this.scrollInit = true;
	}
};

TMS.prototype.TMScrollStart = function(hSpeed,vSpeed,scrollTimer) {
	if (this.scrollInit) {
		if (this.scrollSchleife) {
			window.clearInterval(this.scrollSchleife);
		}
		if (((vSpeed < 0) && (this.vPosition > this.scrollDownMaximum)) || ((vSpeed > 0) && (this.vPosition < this.scrollUpMaximum)) || ((hSpeed < 0) && (this.hPosition > this.scrollRechtsMaximum)) || ((hSpeed > 0) && (this.hPosition < this.scrollLinksMaximum))) {
			this.hPosition += hSpeed;
			this.vPosition += vSpeed;
			TMSetPosition(this.scrollContent,this.hPosition,this.vPosition);
			this.scrollSchleife = window.setInterval(this.ref + '.TMScrollStart(' + hSpeed + ',' + vSpeed + ',' + scrollTimer + ')',scrollTimer);
		}
	} else {
		this.TMScrollInit();
		this.TMScrollStart(hSpeed,vSpeed,scrollTimer);
	}
};

TMS.prototype.TMScrollStop = function() {
	if (this.scrollSchleife) {
		window.clearInterval(this.scrollSchleife);
		this.scrollSchleife = false;
	}
};

var NewsScroller = new TMS('NewsScroller','NewsScrollWrapper','NewsScrollContent',0,0);

