$(document).ready(function(){
   	$('#membersidenav>li>ul').hide();
	$("#membersidenav>li").hoverIntent({
		sensitivity: 3, 
		interval: 100, 
		over: makeTall_horizontal, 
		timeout: 500, 
		out: makeShort_horizontal
	});
}); // close document.ready
 
function makeTall(){
        // check that the menu is not currently animated
        if ($('#membersidenav ul:animated').size() == 0) {
            // create a reference to the active element (this)
            // so we don't have to keep creating a jQuery object
            $heading = $(this);
            // create a reference to visible sibling elements
            // so we don't have to keep creating a jQuery object
            $expandedSiblings = $heading.siblings().find('ul:visible');
            if ($expandedSiblings.size() > 0) {
                $expandedSiblings.slideUp(400, function(){
                    $heading.find('ul').slideDown(400);
                });
            }
            else {
                $heading.find('ul').slideDown(400);
            }
		}
}

function makeTall_horizontal(){
        // check that the menu is not currently animated
        if ($('#membersidenav ul:animated').size() == 0) {
            // create a reference to the active element (this)
            // so we don't have to keep creating a jQuery object
            $heading = $(this);
            // create a reference to visible sibling elements
            // so we don't have to keep creating a jQuery object
            $expandedSiblings = $heading.siblings().find('ul:visible');
            if ($expandedSiblings.size() > 0) {
                $expandedSiblings.fadeOut(200, function(){
                    $heading.find('ul').show();
                });
            }
            else {
                $heading.find('ul').show();
            }
	}
}

function makeShort(){
}

function makeShort_horizontal(){
        // check that the menu is not currently animated
        if ($('#membersidenav ul:animated').size() == 0) {
            $submenu = $(this).find('ul:visible');
            if ($submenu.size() > 0) {
                $submenu.fadeOut(200);            
	   }
        }
}