i=0

status=1

var t

var foto

function indietro()
{
    if (i == 0)
    {
        i = immagini.length - 1;
    }
    else
    {
        i--;
    }
    document.immagine.src = immagini[i];
    if(document.all)
				 	{
						document.all('commento').innerHTML=descrizione[i]
					}
		else if(document.getElementById)
							{
							document.getElementById("commento").innerHTML =descrizione[i]
							}
 					else {
								alert("il tuo browser non supporta questo metodo")
								}
}


function avanti()
{
    if (i < immagini.length - 1)
    {
        i++;
    }
    else
    {
        i=0;
    }
    document.immagine.src = immagini[i];
    if(document.all)
				 	{
						document.all('commento').innerHTML=descrizione[i]
					}
		else if(document.getElementById)
							{
							document.getElementById("commento").innerHTML =descrizione[i]
							}
 					else {
								alert("il tuo browser non supporta questo metodo")
								}
}

function play()
{   avanti();
	t=setTimeout ("play()" ,2000);
}

function stop()
	{ clearTimeout(t);}
	
function aprifoto()
{ foto = immagini[i];
  window.open(foto);}
