var clipTop2;
var clipWidth2;
var clipBottom2;
var topper2;
var lyrheight2;
var menuObj2;
var time2,amount2,theTime2,theHeight2,DHTML2;

function init2(nmenuObj2)
{
	menuObj2 = nmenuObj2;
  
  DHTML2 = (document.getElementById || document.all || document.layers)
	if (!DHTML2) return;
	var x = new getObj2(menuObj2);

	if (document.layers)
	{
		lyrheight2 = x.style.clip.bottom + 20;
		clipTop2 = x.style.clip.top;
		clipWidth2 = x.style.clip.right;
		clipBottom2 = x.style.clip.bottom;
		topper2 = x.style.top;
	}
	else if (document.getElementById || document.all)
	{
		var clipv = x.style.clip.split("rect(")[1].split(")")[0].split("px");
		
		for(i=0;i<4;i++) {
      if (clipv[i][0] == ',') clipv[i] = clipv[i].split(",")[1];
      clipv[i] = parseInt(clipv[i]);
    }

    lyrheight2 = x.obj.offsetHeight;
		clipTop2 = clipv[0];
		clipWidth2 = clipv[1];
		clipBottom2 = clipv[2];
		topper2 = x.obj.offsetTop;
		
		var clipstring = 'rect('+clipTop2+'px,'+clipWidth2+'px,'+clipBottom2+'px,0)';
		x.style.clip = clipstring;
	}
}

function scrollayer2(layername,amt,tim)
{
	if (!DHTML2) return;
	thelayer = new getObj2(layername);
	if (!thelayer) return;
	amount2 = amt;
	theTime2 = tim;
	realscroll2();
}

function stopScroll2()
{
	if (time2) clearTimeout(time2);
}

function realscroll2()
{
	if (!DHTML2) return;
	clipTop2 += amount2;
	clipBottom2 += amount2;
	topper2 -= amount2;
	if (clipTop2 < 0 || clipBottom2 > lyrheight2)
	{
		clipTop2 -= amount2;
		clipBottom2 -= amount2;
		topper2 += amount2;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop2+'px,'+clipWidth2+'px,'+clipBottom2+'px,0)'
		thelayer.style.clip = clipstring;
		thelayer.style.top = topper2 + 'px';
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop2;
		thelayer.style.clip.bottom = clipBottom2;
		thelayer.style.top = topper2;
	}
	time2 = setTimeout('realscroll2()',theTime2);
}

function getObj2(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];
  }
}

