function Scroller(layerName,initHeight,initWidth,content,speed) {
	this.layerName=layerName;
	this.initHeight=initHeight;
	this.initWidth=initWidth;
	this.content=content;
	this.speed=speed;
	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.initHeight;}
}
function getElement() { // if dom use correct call

	if (document.getElementById){this.elem = document.getElementById(this.layerName);
	  } else {this.elem = document.layers[layerName];}
}


function createLayer() {
if(document.getElementById){ // its domable
	document.write('<div id="layer'+this.layerName+'" style="position:relative;overflow:hidden;width:'+this.initWidth+'px;height:'+this.initHeight+'px;" ');
	document.write('onmouseover="'+this.layerName+'.scrollLoop(0)" onmouseout="'+this.layerName+'.scrollLoop('+this.speed+')">');
	document.write('<div id="'+this.layerName+'" style="position:absolute;">'+this.content+'<\/div><\/div>');
} else {
	document.write('<ilayer layerName="'+this.layerName+'" width="'+this.widthB+'" height="'+this.heightB+'">'+this.content+'<\/ilayer>');
	return;
}

	if(this.scrollLayer) {
	  this.timer = setInterval(this.layerName+'.scrollLayer()','30');
	}
}