var Common = {
    init:function(){
        var self = this;
        
        self.initMenu();
    },
    
    initMenu: function(){        
        var self = this;
        $(".menu-nav>li").hover(
           function(){
             $(this).addClass('hover');            
             if($(this).children('ul').length == 0) return; 
             $(this).children('ul').addClass('inuse').hide().fadeIn('fast');
           },
           
           function() { 
    					$(this).removeClass('hover');
						  if($(this).children('ul').length == 0) return;
              $(this).children('ul').removeClass('inuse');
              setTimeout(function(){
                $('.menu-nav>li>ul').each( function() {
                  if(!$(this).hasClass('inuse')) $(this).stop(true, true).fadeOut('normal');
            		});     
                },125);
              self.doHiding(); 
    			 }
        );        
    }
};

$(function(){
    window.Common.init();
});

