
var winHeight =  360;        // Fensterhoehe, nur zusammen mit dem Fensterclipping veraendern
var active    =  false;      // flag fuer Bewegung
var startPos  =  0;			 // Startposition
var aktPos    =  startPos;   // aktuelle Position
var step      =  1;          // Bewegung pro intervall, hier Geschwindigkeit regeln

// some known objects
var nc		=	!!(document.captureEvents	&&	!document.getElementById);
var nc6	 	=	!!(document.captureEvents	&&	document.documentElement);
var dom     =   !!document.getElementById;
var ie		=	!!document.all;
var ie4	 	=	!!(document.all				&&	!document.documentElement);

var run = null;

// inhalt referenzieren
function dRefS(num){return (nc? document.fenster.document.inhalt : (ie4? document.all["inhalt"].style : document.getElementById("inhalt").style))}
function dRef(num){return (nc? document.fenster.document.inhalt : (ie4? document.all["inhalt"] : document.getElementById("inhalt")))}


//Div-Hoehe
function divHoch(obj) 
{
	if(dom)        obj.style.height =  "auto";              // fuer NC 6 width auf auto setzen
	if(nc)         return obj.document.height;
	if(ie4 || dom) return obj.offsetHeight;
}

function init()
{
	// inhalt hoehe und scrollende festlegen
	divSizeHeight = (divHoch(dRef()));	
	scrollEnd     = (divSizeHeight - winHeight - startPos) * -1;	
}

function stopAll()
{
	active = false;
	if (run != null) {
		clearTimeout(run);
	}
}

function initUp()
{
	active = true;
	goUp();
}
function goUp()
{
	if(active)
	{			
		aktPos       =  (aktPos - step >= scrollEnd)? aktPos - step :  scrollEnd;	
		dRefS().top  =  aktPos;
		if(aktPos > scrollEnd) run = setTimeout('goUp()',10);
		else active  =  false;
	}
}

function initDown()
{
	active = true;
	goDown();
}

function goDown()
{
	if(active)
	{		
		aktPos       =  (aktPos + step <= startPos)? aktPos + step :  startPos;		
		dRefS().top  =  aktPos;		
		if(aktPos < startPos) run = setTimeout('goDown()',10);
		else active  =  false;
	}
}
