// JavaScript Document

/* <![CDATA[ */
/*
	+++
	
	TMScroll Version 0.5
	DHTML-Scroller
	
	Benoetigt tmdomlib.js v0.5.3
	
	Kompatible Browser (Liste u.U. unvollstaendig):
	-	Mozilla-basierte Browser (Mozilla, Firefox/Firebird/Phoenix, Netscape 6+ etc.)
	-	Internet Explorer 5+
	-	Opera 6+
	-	Safari/KHTML
	
	Dieses Script darf fuer non-kommerzielle Zwecke frei und kostenlos verwendet werden, sofern
	-	die einzelnen Funktionen unveraendert bleiben.
	-	die einzelnen Funktions-Bezeichnungen unveraendert bleiben.
	-	diese Informationen, insbesodere auch der Hinweis auf den Urheber, unveraendert bleiben.
	
	Fuer kommerzielle Nutzung oder bei Unklarheiten bezueglich der Nutzungsbedingungen wende dich an den Urheber.
	
	Urheber:	Tobias Mueller 2004
	Internet:	www.adepto.de
	E-Mail:		mail@adepto.de
	
	+++
*/
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 scroller = new TMS('scroller','content_scrolling_wrapper','content_scrolling',0,0);

/* ]]> */




var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
	if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
	settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
	win.focus();
}

