document.on('click', function(e) {
var clickOnSubmenu = ($(e.target).parents('.sub-menu').length) ? true : false;
if (!clickOnSubmenu) {
$('li.level-top > a.active')
.next()
.stop()
.animate({top: -height}, SPEED_HIDE, function() {
$(this)
.hide()
.prev()
.removeClass(ACTIVE_CLASS);
});
}
})