Hello, I am trying to implement the JQUERY collapsible menu pluggin and it works fine, however I need to be able to show the menu in its expanded state when you are into the corresponding section.

I am using the Jquery latest library with the following script:

HTML Code:
<script type="text/javascript" src="js/jquery.js"></script>
      <script>
  $(document).ready(function(){
  			// Expand only the active menu, which is determined by the class name
			$("#menu > li > a[@class=expanded] ").find("+ ul").slideToggle("medium");

			// Toggle the selected menu's class and expand or collapse the menu
			$("#menu > li > a").click(function() {
				$(this).toggleClass("expanded").toggleClass("collapsed").find("+ ul").slideToggle("medium");
			});
	
	//this class is not being triggered	
	$("#home > a").addClass('expanded');
  });
  </script>
HTML for the output:

HTML Code:
<ul id="menu">
	<li id="home"><a>Homepage</a>
		<ul>
			<li><a href="#">Link A-A</a>
				<ul>
					<li><a href="#">Link A-A-A</a></li>
					<li><a href="#">Link A-A-B</a></li>
				</ul>
			</li>
			<li><a href="#">Link A-B</a></li>
			<li><a href="#">Link A-C</a></li>
			<li><a href="#">Link A-D</a></li>
		</ul>
	</li>
	<li><a>Section B</a>
		<ul>
			<li><a href="#">Link B-A</a>
				<ul>
					<li><a href="#">Link B-A-A</a></li>
					<li><a href="#">Link B-A-B</a></li>
					<li><a href="#">Link B-A-C</a></li>
				</ul>
			</li>
			<li><a href="#">Link B-B</a>
				<ul>
					<li><a href="#">Link B-B-A</a></li>
					<li><a href="#">Link B-B-B</a></li>
				</ul>
			</li>
			<li><a href="#">Link B-C</a></li>
			<li><a href="#">Link B-D</a></li>
		</ul>
	</li>
	<li><a >Section C</a>
		<ul>
			<li><a href="#">Link C-A</a></li>
			<li><a href="#">Link C-B</a></li>
			<li><a href="#">Link C-C</a></li>
			<li><a href="#">Link C-D</a></li>
		</ul>
	</li>
</ul>
I want the 'collapsible' class to be applied to the first <a> child of #home with the following line:

HTML Code:
$("#home > a").addClass('expanded');
However this is not working and I believe that it is because the expanded class is tied in to a function because I have tested adding a normal 'cosmetic' class and it works.

Would anyone here be able to tell me how I can trigger the expanded state of #home ?

Cheers