var clipTop = 0;
var clipWidth = 600;
var clipBottom = 100;
var clipLeft = -600;
var lefter = 800;
var lyrheight = 0;
var time,amount,theTime,theHeight,DHTML;

function prepLyr(){

	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('example');
	
	if (document.layers)
	{
	    
//		lyrheight = x.style.clip.bottom;
//		lyrheight += 20;
//		x.style.clip.top = clipTop;
//		x.style.clip.left = 0;
//		x.style.clip.right = clipWidth;
//		x.style.clip.bottom = clipBottom;
    }
	else if (document.getElementById || document.all)
	{
	        
		lyrheight = x.obj.offsetHeight;
		x.style.clip = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' '+clipLeft+')';
		
	}

	x.style.visibility= 'visible';
//	thelayer = new getObj(layername);
	scrollayer('example',5,50)

}
function vis(val)
{
	if (!DHTML) return;
	var f = new getObj('example');
	f.style.visibility = val;
}

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;
	lefter -= amount;

	if (clipLeft > 1500)
	{
		clipLeft=-600;
		lefter = 800;
	}

	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' '+clipLeft+')'
		thelayer.style.clip = clipstring;
		thelayer.style.left = lefter;
	}
	else if (document.layers)
	{
		thelayer.style.clip.left = clipLeft;
		thelayer.style.clip.width = clipWidth;
		thelayer.style.left = lefter;
	}
	time = setTimeout('realscroll()',theTime);
}

function stopScroll()
{
	if (time) clearTimeout(time);
}

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];
  }
  
  
}

