Aggiornamento: ho trovato il JavaScript che mi serviva in questo tutorial:

http://javascript.html.it/articoli/l...-javascript/2/

Salutoni,
goat