<?php
function top_menu_3() {
    $view = JFactory::getDocument()->view;
    $modulesContains = $view->containsModules('footermenu');
    $isPreview  = $GLOBALS['theme_settings']['is_preview'];
    if (isset($GLOBALS['isModuleContentExists']) && false == $GLOBALS['isModuleContentExists'])
        $GLOBALS['isModuleContentExists'] = $view->containsModules('footermenu') ? true : false;
    ?>
    <?php if ($isPreview || $modulesContains) : ?>
        
        <div class=" bd-topmenu-3" data-responsive-menu="true">
            <?php if ($view->containsModules('footermenu')) : ?>
            
                <div class=" bd-responsivemenu-4 collapse-button">
    <div class="bd-container-inner">
        <div class="bd-menuitem-40 ">
            <a  data-toggle="collapse"
                data-target=".bd-topmenu-3 .collapse-button + .navbar-collapse"
                href="#" onclick="return false;">
                    <span></span>
            </a>
        </div>
    </div>
</div>
                <div class="navbar-collapse collapse">
                <div class=" bd-horizontalmenu-5 clearfix">
                    <div class="bd-container-inner">
                        <?php echo $view->position('footermenu', '', '3', 'topmenu'); ?>
                    </div>
                </div>
            
                </div>
            <?php else: ?>
                Please add a menu module in the 'footermenu' position
            <?php endif; ?>
        </div>
        
    <?php endif; ?>
<?php
}