Leggi anche questo thread:

http://forum.html.it/forum/showthrea...4&pagenumber=1

soprattutto la soluzione a pagina 2.