Codice PHP:
function addbookmark(){
if (
document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

{
altx = new Image();
altx.src "dati/0.gif";

alt0 = new Image();
alt0.src "dati/b2.gif";

alt1 = new Image();
alt1.src "dati/b2c1.gif";

alt2 = new Image();
alt2.src "dati/b2c2.gif";

alt3 = new Image();
alt3.src "dati/b2c3.gif";

alt4 = new Image();
alt4.src "dati/b2c4.gif";

alt5 = new Image();
alt5.src "dati/b2c5.gif";

alt6 = new Image();
alt6.src "dati/b2c6.gif";

alt8 = new Image();
alt8.src "dati/b2c8.gif";

alt9 = new Image();
alt9.src "dati/b2c9.gif";

graphic1= new Image();
graphic1.src "dati/c1.gif";
graphic1on = new Image();
graphic1on.src "dati/c1b.gif";

graphic2= new Image();
graphic2.src "dati/c2.gif";
graphic2on = new Image();
graphic2on.src "dati/c2b.gif";

graphic3= new Image();
graphic3.src "dati/c3.gif";
graphic3on = new Image();
graphic3on.src "dati/c3b.gif";

graphic4= new Image();
graphic4.src "dati/c4.gif";
graphic4on = new Image();
graphic4on.src "dati/c4b.gif";

graphic5= new Image();
graphic5.src "dati/c5.gif";
graphic5on = new Image();
graphic5on.src "dati/c5b.gif";

graphic6= new Image();
graphic6.src "dati/c6.gif";
graphic6on = new Image();
graphic6on.src "dati/c6b.gif";

graphic8= new Image();
graphic8.src "dati/c8.gif";
graphic8on = new Image();
graphic8on.src "dati/c8b.gif";

graphic9= new Image();
graphic9.src "dati/c9.gif";
graphic9on = new Image();
graphic9on.src "dati/c9b.gif";

graphica2= new Image();
graphica2.src "dati/a2.gif";
graphica2on = new Image();
graphica2on.src "dati/a2b.gif";

graphica3= new Image();
graphica3.src "dati/a3.gif";
graphica3on = new Image();
graphica3on.src "dati/a3b.gif";

graphica4= new Image();
graphica4.src "dati/a4.gif";
graphica4on = new Image();
graphica4on.src "dati/a4b.gif";

graphica5= new Image();
graphica5.src "dati/a5.gif";
graphica5on = new Image();
graphica5on.src "dati/a5b.gif";

graphica6= new Image();
graphica6.src "dati/a6.gif";
graphica6on = new Image();
graphica6on.src "dati/a6b.gif";

}
function 
imageChange(imageID,imageName,imageID2,imageName2) {


{
document.images[imageID].src = eval(imageName ".src");
document.images[imageID2].src = eval(imageName2 ".src");
}


È possibile semplificare questo script con un ciclo?
Potete anche camabiare il nome delle immagini e/o l'uso dei comandi se vi fa più comodo.
Questo script fa lo swap delle gif al passaggio del mouse (effetto tasto)...