// JavaScript Document
var index = 0;
var pictures = new Array();
function loadportrait(p)
{
	document.getElementById('portrait').style.backgroundImage = 'url(pic/'+p+')';
}
function first()
{
	if ( pictures.length > 0 )
	{
		index = 0;
		return pictures[0];
	}
	else return 'bpix.gif';
}
function previous()
{
	if ( pictures.length > 0 )
		if ( index > 0 )
		{
			index = index - 1;
			return pictures[index];
		}
		else return pictures[0];
	else return 'bpix.gif';
}
function next()
{
	if ( pictures.length > 0 )
		if ( index < pictures.length - 1 )
		{
			index = index + 1;
			return pictures[index];
		}
		else return pictures[pictures.length - 1];
	else return 'bpix.gif';
}
function last()
{
	if ( pictures.length > 0 )
	{
		index = pictures.length - 1;
		return pictures[index];
	}
	else return 'bpix.gif';
}
