 
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
defined('FUSION_TEMPLATE') or define('FUSION_TEMPLATE','images/stories/');
if ( ! defined('modRokNavMenuShowItems') )
{
function showItem(&$item, &$menu) {
   
   global $activeid;
   
   $doc = &JFactory::getDocument();
   
    //get columns count for children
    $item->columns = $item->getParameter('fusion_columns',4);
    //get custom image
    $custom_image = $item->getParameter('fusion_customimage');
    if ($custom_image && $custom_image != -1) $item->addLinkClass('image');
    else $item->addLinkClass('bullet');
 
    //not so elegant solution to add subtext
    $item->subtext = $item->getParameter('fusion_item_subtext','');
    if ($item->subtext=='') $item->subtext = false;
    else $item->addLinkClass('subtext');
?>
<li <?php if($item->hasListItemClasses()) : ?>class="<?php echo $item->getListItemClasses()?>"<?php endif;?> <?php if(isset($item->css_id) && $activeid):?>id="<?php echo $item->css_id;?>"<?php endif;?>>
    <?php if ($item->type == 'menuitem') : ?>
        <a <?php if($item->hasLinkClasses()):?>class="<?php echo $item->getLinkClasses();?>"<?php endif;?> <?php if($item->hasLink()):?>href="<?php echo $item->getLink();?>"<?php endif;?> <?php if(isset($item->target)):?>target="<?php echo $item->target;?>"<?php endif;?> <?php if(isset($item->onclick)):?>onclick="<?php echo $item->onclick;?>"<?php endif;?><?php if($item->hasLinkAttribs()):?> <?php echo $item->getLinkAttribs();?><?php endif;?>>
            <span>
            <?php if ($custom_image && $custom_image != -1) :?>
                <img src="<?php echo $doc->baseurl."/images/stories/".$custom_image; ?>" alt="<?php echo $custom_image; ?>" />
            <?php endif; ?>
            <?php echo $item->title;?><br/>
            <?php if (!empty($item->subtext)) :?>
            <em><?php echo $item->subtext; ?></em>    
            <?php endif; ?>  
            </span>
        </a>
    <?php elseif($item->type == 'separator') : ?>
        <span <?php if($item->hasLinkClasses()):?>class="<?php echo $item->getLinkClasses();?> nolink"<?php endif;?>>
            <span>
                <?php if ($custom_image && $custom_image != -1) :?>
                    <img src="<?php echo $doc->baseurl."/images/stories/".$custom_image; ?>" alt="<?php echo $custom_image; ?>" />
                <?php endif; ?>
            <?php echo $item->title;?>
            <?php if (!empty($item->subtext)) :?>
            <em><?php echo $item->subtext; ?></em>    
            <?php endif; ?>
            </span>
        </span>
    <?php endif; ?>
   
    <?php if ($item->hasChildren()): ?>
       

            <ul class="columns columns<?php echo $item->columns  ?>">
                <?php foreach ($item->getChildren() as $child) : ?>        
                    <?php showItem($child, $menu); ?>
                <?php endforeach; ?>
            </ul>

          
    <?php endif; ?> 
</li>   
<?php
}
define('modRokNavMenuShowItems', true);
}
?>
<ul class="menutop level1" <?php if($menu->getParameter('tag_id') != null):?>id="<?php echo $menu->getParameter('tag_id');?>"<?php endif;?>>
    <?php foreach ($menu->getChildren() as $item) :  ?>
        <?php showItem($item, $menu); ?>
    <?php endforeach; ?>
</ul>
 