// Vscroll. Vertical scroll .
// name: name of this Hscroll object. It's necesary for setTimeout function.
// aLayer: the layer (object) that is scrolled.
// aText: the HTML text in the layer.
// gap: jump between every step (pixels).
// speed: delay between every step (milliseconds).  Default, if not specified: 50.
function Vscroll(name,aLayer,aText,gap,width,height,left,top,speed)
{
	this.name=name;
	this.layer=aLayer;
	this.text=aText;
	this.gap=gap;
	this.width=width;
	this.height=height;
	this.left=left;
	this.top=top;
	if (speed)
		this.speed = speed ;
	else
		this.speed = 50 ;
	this.blnScroll=false;
	this.layer.write(this.text);
}

function init()
{
	this.layer.moveTo(this.left,this.top+this.height);
		this.layer.setClip(0,-this.height,this.width,0);

}

function start()
{
	this.blnScroll=true;
	this.scroll();
}

function scroll()
{
	this.layer.moveTo(this.left,(this.layer.top - this.gap));
	this.layer.setClip(0,this.layer.clip.top+this.gap,this.width,this.layer.clip.top+this.height)
	if((this.layer.top+this.layer.getDocHeight())<this.top)
		this.init();
	if(this.blnScroll)
		setTimeout(this.name+".scroll()",this.speed);
}

function stop()
{
	this.blnScroll=false;
}

Vscroll.prototype.start=start;
Vscroll.prototype.stop=stop;
Vscroll.prototype.scroll=scroll;
Vscroll.prototype.init=init;  
