<?
/*
$Id: index.php,v 1.18 2004/09/20 12:18:39 max Exp $
*/

include("include/functions.php");

if(isset($_GET['section']))
{
	$sectarray = split("-",$_GET['section']);
	$section = ($sectarray[0] != "" ? $sectarray[0] : "home");
	$lang = ($sectarray[1] != "" ? $sectarray[1] : "en");
} 
else {
	$section = "home";
	$lang = "en";
}

switch ($lang)
{
	case "hu":
	case "ja":
	case "zh":
		header("Content-Type: text/html; charset=UTF-8");
		break;
	case "tr";
		header("Content-Type: text/html; charset=ISO-8859-9");
		break;
	default:
		header("Content-Type: text/html; charset=ISO-8859-15");
}

// Do some sanity checks and next sections here
$sections[] = "contacts";
$sections[] = "cvs";
$sections[] = "doc";
$sections[] = "download";
$sections[] = "home";
$sections[] = "menu";
$sections[] = "mirror";
$sections[] = "ml";
$sections[] = "faq";
$sections[] = "screenshot";
$sections[] = "vendors";
if(!in_array($section,$sections)) $section="home";

// Add next languages here
$langs[] = "de";
$langs[] = "en";
$langs[] = "es";
$langs[] = "fr";
$langs[] = "hu";
$langs[] = "it";
$langs[] = "nl";
$langs[] = "ja";
$langs[] = "tr";
$langs[] = "zh";
if(!in_array($lang,$langs)) $lang="en";


// Let's get the docroot for later includes
$docroot = "include/$lang";

// Document  to look for
$doc = $docroot . "/" . $section . ".php";
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<link rel="STYLESHEET" type="text/css" href="freesbie.css">
<title>FreeSBIE - Free System Burned In Economy</title>
</head>

<body link="#ff6633" alink="#ff6633" vlink="#ff6633">
<? include("include/header.php"); ?>
<table width="100%" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td width="15%" valign="top" align="center" class="menu"><p class=menu><? include("$docroot/menu.php"); ?></p><br /><br /></td>
			<td width="18">&nbsp;</td>
      <td><? include($doc); ?></td>
    </tr>
  </tbody>
</table>
<hr />
<? include("include/footer.php"); ?>
</body>
</html>
