// JavaScript Document


var clipTop = 0;
var clipWidth = 170;
var clipBottom = 50;
var topper = 300;
var lyrheight = 0;
var time,amount,theTime,theHeight,DHTML;
var thelayer;

function init()
{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('stop');
	var y = new getObj('xtz');

	lyrheight = y.obj.offsetHeight - x.obj.offsetHeight;
	if (lyrheight<0) lyrheight=0;
	lyrheight += 20;
	
}

function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}

function stopScroll()
{
	if (time) clearTimeout(time);
}

function realscroll()
{
	if (!DHTML) return;
	clipTop += amount;
	if (clipTop<0) clipTop = 0;
	if (clipTop>lyrheight) clipTop = lyrheight;
	clipBottom += amount;
	
	
	thelayer.obj.scrollTop = clipTop;
	time = setTimeout('realscroll()',theTime);
}


function getObj(name)
{
  if (document.getElementById)
  {
    this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
    this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

