function scrollerObj(name,initH,initW,content,initBg,border,geschwindigkeit)
{
this.speed=1;
this.name=name; 
this.initH=initH; 
this.initW=initW; 
this.content=content; 
this.initBg=initBg; 
this.border=border; 
this.geschwindigkeit=geschwindigkeit;
this.timer = name + "Timer"; 

this.getElement = getElement; 
this.createLayer=createLayer;
this.scrollLayer = scrollLayer; 
this.scrollLoop=scrollLoop;

this.createLayer(); 
this.getElement(); 
this.scrollLayer();
}


function scrollLoop(s)
{
this.speed = s;
}

function scrollLayer()
{
	if(parseInt(this.elem.style.top)>(this.elem.offsetHeight*(-1)))
	{
  	this.elem.style.top = parseInt(this.elem.style.top)-this.speed;
	}
  	else 
	{
	this.elem.style.top = this.initH;
	}
}

function getElement()
{ 
	if (document.getElementById)	
	{
	this.elem = document.getElementById(this.name);
  	}
	else {this.elem = document.layers[name];
	}
}


function createLayer()
{
	if(document.getElementById)
	{ 
	document.write('<div id="layer'+this.name+'" style="position:relative;overflow:hidden;');
	document.write('background-color:#'+this.initBg+';border:1px solid #'+this.border+';width:');
	document.write(this.initW+'px;height:'+this.initH+'px;" onmouseover="');
	document.write(this.name+'.scrollLoop(0)" onmouseout="'+this.name+'.scrollLoop(');
	document.write(1+')">');

	document.write('<div id="'+this.name+'" style="position:absolute;top:');
	document.write(this.initH+'px;left:0px;border:0px solid black;width:');
	document.write(this.initW+'px;">'+this.content+'<\/div><\/div>');
	}
	else 
	{ 
	document.write('<ilayer name="'+this.name+'" width="');
	document.write(this.initW+'" height="'+this.initH+'">'+this.content+'<\/ilayer>');
	return;
	}

	if(this.scrollLayer)
	{
  	this.timer = setInterval(this.name+'.scrollLayer()',+this.geschwindigkeit);
  	}
}
