function mostrarThumbs(codf, indice) {
	foto_anterior = false;
	foto_proxima = false;
	link_anterior = false;
	link_proxima = false;
	html_anterior = " ";
	html_proxima = " ";
	indicecodf = getIndiceArray(codf, listafotos);
	if (indice == -1) {
		if (lado == 1) {
			fotoant = indicecodf;
			fotoprox = indicecodf + 1;
		}
		else {
			fotoant = indicecodf - 1;
			fotoprox = indicecodf;
		}
	}
	else {
		fotoant = indice;
		fotoprox = indice + 1;
	}
	html_anterior = "<a href=\"colecao_fotografia.kmf?cod=" + listafotos[fotoant] + "&amp;lado=1\" title=\"\"><img src=\"" + urlfotos + listafotosthumb[fotoant] + "\" alt=\"Equivalente textual do conteúdo da imagem\" /></a>\n";
	if (listafotos[fotoprox])
		html_proxima = "<a href=\"colecao_fotografia.kmf?cod=" + listafotos[fotoprox] + "&amp;lado=2\" title=\"\"><img src=\"" + urlfotos + listafotosthumb[fotoprox] + "\" alt=\"Equivalente textual do conteúdo da imagem\" /></a>\n";
	if (listafotos[fotoant - 1])
		html_anterior += "<a href=\"javascript:mostrarThumbs('" + indicecodf + "', " + (fotoant - 2) + ")\" title=\"Página anterior\" id=\"anterior\">Anterior</a>\n";
	if (listafotos[fotoprox + 1])
		html_proxima += "<a href=\"javascript:mostrarThumbs('" + indicecodf + "', " + (fotoprox + 1) + ")\" title=\"Próxima página\" id=\"proxima\">Próxima</a>\n";
	document.getElementById("li-anterior").innerHTML = html_anterior;
	document.getElementById("li-proxima").innerHTML = html_proxima;
}

function getIndiceArray(value, lista) {
	var i;
	for (i = 0; i < lista.length; i++) {
		if (lista[i] === value) {
			return i;
		}
	}
	return false;
}