<?PHP
//* Agares Media CMS- Version 3.0 *//
//* Copyright 2007 © Agares Media.  All rights reserved. *//
//* Use of this software is governed by the terms of our license *//
error_reporting(0);
$benchmark_start = microtime();
if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
	ob_start("ob_gzhandler"); // Compress the HTML
	header("Content-Encoding: gzip");
}
require_once("./includes/corefunctions.php"); // Load the AMCMS3 functions
require_once("./includes/db.php"); // Get the database configuration settings & connect to DB.
require_once("./includes/config.php"); // Load the admin's preferences
require_once('./language/'.$script_language.'/index.php');
require_once("./includes/gamefunctions.php"); // Load the AMCMS3 game functions
require_once("./includes/SimplePie 1.0.1/simplepie.inc.php"); // Load SimplePie 1.0.1
am_session(); // Start the session if nothing else has
require_once("./includes/loginsubmit.php"); // Load login submission
include_once(".".$themepath."top.php"); // Loads the topmost information (do not confuse this with the header)
include_once(".".$themepath."header.php"); // Loads the header and menu
require_once("./includes/cache_top.php"); // Load the page cache code
include_once(".".$themepath."sidebar.php"); // Loads the sidebar
include_once(".".$themepath."frontpage_right.php"); // Loads the right content
am_depthstats(); // Calls DepthStats code.
include_once(".".$themepath."footer.php"); // Loads the footer (there is no bottom.php, this is the last file)
require_once("./includes/cache_bottom.php"); // Load the page cache code
$benchmark_end = microtime();
$benchmark = $benchmark_end - $benchmark_start;
print("<!-- Script Execution Time: " . $benchmark . "-->\n");
if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
	echo '<!-- gzip successful -->';
	ob_end_flush(); // Output the uncompressed HTML
} else {
	echo '<!-- '.$HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'].' -->';
}
?>