<?php

include_once("includes/init.inc.php");

if(is_file("includes/config.".$name.".inc.php"))
	include_once("includes/config.".$name.".inc.php");
else
	include_once("includes/config.default.inc.php");

include_once("includes/functions.inc.php");
include_once("includes/casual.class.php");
$casual = new Casual();

$action = (isset($_GET["action"]))?$_GET["action"]:"";

// CSS-FILE
if(is_file("stylesheets/".$name.".css"))
	$cssFile = "stylesheets/".$name.".css";
else
	$cssFile = "stylesheets/default.css";

echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";

?>


<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="<?php echo $cssFile; ?>" rel="stylesheet" type="text/css"></link>
<?php //		<link href="general.css" rel="stylesheet" type="text/css"></link> ?>
		<script type="text/javascript" src="javascripts/swfobject.js"></script>
		<script type="text/javascript" src="javascripts/gameCountdown.js"></script>
<!--[if IE 6]>
		<script type="text/javascript" src="javascripts/DD_belatedPNG_0.0.8a-min.js"></script>
		<script type="text/javascript">
			 DD_belatedPNG.fix('.spielende');
		</script>
<![endif]-->

		<script type="text/javascript" src="https://script.ioam.de/iam.js"> </script>

	</head>
	
	<body>
		<?php
			if ($_SERVER['SERVER_NAME'] == 'rtv.spielen.de') {
				echo '<div id="rtvLogo"><a href="http://www.rtv.de/" target="_blank"><img src="/images/rtv/rtv_logo_partner.png" border="0" /></a></div>';
			}
			switch($action)
			{
				case 'category':
					include "action/category.php";
					break;
				case 'keyword':
					include "action/keyword.php";
					break;
				case 'game':
					include "action/game.php";
					break;
				default:
					include "action/start.php";
					break;
			}
		?>
		<div id="bottomLinks"><a target="_blank" href="http://www.spielen.de/games/index.php?browse=696d7072657373756d2e706870&pmeter=66616c7365">Impressum Spielen.de</a> | <a target="_blank" href="http://www.spielen.de/games/index.php?browse=68616674756e67732e706870&pmeter=66616c7365">Haftungsausschluss</a></div>
		<?php
			if(is_file("piwik/".$name.".inc.php"))
				$piwikFile = "piwik/".$name.".inc.php";
			else
				$piwikFile = "piwik/default.inc.php";
			include_once($piwikFile);
		?>
	</body>
</html>
