
jQuery(document).ready(function() {
			jQuery('.shopp_categories').addClass('slide-menu');

			// Set default state of .children to 'hidden'
			jQuery('.slide-menu .children').hide();

			// Hack to wrap plain-text 'Brands' and 'Categories' with additional html tags
			jQuery('.slide-menu').children().each(function() {
			   jQuery(this).contents().filter(function() {
				  return this.nodeType == 3;
			   }).first().wrap('<a class="slide-trigger" href="javascript:;"></a>');
			});

			// Assign click-event function to 'triggers'
			jQuery('.slide-menu .slide-trigger').click(function() {
			   jQuery(this).next().toggle(jQuery(this).next().children().length * 20);
			   return false;
			});
		 });

/*
jQuery(document).ready(function() {
			jQuery(".shopp_categories").addClass("slide-menu");

			// Set default state of .children to 'hidden'
			jQuery('.slide-menu .children').hide();

			// Assign click-event function to 'triggers'
			jQuery('.slide-menu .shoppnav a').click(function() {

			   // reference to this trigger
			   var menu_trigger = jQuery(this);

			   // find the corresponding ul.children for this trigger
			   // menu_trigger.parent() goes back up the chain to the <p> tag
			   // menu_trigger.parent().next() selects the parent <p> tag's sibling, which would be: ul.children
			   var menu_options = menu_trigger.parent().next();

			   // number of menu options contained within the ul.children list
			   var num_options = menu_options.children().length;

			   
			   //milliseconds it takes for sliding animation to complete
			   //change the '20' to something higher to slow down the animation and vice versa.
			   //we use the num_options as a multiplier because if we use a flat number for duration e.g.

			   //var duration = 200

			   //then long menus will open really quickly while shorter menus
			   //will open very slowly. Try it and see for yourself.
			   //
			   var duration = num_options * 20;

			   // bring it all together
			   menu_options.toggle(duration);

			   // return false so the page doesn't load the href value of the trigger <a href="...">
			   return false;
			})
		 });
*/

