<?php
defined('MAXIMUS') OR header ("location: index.php");
$bgcolor1   = '#f3f1f1';
$bgcolor2   = '#c0c0c0';
$bgcolor3   = '#F4F6FB';
$bgcolor4   = '#BBCCDC';
$textcolor1 = '#516A88';
$textcolor2 = '#516A88';

/************************************************************/
/* Function themeheader()                                   */
/*                                                          */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks    */
/* function for left side with: blocks(left);               */
/************************************************************/

function themeheader() {
 global $site_logo, $sitename, $anonymous, $slogan, $cookie, $anonymous, $banners, $cacheblocsl, $cacheblocsr, $name;
$username = $cookie[1];
if ($username == "") $username = $anonymous;
echo "<body bgcolor='#FFFFFF'><a name='max_top'></a>";

if ( !empty( $config_banners ) ) {
	$sql = "SELECT `bid` FROM `".TABLE_NSNBA_BANNERS."` WHERE `active`='1'";
	if ( !($bresult = $GLOBALS['db']->sql_query($sql)) )
	{ query_die(GENERAL_ERROR, 'Could not obtain _nsnba_banners', '', __LINE__, __FILE__, $sql);}
$numrows = $GLOBALS['db']->sql_numrows($bresult);
if($numrows > 0) {
	if (is_file("kernel/babanners1.php")) {
		include_once("kernel/babanners1.php");
	}
echo "<table width='95%' cellpadding='0' cellspacing='0' border='0' align='center'><tr valign='top'><td align='center'>"
."$babanners1"
. "</td></tr></table>";
}

}

echo "<table width='95%' cellpadding='0' cellspacing='0' border='0' align='center'><tr valign='top'><td align='left'>"
    ."<div id='menu'>";

if (defined('ADMIN_ALLOW')) {
global $admin_file;
echo "<a href='$admin_file.php'>"._ADMIN."</a> ";
}

echo "<a href='index.php'>"._HOME."</a>"
    ." <a href='plan.php'>"._MAPWEBSITE."</a>";
    if ($username == "Anonymous") {
	echo " <a href='modules.php?name=Your_Account'>"._LOGIN."</a> "
	    ."&nbsp;<a href='modules.php?name=Your_Account&amp;op=new_user'>"._BREG."</a> ";
    } else {
	echo " <a href='modules.php?name=Your_Account'><b>"._YOURACCOUNT." $username !</b></a> ";
    }
echo "<a href='modules.php?name=Topics'>"._TOPICS."</a>"
    ." <a href='modules.php?name=Forums'>"._FORUMS."</a>"
    ." <a href='modules.php?name=Downloads'>"._DOWNLOADS."</a>"
    ." <a href='modules.php?name=Search'>"._SEARCH."</a>"
    ." <a href='modules.php?name=Feedback'>"._FEEDBACK."</a>"
    ."</div></td></tr></table>";

    $public_msg = public_message();

if (file_exists("themes/MaX_Colors/header_".$name.".html")) {
    $tmpl_file = "themes/MaX_Colors/header_".$name.".html";
} else {
    $tmpl_file = 'themes/MaX_Colors/header.html';
}
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval("$thefile");
    print $r_file;

    if ($_COOKIE['blo']['900'] == "") {
    	blocks('left');
    }

    $tmpl_file = 'themes/MaX_Colors/left_center.html';
    Max_Template_Block('left_center');
}

/************************************************************/
/* Function themefooter()                                   */
/*                                                          */
/* Control the footer for your site. You don't need to      */
/* close BODY and HTML tags at the end. In some part call   */
/* the function for right blocks with: blocks(right);       */
/* Also, $index variable need to be global and is used to   */
/* determine if the page your're viewing is the Homepage or */
/* and internal one.                                        */
/************************************************************/

function themefooter() {
    global $foot1, $foot2, $foot3, $foot4, $copyright, $totaltime, $footer_message, $name;

    $navbarfooter = "&nbsp; <a href='index.php'>"._HOME."</a>"
                   ."&nbsp;&#8226;&nbsp;<a href='plan.php'>"._MAPWEBSITE."</a>"
                   ."&nbsp;&#8226;&nbsp;<a href='modules.php?name=Search'>"._SEARCH."</a>"
                   ."&nbsp;&#8226;&nbsp;<a href='modules.php?name=Feedback'>"._FEEDBACK."</a>";

	$tmpl_file = 'themes/MaX_Colors/center_right.html';
	Max_Template_Block('center_right');

    if ($_COOKIE['blo']['901'] == "") {
	blocks('right');
    }

if (file_exists("themes/MaX_Colors/footer_".$name.".html")) {
    $tmpl_file = "themes/MaX_Colors/footer_".$name.".html";
} else {
    $tmpl_file = 'themes/MaX_Colors/footer.html';
}
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval("$thefile");
    print $r_file;
    $footer_message = footmsg();

}