Una possibile soluzione: http://forum.html.it/forum/showthrea...80#post7675786

Dovrai solo adattarlo...