codice:
var newsrc;
function photo_grande(){
document.write("<img src=\""+folder+prefisso+"0"+suf_big+ext+"\" id=\"grande\" border=\"0\">");
}
function photo_gallery(){
document.write("<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\">");
for (i=1;i<=nfoto;i++){
if (i%ncol==1) document.write("<tr>");
document.write("<td><a href=\"#a\" onclick=\"newsrc='"+folder+prefisso+(i-1)+suf_big+ext+"';$('#grande').fadeOut('slow',change_src);\">");
document.write("<img src=\""+folder+prefisso+(i-1)+suf_small+ext+"\" border=\"0\"></a></td>");
if (i%ncol==0) document.write("</tr>");
}
document.write("</table>");
}
function change_src(){
document.getElementById('grande').src=newsrc;
$('#grande').fadeIn("slow");
}
E' un po' brutale, perchè non c'è nulla che contrlli che l'immagine nuova sia stata già caricata, ma dovrebbe funzionare!