Forum:Javascript loading too early

Hi everybody, I'm trying to create a template, in which every user can choose what to see by adding a simple variable declaration in his/her own monobook.js

You can see the javascript code here (between comments), and the template is here (you can't see anything because every tag div has display:none until javascript decides which div to show)

I tried this script locally on my computer, on a simple html page, and if the script were loaded after the page, there was no problem, and this append only if the tag was added at the bottom of. Here instead the script is loaded before the rest of the page, and obviously can't substitute "display:none" with something else, if it doesn't still exist.

What can I do to make this template work automatically, ie without using any input from the user?

Thanks in advance, and I hope my translation is clear. --MFH(talk) 01:19, 24 January 2009 (UTC)