Javascript only runs when logged in as admin I created a test site. I put the JS into the template.php:

drupal_add_js('jQuery(document).ready(function(){jQuery(".foomo").accordion({ collapsible: true, active: false, animated: true});});', 'inline');


File permissions are set as described here.

If I load the website as 'admin' the accordion is collapsed as I want. 

But why doesn't open or close the accordion for any other user?
I switched to the views_accordion module, which works perfect:
embedded views wrapped by views_accordion