Prototype - toggle function doesn't complete


I’m trying to create a list menu. When the user clicks on the list
header the other elements should appear. My function looks like this:

My list menu looks like this:

  • <%= link_to "Dam", :action => category=('female') %>

  • <%= link_to "Accessoarer", :action => category=('female_accessories') %>

  • etc...

The function starts but when the page has loaded it stops.

The function works when I try this:

Event.observe(window, ‘load’, function() {

So I think the problem is in my Event.observe.

Any tips would be greatly appreciated!

// Anders