// gjh
//alert(dataset.columnNames.length); //gets the # of columns
var p = -1;
var offsetLeft = 0;
var offsetTop = 0;
var clkNxt = false;
var i = 0;
var scrll = 580;
var count = 0;
var max = 0;
var items = "";
var cont = true;
var maxCount = 5; // 5 works best for all other pages but the All Pedestals page needs to be set to 4 to view last row.
function GJHPageNext()
{

	GJHCount();	
	
	if(count >= max || cont == false)
	{
		count += -1;
		cont = false;
		//clkNxt = false;
	}
	else
	{	
		clkNxt = true;	
		if(cont){
			var d = document.getElementById('productLoopContainer');
			if(p <= 0)
			{
				p += -580;
				d.style.top = p+"px";
			}
			else
			{
				p -= p;
				d.style.top = p+"px";
			}
			offsetTop = (offsetTop - 580);			
		}
	}
}
function GJHPageBack()
{
	var d = document.getElementById('productLoopContainer');
	
		if(clkNxt)
		{
			cont = true;
			if(p >= -1)
			{
			}
			else
			{
				p += 580;			
			}
			d.style.top = p+"px";
			offsetTop = (offsetTop + 580);
			max += -1;
			count += -max;			
			if(count <= 1){
				count = -1;
			}			
			GJHCount();
		}
	
}

function GJHCount()
{
	div = document.getElementById("productLoopContainer");
	items = div.getElementsByTagName("div");
	if(count > max)
	{
	 count += -1;
	}
	else{
	count += 1 ;
	}
	max = (items.length / 4);
	//max = (max / 5);
	max = (max / maxCount);
	max = Math.ceil(max);
	
	//alert("count " + count + " max " + max);	
}







