var curIndex = 0;
var nextIndex = 1;
var prevIndex = Portfolio.length -1
var ThePort;

//Added this to check for compatibility with Netscape
function Initialize(Port)
{
	if (document.getElementById)
	{
		ThePort = document.getElementById(Port).style;
	}
	else if (document.all)
	{
	    ThePort = document.all(Port).style;
	}
	else if (document.layers)
	{
	    ThePort = document.layers[Port];
	}
}


if (document.all || document.getElementById)
{
	visible = 'visible';
	hidden = 'hidden';
}
else	// if (document.layers)
{
	visible = 'show';
	hidden = 'hide';
}

function showNext()
{
	Initialize(Portfolio[curIndex]);
	ThePort.visibility = hidden;
	Initialize(Portfolio[nextIndex]);
	ThePort.visibility = visible;

	prevIndex = curIndex;
	curIndex++;
	if (curIndex == Portfolio.length)
	{
		curIndex = 0;
		nextIndex = 1;
		prevIndex = Portfolio.length-1;
	}
	else if (curIndex == Portfolio.length-1)
	{
		nextIndex = 0;
	}
	else
	{
		nextIndex=curIndex+1;
	}
}

function showPrev()
{
	Initialize(Portfolio[curIndex]);
	ThePort.visibility = hidden;
	Initialize(Portfolio[prevIndex]);
	ThePort.visibility = visible;

	nextIndex = curIndex;
	curIndex--;
	if (curIndex == -1)
	{
		curIndex = Portfolio.length-1;
		nextIndex = 0;
		prevIndex = curIndex-1;
	}
	else if (curIndex == 0)
	{
		prevIndex = Portfolio.length-1;
	}
	else
	{
		prevIndex=curIndex-1;
	}
}