Problem with collapsable menu

Problem with collapsable menu

Hi,

I've got a UL which displays some categories.
I use this script to toggle subcategories on/off


  1. $('.wpsc_categories li').click(
  2.         function() {
  3.            
  4.             var selectedItem = $(this);
  5.             var submenu = $(this).find('ul');
  6.            
  7.            
  8.            
  9.             if (submenu.is(':visible'))
  10.             {
  11.                 selectedItem.css({"background-image":"url(http://www.jendautos.nl/wp-content/uploads/wpsc/themes/default/images/ico_open.png)"});
  12.                 selectedItem.css({"background-repeat":"no-repeat"});
  13.                 //submenu.slideUp('normal');
  14.                
  15.            
  16.                 submenu.hide();
  17.                
  18.             }
  19.             else if (submenu.is(':hidden'))
  20.             {
  21.                 selectedItem.css({"background-image":"url(http://www.jendautos.nl/wp-content/uploads/wpsc/themes/default/images/ico_close.png)"});
  22.                 selectedItem.css({"background-repeat":"no-repeat"});
  23.                 //submenu.slideDown('normal');
  24.                 submenu.show();
  25.             }
  26.            
  27.            
  28.         }
  29.        
  30.        
  31.     );

Problem is, that when I click on a link inside the subcategories, the submenu closes again.
It should ONLY close when you click on the "-" icon...
Anyone knows how to adjust the script, so that the submenu stays open after a click on a link?

Example can be found here: http://www.jendautos.nl/
(left sidebar)