jQuery(document).ready(function($) {
    // $() will work as an alias for jQuery() inside of this function
	var sideNavs = $('#sidebar ul li');
	sideNavs.each(function(i, el){
		if($(el).find('ul') && $(el).hasClass('current_page_item')!= true && $(el).hasClass('current_page_ancestor') != true){
			var natHeight = $('ul', this).height();
			$('ul', this).css('height', 0);
			$('ul', this).css('overflow', 'hidden');
			$(el).mouseenter(function(){
				$('ul', this).animate({
					'height': natHeight
				}, { queue:false, duration: 300 });
			}).
			mouseleave(function(){
				$('ul', this).animate({
					'height': 0
				}, { queue:false, duration: 300 });
			});
		}
	});
});

