<?php

require_once 'locale.php';

function getMainPage($header, $content) {
  echo "<html><head>\n";
  echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">\n";
  echo "<link type='text/css' href='css/utt.css' rel='stylesheet'>\n";
  echo "<script type=\"text/javascript\" src=\"js/menu.js\"></script>\n";
  if(isset($header)) {
	# jesli pominieto znacznik tytulu - dodajemy sami
	if (stristr($header, '<title>') === false) {
	  	echo '<title>'.DEFAULT_PAGE_TITLE."</title>\n";
	}
    echo $header;
  }
  else {
  	echo '<title>'.DEFAULT_PAGE_TITLE."</title>\n";
  }
  echo "</head>\n";
  echo "<body>\n";
  echo "<table class=\"page_table\">\n";
  echo "<tr>\n";
  echo "  <td class=\"page_title\" colspan=\"3\">".PAGE_HEADER."</td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "  <td class=\"page_menu\">\n";
  echo "    <table class=\"main_menu\" align=\"center\" cellspacing=\"1\">\n";
  $menu = array("index.php" => MENU_MAIN_PAGE,
  		        "help.php" => MENU_HELP,
				"licence.php" => MENU_LICENSE,
				"authors.php" => MENU_AUTHORS,
				"down.php" => MENU_DOWNLOADS);

  foreach($menu as $page=>$descr) {
	  echo "      <tr>\n";
	  echo "        <td class=\"main_menu_cell\"\n";
	  echo "			   onMouseOver=\"return menu_select_element(this, true);\"\n";
	  echo "			   onMouseOut=\"return menu_select_element(this, false);\"\n";
	  echo "			   onClick=\"window.location='".$page."'; return true;\"\n";
	  echo "        >\n";
	  echo          $descr."\n";
	  echo "        </td>\n";
	  echo "      </tr>\n";
  }
  echo "      </table>\n";
  echo "	</td>\n";
  echo "    <td class=\"page_content\">\n";
  echo $content;
  echo "	</td>\n";
  echo "    <td class=\"page_left_margin\">&nbsp;</td>\n";
  echo "  </tr>\n";
  echo "</table>\n";
  echo "</body></html>\n";
}

?>
