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];
  }
}

// ################################ //

var clipTop = 0;
var clipWidth = 435;
var clipBottom = 130;
var clipLeft = 15;
var clipRight = 435;
var topper = 0;
var leftter = 0;
var lyrheight = 0;
var divWidth = 0;
var time,amount,theTime,theHeight,DHTML;

function init()
{
//--[Added by JD 10/29/2008] err handle panel closed ---
try {		
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('scrolleable');
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;
		x.style.clip.top = clipTop;
		x.style.clip.left = clipLeft;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;
		leftter = (window.innerWidth - 435) / 2;
	}
	else if (document.getElementById || document.all)
	{
		lyrheight = x.obj.offsetHeight;
		divWidth = x.obj.offsetWidth;
		x.style.clip = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,'+clipLeft+'px)';
		leftter = (document.body.clientWidth - 435) / 2;
	}
}
  catch(e){}
}

function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}

function realscroll()
{
	if (!DHTML) return;
	clipLeft +=amount;
	clipRight += amount;
	leftter -= amount;
	if(clipLeft < 0 || clipRight > divWidth)
	{
		clipLeft -=amount;
		clipRight -= amount;
		leftter += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect(0,'+clipRight+'px,'+clipBottom+'px,'+clipLeft+'px)';
		thelayer.style.clip = clipstring;
		thelayer.style.left = leftter + 'px';
	}
	else if (document.layers)
	{
		clipstring = 'rect(0,'+clipRight+'px,50,'+clipLeft+'px)';
		thelayer.style.clip.right = clipRight + 'px';
		thelayer.style.clip.left = clipLeft + 'px';
		//thelayer.style.clip.top = clipTop;
		//thelayer.style.clip.bottom = clipBottom;
		thelayer.style.left = leftter + 'px';
	}
	time = setTimeout('realscroll()',theTime);
}

function stopScroll()
{
	if (time) clearTimeout(time);
}
	
