var maxHeight = 650;


$(function(){
	
	$('.sub_menu').jScrollPane();
		
    $(".dropdown > li").mouseover(function() {
    	 
         var $container = $(this),
         $list = $container.find("ul"),
         $anchor = $container.find("a"),
         height = $list.height() * 1.1,       // make sure there is enough room at the bottom
         multiplier = height / maxHeight ;     // needs to move faster if list is taller
        
        // need to save height here so it can revert on mouseout            
        $container.data("origHeight", $container.height());
        
        // so it can retain it's rollover color all the while the dropdown is open
        $anchor.addClass("hover");
        
        // make sure dropdown appears directly below parent list item    
        
		$list
            .show().height(450)
            .css({
                "overflow-y": "auto" , position: "relative"
            });

		$('.jspContainer').css({display: "block"})
        
        // don't do any animation if list shorter than max
        
        
    });
    $('.sub_menu').mouseleave(function() {
		
		
		$list = $(".dropdown > li").find("ul")
	
	$list. height(30).	 css({
                "overflow-y": "auto" , position: "absolute"
            });
	$('.jspContainer').hide();
	

		
  	})
    
    
});

