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

    <?php if ($isPreview && !$view->containsModules('top-mod-right')) : ?>
    <!-- empty::begin -->
    <?php endif; ?>
    <div class=" bd-joomlaposition-23 clearfix" <?php echo buildDataPositionAttr('top-mod-right'); ?>>
        <?php echo $view->position('top-mod-right', 'block%joomlaposition_block_23', '23'); ?>
    </div>
    <?php if ($isPreview && !$view->containsModules('top-mod-right')) : ?>
    <!-- empty::end -->
    <?php endif; ?>
    <?php endif; ?>
<?php
}