<?php

if (!defined('IN_CONTEXT')) die('access violation error!');

if (!function_exists('showMenu')) {
	
    function showMenu(&$menu_tree, $level = 0) {
        foreach ($menu_tree as $menu) {
    ?>
    <li>
    <?php
            if (sizeof($menu->slaves['MenuItem']) > 0) {
                $level++;
    ?>
    <a href="<?php if($menu->mi_category == 'outer_url') echo $menu->link; else echo 'index.php?'.$menu->link; ?>">
    <?php echo $menu->name; ?></a>
    <?php
            echo '<ul>'."\n";
        //if ($level == 1) {
            //echo '<ul class="drop_level">'."\n";
        //} else {
            //echo '<ul class="flyout">'."\n";
        //}
    ?>
        <?php showMenu($menu->slaves['MenuItem'], $level); ?>
    </ul>
    <?php
                $level--;
            } else {
    ?>
    <a href="<?php if($menu->mi_category == 'outer_url') echo $menu->link; else echo 'index.php?'.$menu->link; ?>">
    <?php echo $menu->name; ?></a>
    <?php
            }
    ?>
    </li>
    <?php
        }
		
    }
	
}

$id_seed = Toolkit::randomStr();
?>

        	<ul id="nav_<?php echo $id_seed; ?>" class="navigation">
			<?php showMenu($menus); ?>
            </ul>
			
<script type="text/javascript" language="javascript">
<!--
	$(function() {
		$("#nav_<?php echo $id_seed; ?>").droppy();
		
	
	$(".navigation li:first").css("background-image",'none');
  	});
//-->
</script>
