var utils = {
    click: function(selector) {
        var elem = document.querySelector(selector);
        elem && elem.click && elem.click();
    }
};

var actions = {
    resetMega: function() {
        jQuery('.mega-wrap .active, .primary-nav .active').removeClass('active');
        jQuery('.mega-wrap .mega-menu.left').removeClass('left');
        jQuery('.mega-wrap .mega-menu.right').removeClass('right');
    },
    openProducts: function() {
        utils.click('#nav-products > a');
    },
    openTools: function() {
        utils.click('#nav-tools > a');
    },
    openSecurity: function() {
        utils.click('#nav-security > a');
    },
    openCommunity: function() {
        utils.click('#nav-community > a');
    },
    trySearch: function() {
        var searchQuery = 'Red Hat Satellite',
            $searchForm = jQuery('#homePageSearchForm'),
            $searchInput = jQuery('#search-query');
        $searchInput.attr('placeholder', '');
        $searchForm.attr('action', $searchForm.attr('action') + '?tour=true');
        $searchInput.typed({
            strings: [searchQuery],
            typeSpeed: 42,
            attr: 'value',
            showCursor: false,
            callback: function() {
                setTimeout(function() {
                    $searchForm.submit();
                }, 400);
            }
        });
    }
};

@@ -202,215 +202,355 @@
     
-jQuery('.mega-wrap .active, .primary-nav .active').removeClass('active');%0A        jQuery('.mega-wrap .mega-menu.left').removeClass('left');%0A        jQuery('.mega-wrap .mega-menu.right').removeClass('right');
+// Determine if it is active%0A        var isActive = document.querySelector('.mega.active');%0A        if(isActive)%7B%0A            // It is active... Find the menu that is open and then close it.%0A            var activeMenu = document.querySelector('.primary-nav .active %3E a');%0A            activeMenu && activeMenu.click && activeMenu.click();%0A        %7D
 %0A   

switch to a more sane mega reset function