<?php

//	(array_key_exists('action', $_GET) && $_GET['action']<>'' && in_array($_GET['action'], $actions) && session_is_registered('mobile_logged_in')) ? $action = $_GET['action'] : $action = '';
//	(array_key_exists('interpret', $_GET) && $_GET['interpret']<>'' && session_is_registered('mobile_logged_in')) ? $interpret = $_GET['interpret'] : $interpret = '';
//	(array_key_exists('nazov', $_GET) && $_GET['nazov']<>'' && session_is_registered('mobile_logged_in')) ? $nazov = $_GET['nazov'] : $nazov = '';
//	(array_key_exists('type', $_GET) && $_GET['type']<>'' && in_array($_GET['type'], $types) && session_is_registered('mobile_logged_in')) ? $type = $_GET['type'] : $type = '';
	
	$action = (array_key_exists('action', $_GET) && $_GET['action']<>'' && in_array($_GET['action'], $actions)) ? $_GET['action'] : '';
	$interpret = (array_key_exists('interpret', $_GET) && $_GET['interpret']<>'') ? $_GET['interpret'] : '';
	$nazov = (array_key_exists('nazov', $_GET) && $_GET['nazov']<>'') ? $_GET['nazov'] : '';
	$type = (array_key_exists('type', $_GET) && $_GET['type']<>'' && in_array($_GET['type'], $types)) ? $_GET['type'] : '';
	
	if(isset($_SESSION['mobile_logged_in']))
	{
	
?>
  <div id="menu03">
    <div id="menu01_head">:: hľadaj</div>
    <div id="menu01_item">
	    <form name="login_form" action="index.php?module=melody_search" method="post" style="margin: 0; margin-top: 2px; margin-bottom: 2px;">
	      <input id="form_field01" type="text" name="search" size="15" maxlength="30" value=""><br />
	      <input id="form_button01" type="submit" name="Submit" value="OK"><br /> 
	    </form>
    </div>
  </div>
  <?php } ?>

  <div id="menu03">
    <div id="menu01_head">:: interpret</div>
    <div id="menu01_item">
    <?php
    	for($j=65;$j<=90;$j++)
    	{
    		if (chr($j) == $interpret) echo "<span id=\"red\">$interpret</span> ";
    		else echo"<a href=\"index.php?module=melodie&amp;interpret=".(chr($j))."&type=".$type."&amp;genre=$genre\" id=\"menu01_link\">".(chr($j))."</a> "; 
    	}
		echo"<a href=\"index.php?module=melodie&amp;interpret=cis&type=".$type."&amp;genre=$genre\" id=\"menu01_link\">#</a> 
		<a href=\"index.php?module=melodie&amp;type=".$type."&amp;genre=$genre\" id=\"menu01_link\">všetky</a><br>";
    ?>

    </div>
  </div>  
  
  <div id="menu03">
    <div id="menu01_head">:: názov</div>
    <div id="menu01_item">
    <?php
    	for($j=65;$j<=90;$j++)
    	{
    		if (chr($j) == $nazov) echo "<span id=\"red\">$nazov</span> ";
    		else echo"<a href=\"index.php?module=melodie&amp;nazov=".(chr($j))."&type=".$type."&amp;genre=$genre\" id=\"menu01_link\">".(chr($j))."</a> "; 
    	}
		echo"<a href=\"index.php?module=melodie&amp;nazov=cis&type=".$type."&amp;genre=$genre\" id=\"menu01_link\">#</a> 
		<a href=\"index.php?module=melodie&amp;type=".$type."&amp;genre=$genre\" id=\"menu01_link\">všetky</a><br>";
    ?>

    </div>
  </div>
  <?php
  
//  	if(in_array($_SESSION['my_id'], $admins))
  	{
  
  ?>
  
  <div id="menu03">
    <div id="menu01_head">:: žáner</div>
    <div id="menu01_item">
    <?php
    	
    	if(is_array($melody_genres))
    	{
    		foreach ($melody_genres as $kg => $genre_name)
    		{
    			if($genre == $kg)
    			{
    				echo "<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <span id='red'>$genre_name</span><br/>";
    			}
    			else 
    			{
    				echo "<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href=\"index.php?module=melodie&amp;nazov=".$nazov."&amp;type=".$type."&amp;interpret=$interpret&amp;genre=$kg\" id=\"menu01_link\">".$genre_name."</a><br /> ";
	   			}
    		}
    		echo "<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href=\"index.php?module=melodie&amp;nazov=".$nazov."&amp;type=".$type."&amp;interpret=$interpret&amp;genre=\" id=\"menu01_link\">všetky</a><br /> ";
    	}
    	if(session_is_registered('my_id') && in_array($_SESSION['my_id'], $admins))
    	{
    		echo '<br />';
    		if(!session_is_registered('melody_edit'))
    		{
    			echo "<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href=\"index.php?module_top=melody_sort&amp;action=on\" id=\"menu01_link\">zapni triedenie</a> ";
    		}
    		else 
    		{
    			echo "<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href=\"index.php?module_top=melody_sort&amp;action=off\" id=\"menu01_link\">vypni triedenie</a> ";
    		}
    	}
    
    ?>

    </div>
  </div>
  
  <?php } if($action=='' || $action=='new') {?>
  <div id="menu03">
    <div id="menu01_head">:: typ</div>
    <div id="menu01_item">
    	<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href="index.php?module=melodie&amp;action=<?php echo $action ?>&amp;interpret=<?php echo $interpret; ?>&amp;nazov=<?php echo $nazov; ?>&amp;genre=<?php echo $genre; ?>&amp;type=mid" id="menu01_link<?php if($type=='mid') echo "_red";?>">mid</a><br />
    	<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href="index.php?module=melodie&amp;action=<?php echo $action ?>&amp;interpret=<?php echo $interpret; ?>&amp;nazov=<?php echo $nazov; ?>&amp;genre=<?php echo $genre; ?>&amp;type=wav" id="menu01_link<?php if($type=='wav') echo "_red";?>">wav</a><br />
    	<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href="index.php?module=melodie&amp;action=<?php echo $action ?>&amp;interpret=<?php echo $interpret; ?>&amp;nazov=<?php echo $nazov; ?>&amp;genre=<?php echo $genre; ?>&amp;type=amr" id="menu01_link<?php if($type=='amr') echo "_red";?>">amr</a><br />
    	<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href="index.php?module=melodie&amp;action=<?php echo $action ?>&amp;interpret=<?php echo $interpret; ?>&amp;nazov=<?php echo $nazov; ?>&amp;genre=<?php echo $genre; ?>&amp;type=mp3" id="menu01_link<?php if($type=='mp3') echo "_red";?>">mp3</a><br />
    	<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href="index.php?module=melodie&amp;action=<?php echo $action ?>&amp;genre=<?php echo $genre; ?>" id="menu01_link">všetky</a>
    </div>
  </div>
  <?php } ?>
  <div id="menu03">
    <div id="menu01_head">:: rebríčky</div>
    <div id="menu01_item">
    	<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href="index.php?module=chart" id="menu01_link"><b>EURO CHART</b></a><br />
    	<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href="index.php?module=melodie&amp;action=new" id="menu01_link">NEW <?php echo $melodie_charts; ?></a><br />
    	<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href="index.php?module=melodie&amp;action=top" id="menu01_link">TOP <?php echo $melodie_charts; ?></a><br />
    	<img src='images/arrow-left.png' class='sipka' alt='4mobile' /> <a href="index.php?module=melodie&amp;action=dload" id="menu01_link">TOP DLOAD<?php echo $melodie_charts; ?></a>
    </div>
  </div>
  
  <div id="menu03">
    <div id="menu01_head">:: reklama</div>
    <div id="news_item">
     <script type="text/javascript"><!--
			google_ad_client = "pub-4917301309934013";
			//120x240, bola vytvorená 14.1.2008
			google_ad_slot = "8025531173";
			google_ad_width = 120;
			google_ad_height = 240;
			//--></script>
			<script type="text/javascript"
			src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
			</script>
    </div>
  </div>