Grazie, fasibia! Seguirò il tuo consiglio.
E grazie soprattutto a Sgnafurz che ha postato il codice