//
var clipTop = 0;
var clipLeft = 0;
if (!clipRight) {
	var clipRight = 650;
}
var clipBottom = 170;
var leftPos = 0;
var lyrwidth = 0;
var time,amount,theTime,theHeight,DHTML;

function init()
{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var y = new getObj('photos');
	if (document.layers)
	{
		lyrwidth = y.style.clip.width;
		//lyrwidth += 20;
		y.style.clip.top = clipTop;
		y.style.clip.left = clipLeft;
		y.style.clip.right = clipRight;
		y.style.clip.bottom = clipBottom;
	}
	else if (document.getElementById || document.all)
	{
		lyrwidth = y.obj.offsetWidth;
		y.style.clip = 'rect('+clipTop+'px,'+clipRight+'px,'+clipBottom+'px,'+clipLeft+'px)';
	}
}

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;
	leftPos -= amount;
	if (clipLeft < 0 || clipRight > lyrwidth)
	{
		clipLeft -= amount;
		clipRight -= amount;
		leftPos += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+'px,'+clipRight+'px,'+clipBottom+'px,'+clipLeft+'px)';
		thelayer.style.clip = clipstring;
		thelayer.style.left = leftPos + 'px';
	}
	else if (document.layers)
	{
		thelayer.style.clip.left = clipLeft;
		thelayer.style.clip.right = clipRight;
		thelayer.style.left = leftPos;
	}
	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];
  }
}