So I just got myself a reason to check out the book about javascript that I bought a while ago...

I guess I'll get back to this if I can't figure it out by myself.

Thanks for your help.