$(function(){
    topMenu.bindClose();
});
var topMenu = {    
    
    changeElement:function (elementId) {
        
        this.resetMenu();
        
        $(elementId).show();
        
    },
    
    resetMenu:function () {
        
        $('.nav').hide();
        
        this.hideCurrent();
        
    },

    closeMenu:function (elementId) {
        
        toggleSlide(elementId);
        
        this.showCurrent();      
        
    },
    
    showCurrent:function () {
        
        $('.menu li a.current').addClass('of');
        
        $('.menu li a.of').removeClass('current');  
        
    },
    
    hideCurrent:function () {
        
        $('.menu li a.of').addClass('current');
        
        $('.menu li a.current').removeClass('of');
    },
    
    bindClose: function() {
        var self = this;
        $('.nav').hover('', function(){            
            self.closeMenu($(this).attr('id'));            
        });
    }
   
}
