
function FotoVars()
{
	FotoVars.Teksten = new Array();
	return( 0 );
}

function Foto( fotoset )
{
	FotoVars.Fotos = new Array();
	var regel = new String();
	var letter = new String();
	var teller = new Number( 0 );
	var current = new Number();

	for ( var i = 0; i < fotoset.length; i++ )
	{
		letter = fotoset.charAt( i );

		if ( /,/.test( letter ) )
		{
			FotoVars.Fotos[teller] = regel;
			regel = "";
			teller++;
		} else { regel = regel + letter; }
	}

	FotoVars.Fotos[teller] = regel;
	current = FotoVars.Fotos[0]; current++;
	FotoVars.dir = top.doel.dir.value;
	FotoVars.foto = FotoVars.Fotos[current];
	FotoVars.tekst = FotoVars.Teksten[FotoVars.Fotos[current]];
	FotoVars.terugurl = "javascript:VolgendeFoto()";
	FotoVars.terugtext = top.doel.volgendefoto.value;
	FotoVars.volgendefoto = top.doel.volgendefoto.value;
	FotoVars.totaal = new Number();
	FotoVars.totaal = ( FotoVars.Fotos.length - 2 );
	FotoVars.current = new Number( current );
	FotoVars.altijdterug = top.doel.terugurl.value;
	FotoVars.altijdterugtext = top.doel.terugtext.value;

	// Zoek uit of het de laatste foto is i.v.m. de terugtekst
	if ( current == ( FotoVars.totaal + 1 ) )
	{
		FotoVars.terugtext = FotoVars.altijdterugtext;
		var url = ( top.doel.terugurl.value + "#" + FotoVars.Fotos[1] );
		FotoVars.terugurl = url;
	}

	top.doel.location.href = "foto.htm";
}

