Prova a fare cos (sostituisci la funzione e l'array):

var numberslide=new Array() numberslide[0]=["IMAGE-1.jpg", "", "Descrizione 1!"] numberslide[1]=["IMAGE-2.jpg", "", "Descrizione 2!"] numberslide[2]=["IMAGE-3.jpg", "", "Descrizione 3!"] function changeslides(which) { var imghtml="" currentindex=(which=="initial")? 0 : parseInt(which); var mode=(which=="initial")? "initial" : ""; var which=(mode=="initial")? numberslide[0] : numberslide[which]; if (which[1]!="") { imghtml='<a href="'+which[1]+'" target="'+mylinktarget+'">'; } imghtml+='<img src="'+which[0]+'" border="'+imgborderwidth+'">'; if (which[2]!="") { imghtml+='<p id="descrizione">'+which[2]+'</p>'; } if (which[1]!="") { imghtml+='</a>'; } if (mode=="initial") { document.write('<div>'+imghtml+'</div>') } else { document.getElementById("imagecontainer").innerHTML=imghtml changecolors() } }