// gestió de carga imatges
// David Gironella 23/5/06
// 6tems.com

var imatge = new Array();
var posactual=0; // començem a 0
function CanviaFoto(id,foto)
{
	document.getElementById(id).src=foto;
}

function AddImatge(foto,pos)
{
	imatge[pos] = foto;
}

function IncFoto(id,idfoto)
{
	posactual++;
	if(posactual>=imatge.length) posactual=0;
	CanviaFoto(idfoto,imatge[posactual]);
	Contador(id);
}

function DecFoto(id,idfoto)
{
	posactual--;
	if(posactual<0) posactual=imatge.length-1;
	CanviaFoto(idfoto,imatge[posactual]);
	Contador(id);
}

function Contador(id)
{
	document.getElementById(id).innerHTML = (posactual+1)+" / "+imatge.length;
}