<?php
function joomlaposition_21() {
    $document = JFactory::getDocument();
    $view = $document->view;
    $isPreview  = $GLOBALS['theme_settings']['is_preview'];
    if (isset($GLOBALS['isModuleContentExists']) && false == $GLOBALS['isModuleContentExists'])
        $GLOBALS['isModuleContentExists'] = $view->containsModules('header-right') ? true : false;
?>
    <?php if ($isPreview || $view->containsModules('header-right')) : ?>

    <?php if ($isPreview && !$view->containsModules('header-right')) : ?>
    <!-- empty::begin -->
    <?php endif; ?>
    <div class="data-control-id-1386037 bd-joomlaposition-21 clearfix" <?php echo buildDataPositionAttr('header-right'); ?>>
        <?php echo $view->position('header-right', 'block%joomlaposition_block_21', '21'); ?>
    </div>
    <?php if ($isPreview && !$view->containsModules('header-right')) : ?>
    <!-- empty::end -->
    <?php endif; ?>
    <?php endif; ?>
<?php
}