/* 	div#scroller->class()
	suspect code by zwischenbilanz */

scroller = function (outdiv, innerdiv, scrollspeed)
{
	this.outdiv_id 		= outdiv || 'scrollable_outer';
	this.innerdiv_id 	= innerdiv || 'scrollable_inner';
	this.outdiv_height 	= document.getElementById(this.outdiv_id).offsetHeight;
	this.innerdiv_height= document.getElementById(this.innerdiv_id).offsetHeight;
	this.innerdiv_top 	= parseInt(document.getElementById(this.innerdiv_id).offsetTop);
	this.scrollspeed 	= scrollspeed || 20;
	this.mustscroll		= false;

	this.init	=	function ()
	{ this.mustscroll =(this.innerdiv_height > this.outdiv_height) ? true : false; }
	
	this.scroll =	function(scrolltype)
	{
		scrolltype = (scrolltype == 'up') ? "scroller.up();" : "scroller.down();";
		document.getElementById(this.innerdiv_id).timer = window.setInterval(scrolltype,10);
	}
	
	this.stop	=	function()
	{
		window.clearInterval(document.getElementById(this.innerdiv_id).timer);
	}
	
	this.down		=	function()
	{
		if (this.mustscroll == true && this.innerdiv_top > (this.outdiv_height - this.innerdiv_height)) 
		{
			this.innerdiv_top -= this.scrollspeed;
			document.getElementById(this.innerdiv_id).style.top = this.innerdiv_top+'px';
		}
	
	}
	
	this.up	=	function()
	{
		if (this.mustscroll == true && this.innerdiv_top < 0)
		{
			this.innerdiv_top += this.scrollspeed;
			document.getElementById(this.innerdiv_id).style.top = this.innerdiv_top+'px';
		}
	}
	
}


scrollerDialogBilder = function (outdiv, innerdiv, scrollspeed)
{
	this.outdiv_id 		= outdiv || 'scrollable_outer';
	this.innerdiv_id 	= innerdiv || 'scrollable_inner';
	this.outdiv_height 	= document.getElementById(this.outdiv_id).offsetHeight;
	this.innerdiv_height= document.getElementById(this.innerdiv_id).offsetHeight;
	this.innerdiv_top 	= parseInt(document.getElementById(this.innerdiv_id).offsetTop);
	this.scrollspeed 	= scrollspeed || 20;
	this.mustscroll		= false;

	this.init	=	function ()
	{ this.mustscroll =(this.innerdiv_height > this.outdiv_height) ? true : false; }
	
	this.scroll =	function(scrolltype)
	{
		scrolltype = (scrolltype == 'up') ? "scrollerDialogBilder.up();" : "scrollerDialogBilder.down();";
		document.getElementById(this.innerdiv_id).timer = window.setInterval(scrolltype,10);
	}
	
	this.stop	=	function()
	{
		window.clearInterval(document.getElementById(this.innerdiv_id).timer);
	}
	
	this.down		=	function()
	{
		if (this.mustscroll == true && this.innerdiv_top > (this.outdiv_height - this.innerdiv_height)) 
		{
			this.innerdiv_top -= this.scrollspeed;
			document.getElementById(this.innerdiv_id).style.top = this.innerdiv_top+'px';
		}
	
	}
	
	this.up	=	function()
	{
		if (this.mustscroll == true && this.innerdiv_top < 0)
		{
			this.innerdiv_top += this.scrollspeed;
			document.getElementById(this.innerdiv_id).style.top = this.innerdiv_top+'px';
		}
	}
	
}

scrollerDialogRepertoire = function (outdiv, innerdiv, scrollspeed)
{
	this.outdiv_id 		= outdiv || 'scrollable_outer';
	this.innerdiv_id 	= innerdiv || 'scrollable_inner';
	this.outdiv_height 	= document.getElementById(this.outdiv_id).offsetHeight;
	this.innerdiv_height= document.getElementById(this.innerdiv_id).offsetHeight;
	this.innerdiv_top 	= parseInt(document.getElementById(this.innerdiv_id).offsetTop);
	this.scrollspeed 	= scrollspeed || 20;
	this.mustscroll		= false;

	this.init	=	function ()
	{ this.mustscroll =(this.innerdiv_height > this.outdiv_height) ? true : false; }
	
	this.scroll =	function(scrolltype)
	{
		scrolltype = (scrolltype == 'up') ? "scrollerDialogRepertoire.up();" : "scrollerDialogRepertoire.down();";
		document.getElementById(this.innerdiv_id).timer = window.setInterval(scrolltype,10);
	}
	
	this.stop	=	function()
	{
		window.clearInterval(document.getElementById(this.innerdiv_id).timer);
	}
	
	this.down		=	function()
	{
		if (this.mustscroll == true && this.innerdiv_top > (this.outdiv_height - this.innerdiv_height)) 
		{
			this.innerdiv_top -= this.scrollspeed;
			document.getElementById(this.innerdiv_id).style.top = this.innerdiv_top+'px';
		}
	
	}
	
	this.up	=	function()
	{
		if (this.mustscroll == true && this.innerdiv_top < 0)
		{
			this.innerdiv_top += this.scrollspeed;
			document.getElementById(this.innerdiv_id).style.top = this.innerdiv_top+'px';
		}
	}
	
}

scrollerDialogPresse = function (outdiv, innerdiv, scrollspeed)
{
	this.outdiv_id 		= outdiv || 'scrollable_outer';
	this.innerdiv_id 	= innerdiv || 'scrollable_inner';
	this.outdiv_height 	= document.getElementById(this.outdiv_id).offsetHeight;
	this.innerdiv_height= document.getElementById(this.innerdiv_id).offsetHeight;
	this.innerdiv_top 	= parseInt(document.getElementById(this.innerdiv_id).offsetTop);
	this.scrollspeed 	= scrollspeed || 20;
	this.mustscroll		= false;

	this.init	=	function ()
	{ this.mustscroll =(this.innerdiv_height > this.outdiv_height) ? true : false; }
	
	this.scroll =	function(scrolltype)
	{
		scrolltype = (scrolltype == 'up') ? "scrollerDialogPresse.up();" : "scrollerDialogPresse.down();";
		document.getElementById(this.innerdiv_id).timer = window.setInterval(scrolltype,10);
	}
	
	this.stop	=	function()
	{
		window.clearInterval(document.getElementById(this.innerdiv_id).timer);
	}
	
	this.down		=	function()
	{
		if (this.mustscroll == true && this.innerdiv_top > (this.outdiv_height - this.innerdiv_height)) 
		{
			this.innerdiv_top -= this.scrollspeed;
			document.getElementById(this.innerdiv_id).style.top = this.innerdiv_top+'px';
		}
	
	}
	
	this.up	=	function()
	{
		if (this.mustscroll == true && this.innerdiv_top < 0)
		{
			this.innerdiv_top += this.scrollspeed;
			document.getElementById(this.innerdiv_id).style.top = this.innerdiv_top+'px';
		}
	}
	
}
