So I found this script:
It is pretty nice and it helps me with a static page where all the code is "pre-written".
Problem comes when I try to use the createElement function to create a div and a link that uses the animated collapse code to expand and collapse the recently created div.
Firebug shows all the right code, but the div simply doesn't respond.
PS. When I create the div element I also specify the "animatedcollapse.addDiv('