var clipTop = 0;
var clipRight = 560;
var clipBottom = 185;
var clipLeft = 0;
var topper = 15;
var glyrwidth = 0;
var counter = 0, amount, flag = 1;
var newsCount = 0, newsTotal;
var horzTimeID;

function initgLayer(amt)
{
	if(newsCount == 0)
	{
		clipTop = 0;
		clipRight = 160;
		clipBottom = 185;
		clipLeft = 0;
		topper = 15;

	}
	if(flag == 1)
	{
		//glyrwidth = document.getElementById("galleryholder").offsetWidth;
		//alert(lyrwidth);
		newsTotal = (glyrwidth / 50) - 3;
		newsCount = 0;

		if (navigator.appName == 'Microsoft Internet Explorer')glyrwidth = glyrwidth + 25;
		if (navigator.appName == 'Netscape')lyrwidth = glyrwidth + 20;
		flag = 0;
		counter = 0;
	}

	if(amt > 0)newsCount++;
	else newsCount--;

	if(newsCount == 0)
	{
	}
	else if(newsCount == newsTotal)
	{
	}
	else if(newsCount > 0 || newsCount < newsTotal )
	{
	}

	if(amt < 0) amount = -11;
	else amount = 11;

	grealscroll();
}

function grealscroll()
{
	counter++;
	clipLeft += amount;
	clipRight += amount;
	topper -= amount;
	if (clipLeft < 0 || clipRight > glyrwidth)
	{
		clipLeft -= amount;
		clipRight -= amount;
		topper += amount;
		return;
	}
	document.getElementById("galleryholder").style.clip = 'rect('+clipTop+'px,'+clipRight+'px,'+clipBottom+'px,'+clipLeft+'px )';
	document.getElementById("galleryholder").style.left = topper + 'px';

	if(counter < 5)horzTimeID = setTimeout('grealscroll();',parseInt(1));
	else
	{
		clearTimeout(horzTimeID);
		counter = 0;
	}
}

function stopAnim()
{
	if(horzTimeID) clearTimeout(horzTimeID);
}


