var figuur;
var nav;
var aantal;
var foto;

function initialiseer()
{
	foto = 0;
	figuur = new getObj('figuur');
	nav = new getObj('nav');
	aantal = arrFigNames.length;

	toonFoto(foto);
}

function eerste()
{
	foto = 0;
	toonFoto(foto);
}

function vorige()
{
	if (foto == 0) foto = aantal;
	foto--;
	toonFoto(foto);
}

function volgende()
{
	if (foto == aantal - 1) foto = -1;
	foto++;
	toonFoto(foto);
}

function laatste()
{
	foto = aantal - 1;
	toonFoto(foto);
}

function toonFoto(i)
{
	figuur.obj.src = arrFigNames[i];
	figuur.obj.alt = '[Name: ' + arrFigNames[i] + '][Size: ' + arrFigSizes[i] + ' kilobytez]';
	figuur.obj.title = '[Name: ' + arrFigNames[i] + '][Size: ' + arrFigSizes[i] + ' kilobytez]';

	nav.obj.innerHTML = 'Foto <b>' + (i + 1) + '</b> van <b>' + aantal + '</b> in totaal';
}

function getObj(name)
{
	if (document.getElementById)
		this.obj = document.getElementById(name);
	else if (document.all)
		this.obj = document.all[name];
	else if (document.layers)
		this.obj = document.layers[name];
}
