function incrementPG(max)
{
	if (window.PG == undefined)
		window.PG = 1;

	if (window.PG < max)
		window.PG++;
	
	displaySinglePane(window.PG, max);
	refreshIncDec(window.PG, max);
}


function decrementPG(max)
{
	if (window.PG == undefined)
		window.PG = 1;

	if (window.PG > 1)
		window.PG--;
	
	displaySinglePane(window.PG, max);
	refreshIncDec(window.PG, max);
}

function displaySinglePane(PG, max)
{
//	alert(PG);
	for (i = 1; i <= max; i++)
	{
//		alert(i);
		var singleElement = document.getElementById('pg'+i);
//		alert(singleElement);
		if (singleElement != undefined)
		{
			if  (i == PG)
			{
				singleElement.style.display = 'block';
//				alert(singleElement.style.display);
			}
			else
			{
				singleElement.style.display = 'none';
//				alert(singleElement.style.display);
			}
		}
	}
}

function refreshIncDec(PG, max)
{
	var PGdec = document.getElementById('PGdec');
	var PGinc = document.getElementById('PGinc');

	if (PG > 1)
		PGdec.style.display = 'block';
	else
		PGdec.style.display = 'none';
		
	if (PG < max)
		PGinc.style.display = 'block';
	else
		PGinc.style.display = 'none';
}

