function openalbum(album)
{
	f = document.navigatie;
	f.pagina.value = "thumbnails";
	f.album.value = album;
	f.submit();
}

function layout(l)
{
	f = document.navigatie;
	f.layout.value = l;
	f.pagina.value = "albums";
	f.album.value = "";
	f.start.value = 0;
	document.navigatie.submit();
}

function albums()
{
	f = document.navigatie;
	f.pagina.value = "albums";
	f.album.value = "";
	f.start.value = 0;
	f.submit();
}

function terug()
{
	f = document.navigatie;
	f.pagina.value = "thumbnails";
	f.foto.value = "";
	f.submit();
}

function fotobladeren(foto)
{
	f = document.navigatie;
	f.foto.value = parseInt(f.foto.value) + foto;
	f.submit();
}

function fotovenster(foto,width,height)
{
	win = window.open("","foto","status=no,scrollbars=no,location=no,width=" + width + ",height=" + height);
	win.document.write('<html><head><title>foto</title><style>body{margin:0};img{cursor:pointer}</style></head>')
	win.document.write('<body onclick="window.close()"><img src="' + foto + '" title="klik om te sluiten" /></body></html>')
}

function thumbnailbladeren(pagina)
{
	f = document.navigatie;
	f.start.value = pagina;
	f.submit();
}

function openfoto(foto)
{
	f = document.navigatie;
	f.pagina.value = "fotos";
	f.foto.value = foto;
	f.submit();
}

function slideshow()
{
	f = document.navigatie;
	f.paginaterug.value = f.pagina.value;
	f.pagina.value = "slideshow";
	f.submit();
}

function sluitslideshow()
{
	f = document.navigatie;
	f.pagina.value = f.paginaterug.value;
	f.submit();
}

function startshow()
{
	if (fototeller > aantalfotos-1) fototeller = 0;
	if (preloadteller > aantalfotos-1) preloadteller = 0;
	fototeller++;

	document.getElementById("slideshowfoto").src = img.src;
	img.src = fotos[preloadteller++];
	
	document.getElementById("huidigefoto").innerHTML = "Foto " + fototeller + " van " + aantalfotos + " | Snelheid: " + snelheid/1000 + " seconden";

	runshow = setTimeout("startshow()",snelheid);
}

function stopshow()
{
	clearTimeout(runshow);
	if (runshow) document.getElementById("huidigefoto").innerHTML += " | pauze..."
	runshow = "";
}

function togglestartstop()
{
	if (runshow) stopshow();
	else startshow();
}

function verandersnelheid(s)
{
	stopshow();
	snelheid = s*1000;
	runshow = setTimeout("startshow()",1);
}

function menu(id,mode)
{
	modi = new Array("hidden","visible");
	document.getElementById(id).style.visibility = modi[mode];
}

