<?php

	if($sPhpVersion>=540)
	{
		if (session_status() == PHP_SESSION_NONE)
		{
			session_start(); // début de session
		}
	}

	$bSessionOk=checksession();

	$FAMILY=isset($_REQUEST["FAMILY"])?$_REQUEST["FAMILY"] : -1;
	
	if (substr(substr($_SERVER["REQUEST_URI"],-9),0,6)=='?LANG=')
	{
		$link = substr($_SERVER["REQUEST_URI"], 0, (strlen($_SERVER["REQUEST_URI"])-8));
	}
	else
		if (substr(substr($_SERVER["REQUEST_URI"],-9),0,6)=='&LANG=')
	{
		$link = substr($_SERVER["REQUEST_URI"], 0, (strlen($_SERVER["REQUEST_URI"])-9));
	}
	else
	{
		if (substr($_SERVER["REQUEST_URI"],-4)=='.php')
		{
			$link = $_SERVER["REQUEST_URI"]."?";
		}
		else
		{
			if (substr($_SERVER["REQUEST_URI"],-1)=='/')
			{
				$link = $_SERVER["REQUEST_URI"]."index.php?";
			}
			else
			{
				$link = $_SERVER["REQUEST_URI"];
			}
		}
	}
?>

<html>
<head>
<link href="oxygen.css" rel="stylesheet" type="text/css" media="screen" />
<link href="oxygen_print.css" rel="stylesheet" type="text/css" media="print" />
</head>

<div id=menutop>

<body bgcolor=#ffdd88>
<table bgcolor="#425a74" width="100%" cellspagin=0 cellpadding=0>
<tr><td><center><?php display_country_flags("", $link); ?></center></td></tr>
<tr><td><center>
<table border="0" cellspacing="0" cellpadding="3"><tr>
<?php

	if($sPage=="index")
	{
		?>
		<th bgcolor=#DDDDDD><?php display_lng_text("INDEX_LNK_IDX"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th bgcolor=#DDDDDD><A HREF='index.php?FAMILY=<?php echo $FAMILY?>'><?php display_lng_text("INDEX_LNK_IDX"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if($sPage=="patro")
	{
		?>
		<th bgcolor=#DDDDDD><?php display_lng_text("INDEX_LNK_PATRO"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th bgcolor=#DDDDDD><A HREF='patro.php?FAMILY=<?php echo $FAMILY?>'><?php display_lng_text("INDEX_LNK_PATRO"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if($sPage=="dates")
	{
		?>
		<th bgcolor=#DDDDDD><?php display_lng_text("INDEX_LNK_DATES"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th bgcolor=#DDDDDD><A HREF='idx_dates.php?FAMILY=<?php echo $FAMILY?>'><?php display_lng_text("INDEX_LNK_DATES"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if($sPage=="places")
	{
		?>
		<th bgcolor=#DDDDDD><?php display_lng_text("INDEX_LNK_PLACES"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th bgcolor=#DDDDDD><A HREF='idx_lieux.php?FAMILY=<?php echo $FAMILY?>'><?php display_lng_text("INDEX_LNK_PLACES"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if($sPage=="stats")
	{
		?>
		<th bgcolor=#DDDDDD><?php display_lng_text("INDEX_LINK_STATS"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th bgcolor=#DDDDDD><A HREF='top10.php?FAMILY=<?php echo $FAMILY?>'><?php display_lng_text("INDEX_LINK_STATS"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if($sPage=="family")
	{
		?>
		<th bgcolor=#DDDDDD><?php display_lng_text("FAMILY_TITLE"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		$result = mysql_query( "select count(*) SOMME from oxg_family");
		$row = mysql_fetch_array($result);
		if($row['SOMME']>1)
		{
			?>
			<th bgcolor=#DDDDDD><A HREF='family.php?FAMILY=<?php echo $FAMILY?>'><?php display_lng_text("FAMILY_TITLE"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
			<?php
		}
	}
	if($sPage=="search")
	{
		?>
		<th bgcolor=#DDDDDD><?php display_lng_text("INDEX_LNK_SEARCH"); ?></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		?>
		<th bgcolor=#DDDDDD><A HREF='recherche.php?FAMILY=<?php echo $FAMILY?>'><?php display_lng_text("INDEX_LNK_SEARCH"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if (isset($_SESSION['privilege']))
	{
		?>
		<th bgcolor=#DDDDDD><A HREF='private.php?FAMILY=<?php echo $FAMILY?>&erreur=logout'><?php display_lng_text("INDEX_LNK_LOGOUT"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	else
	{
		$url = str_replace ("&", "*", $_SERVER['REQUEST_URI']);
		?>
		<th bgcolor=#DDDDDD><A HREF='private.php?FAMILY=<?php echo $FAMILY?>&URL=<?php echo $url?>'><?php display_lng_text("INDEX_LNK_PRIVATE"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	if (isset($_SESSION['privilege']) and $_SESSION['privilege']=="admin")
	{
		?>
		<th bgcolor=#DDDDDD><A HREF='user_admin.php?FAMILY=<?php echo $FAMILY?>'><?php display_lng_text("INDEX_LNK_ADMIN"); ?></a></th><th> &nbsp; &nbsp; &nbsp; </th>
		<?php
	}
	
?>
</tr></table>
</td></tr></table>
</div>
<table border=0 width=100%><tr><td>
<center><h1><?php echo $sTitle; ?></h1></center>
