<?php
// $HOME_Link 		= generate_link($HOME);
// $HOME_caption = print_caption($HOME);
$homeicon = '';
//DEBUG($myCMD['Data']['HomeButton']);
$MAIN_TOPIC = get_main_topic(); 
echo '<nav id="c279f6caef3-slnc" class="fixed tb-show">'.PHP_EOL;
echo '		<ul id="c279f6caef3-sln" class="hidden">';
for ( $x=0;$x < $MAIN_TOPIC['count'] ; $x++ )
	{
	if ($MAIN_TOPIC[$x]['GroupPage'] == "True")
		continue;
	$TOPIC = get_topic($MAIN_TOPIC[$x]['id']);
	if ($MAIN_TOPIC[$x]['id']==$MAIN_TOPIC_ACTIVE) 
		{
		echo '<li class="mtasel"><a class="mtasel" '.generate_link($MAIN_TOPIC[$x]).'>'.PHP_EOL;
		} 
	else 
		{
		echo '<li><a '.generate_link($MAIN_TOPIC[$x]).'>';
		}
	if ($TOPIC['count']==0) 
		{ 
		echo print_caption($MAIN_TOPIC[$x]).'</a></li>'.PHP_EOL;
		}
	else 
		{			
		echo print_caption($MAIN_TOPIC[$x]).'</a>'.PHP_EOL;
		echo '<ul>';
		echo '<li class="mtclone"><a '.generate_link($MAIN_TOPIC[$x]).'>'.print_caption($MAIN_TOPIC[$x]).'</a>'.PHP_EOL;
		}
	if ($TOPIC['count'] != 0) 
		{		
		for ($x1=0;$x1<$TOPIC['count'];$x1++) 
			{
			if ($TOPIC[$x1]['GroupPage'] == "True")
				continue;
			$SUB_TOPIC = get_sub_topic($TOPIC[$x1]['id']);					
			if ($SUB_TOPIC['count'] != 0) 
				{
				if ($TOPIC[$x1]['id']==$TOPIC_ACTIVE) 
					{
					echo '<li class="mtasel"><a class="mtasel"  '.generate_link($TOPIC[$x1]).'>'.print_caption($TOPIC[$x1]).'</a></li>'.PHP_EOL;
					}
				else 
					{
					echo '<li><a '.generate_link($TOPIC[$x1]).'>'.print_caption($TOPIC[$x1]).'</a></li>'.PHP_EOL;
					}					
for ($x2=0;$x2<$SUB_TOPIC['count'];$x2++) 
					{
					if ($SUB_TOPIC[$x2]['GroupPage'] == "True")
						continue;					
					if ($SUB_TOPIC[$x2]['id']==$SUB_TOPIC_ACTIVE) 
						{
						echo '<li class="mtasel"><a class="mtasel" '.generate_link($SUB_TOPIC[$x2]).'>'.print_caption($SUB_TOPIC[$x2]).'</a></li>'.PHP_EOL;
						} 
					else 
						{
						echo '<li><a '.generate_link($SUB_TOPIC[$x2]).'>'.print_caption($SUB_TOPIC[$x2]).'</a></li>'.PHP_EOL;
						}
					}
}
			else 
				{
				if ($TOPIC[$x1]['id']==$TOPIC_ACTIVE) 
					{
					echo '<li><a class="mtasel"  '.generate_link($TOPIC[$x1]).'>'.print_caption($TOPIC[$x1]).'</a></li>'.PHP_EOL;
					}
				else 
					{
					echo '<li><a '.generate_link($TOPIC[$x1]).'>'.print_caption($TOPIC[$x1]).'</a></li>'.PHP_EOL;
					}
				}
			}
		echo '</ul></li>';
		}	
	}
echo '		</ul>'.PHP_EOL;
echo '</nav>	<!-- Close id="c279f6caef3" -->'.PHP_EOL;
echo '<div id="c279f6caef3-offset" class="tb-show"></div>';
echo '<div class="clearer"></div>';
?>
<div class="clearer"></div>
