// JavaScript Document

function contaNext(numFotos) {
var numTotal = numFotos;
var numAtual = parseInt(document.cnt.contador.value);
var numNext = numAtual + 1;
if(numNext > numTotal) {
numNext = 1;
}
document.cnt.contador.value = numNext+ "/"+ numFotos;
if(document.getElementById("legendafoto")) {
document.getElementById("legendafoto").innerHTML = legenda[numNext];
}
}

function contaPrev(numFotos) {
var numTotal = numFotos;
var numAtual = parseInt(document.cnt.contador.value);
var numPrev = numAtual - 1;
if(numPrev < 1) {
numPrev = numFotos;	
}

document.cnt.contador.value = numPrev+"/"+numFotos;
if(document.getElementById("legendafoto")) {
document.getElementById("legendafoto").innerHTML = legenda[numPrev];
}
}
