<?


  if (!include '../autorization.php')
  {
    echo 'Access denied!';
    exit ();
  }

  if (!($result = mysql_query ('SELECT * FROM topmenu')))
  {
    exit ('Query failed4');
    ;
  }

  $SETT = mysql_fetch_array ($result);
  $items = split ('
', $SETT['items']);
  echo '
<table border="0" cellspacing="0" cellpadding="';
  echo topmenu_padding;
  echo '" ';
  if (topmenu_bg_color)
  {
    echo 'bgcolor="';
    echo topmenu_bg_color;
  }

  echo '" ';
  if (topmenu_border == '1')
  {
    echo 'style="border: 1px solid ';
    echo topmenu_border_color;
    echo ';"';
  }

  echo '>
<tr>
	';
  for ($i = 0; $i < sizeof ($items); ++$i)
  {
    if ($items[$i] != '')
    {
      echo '		<td ';
      if (topmenu_horizontal)
      {
        echo 'align="';
        echo topmenu_horizontal;
        echo '"';
      }

      echo ' ';
      if (topmenu_vertical)
      {
        echo 'valign="';
        echo topmenu_vertical;
        echo '"';
      }

      echo ' ';
      if (0 < topmenu_width)
      {
        echo 'width="';
        echo topmenu_width;
        echo '"';
      }

      echo ' ';
      if (0 < topmenu_height)
      {
        echo 'height="';
        echo topmenu_height;
        echo '"';
      }

      echo ' ';
      if (file_exists ($documentroot . '/upload/Image/topmenu_bg.gif'))
      {
        echo 'background="/upload/Image/topmenu_bg"';
      }

      echo ' style="';
      if (topmenu_border == '2')
      {
        echo 'border-top-width:1px; border-top-style:solid; border-top-color:';
        echo topmenu_border_color;
        echo '; border-left-width:1px; border-left-style:solid; border-left-color:';
        echo topmenu_border_color;
        echo '; border-bottom-width:1px; border-bottom-style:solid; border-bottom-color:';
        echo topmenu_border_color;
        echo '; ';
        if (sizeof ($items) - $i < 2)
        {
          echo 'border-right-width:1px; border-right-style:solid; border-right-color:';
          echo topmenu_border_color;
          echo ';';
        }
      }

      echo '">
			<a href="javascript:" style="text-decoration:';
      echo topmenu_decoration;
      echo ';color:';
      echo topmenu_color;
      echo '; font-family:';
      echo topmenu_font;
      echo '; font-size:';
      echo topmenu_font_size;
      echo '; font-weight:';
      echo topmenu_font_weight;
      echo ';">';
      echo $items[$i];
      echo '</a>
		</td>
	';
      continue;
    }
  }

  echo '</tr>
</table>
<br>
';
?>
