JQuery accordion works in admin but not for anonymous D7.18
I have a similar problem to another question but the solution did not work for me.
I have added my jquery accordion file  (accordion.js) to the subtheme.info file and a file called  accordion.js to the subtheme folder.
The accordion.js code is

(function($) {
Drupal.behaviors.accordion = {
attach: function (context, settings) {
   //code starts
  $("#accordion").accordion({
  autoHeight: false
  }
  );
   //code ends
  }
 };
 })(jQuery);


The accordion effect works correctly when logged in as admin but does not when logged out. 
Firebug shows  for the anonymous user but none of the other classes that are shown when logged in as admin.
I am using the Omega Theme.
I am completely stuck as to how to resolve this
jQuery UI is bundled with core in D7 ( see /misc/ui ).
To add jQuery Accordion JS you can just go:

e.g, in template.php

function THEMENAME_preprocess_html(&amp;$variables) {
  drupal_add_library('system', 'ui');
  drupal_add_library('system', 'ui.accordion');
}


After that, clear all caches and check the javascript files have been added in the HTML source of the page as anon.