<?php
/**
 * @package Flatnux_theme_base
 * @author Alessandro Vernassa <speleoalex@gmail.com>
 * @copyright Copyright (c) 2011
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License
 */
defined('_FNEXEC') or die('Restricted access');
global $_FN;
//@unlink ("misc/fndatabase/themes_base/settings.php");
$config = FN_LoadConfig("themes/{$_FN['theme']}/config.php");
echo "<?xml version=\"1.0\"?>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"{$_FN['lang']}\" xml:lang=\"{$_FN['lang']}\">
<head>
";
$bkimage = $config['background_image'] != "" ? "background-image:url('themes/{$_FN['theme']}/backgrounds/{$config['background_image']}')" : "";
echo "<style type=\"text/css\" >
body,td {
	color: #000000;
	font-size:{$config['site_fontsize']};
	\"{$config['site_font']}\";
	padding:{$config['body_padding']}
}
body{
	$bkimage
}
form{
	border:0px;
	padding:0px;
}
input{
	border:1px #000080 inset;
	padding:1px;
	font-size: 12px;
	vertical-align: middle
}
textarea{
	border:1px #000080 inset;
}
input[type=\"radio\"] { height:16px;border-style:none; }
input[type=\"checkbox\"] { height:16px;border-style:none; }
input[type=\"button\"] { border-style:outset; }
input[type=\"submit\"] { border-style:outset; }

button{
	border:1px #000080 outset; margin:1px;
}

div{
	line-height: 16px;
}
a{
	color:{$config['link_color']};
	text-decoration: none
}
a:hover{
	text-decoration: underline

}
#sitebody{
	background-color: {$config['background_color_body']};
}
#maintable{
	width:{$config['width_site']};
	border:1px solid {$config['border_color_site']};
	margin: auto;
	margin-top:{$config['page_margin']};
	height:600px;
	border-collapse: collapse;
	background-color: {$config['background_site_color']};
	color: {$config['text_site_color']};
	box-shadow: 0px 0px 10px ;
	-webkit-box-shadow:0px 0px 10px ;
	-moz-box-shadow: 0px 0px 10px ;
	
}
#header{
	background-color: {$config['background_color_header']};
	color:{$config['text_color_header']};
	text-align: center;
	height:40px;
	font-size: 30px;
}
#top,#top a{
	text-align: center;
	text-decoration: none;
	background-color: {$config['background_color_top']};
	color:{$config['text_color_top']};
	height: 30px;
}
#left{
	border-right:1px solid {$config['border_color_site']};
	padding:0px;
	background-color: {$config['background_color_left']};
	color: {$config['text_color_left']};
	width:{$config['width_left']};
}
#left a{
	color: {$config['text_color_left']};
}

#right{
	border-left:1px solid {$config['border_color_site']};
	background-color: {$config['background_color_right']};
	color: {$config['text_color_right']};
	width:{$config['width_right']};
	padding:0px;
}
#right a{
	color: {$config['text_color_right']};
}

#center{
	padding:5px;
}
#left .block{
	background-color: transparent;
	border-bottom: 1px dotted #dadada;;
	background-color: {$config['background_color_block_left']};
	color: {$config['text_color_block_left']};
	margin-bottom: 10px;
	padding:0px;
	padding-bottom: 10px;
}
#left .blocktitle{
	background-color: {$config['background_color_block_title_left']};
	color:{$config['text_color_block_title_left']};
	padding:3px;
}
#left .blockcontents{
	padding:3px;
}
#right .block{
	background-color: transparent;
	border-bottom: 1px dotted #dadada;
	background-color: {$config['background_color_block_right']};
	color: {$config['text_color_block_right']};
	margin-bottom: 10px;
	padding:0px;
	padding-bottom: 10px;
}
#right .blocktitle{
	background-color: {$config['background_color_block_title_right']};
	color:{$config['text_color_block_title_right']};
	padding:3px;
}
#right .blockcontents{
	padding:3px;
}

#bottom{
	text-align: center;
	height:20px;
	border-top:1px solid {$config['border_color_footer']};
	background-color: {$config['background_color_footer']};
	color: {$config['text_color_footer']};
}
#footer{
	text-align: center;
	height:20px;
	background-color: {$config['background_color_footer']};
	color: {$config['text_color_footer']};
}
</style>
";
echo FN_HtmlHeader();
$colspan = 1;
if ( $config['show_blocks_left'] )
	$colspan++;

if ( $config['show_blocks_right'] )
	$colspan++;

echo "</head>\n<body id=\"sitebody\">";
echo "\n\t<table  id=\"maintable\">";
echo "\n\t\t<tr>\n\t\t\t<td id=\"header\" colspan=\"$colspan\">{$_FN['site_title']}</td>\n\t</tr>";
echo "\n\t<tr>\n\t\t<td id=\"top\" colspan=\"$colspan\">";

if ( $config['show_blocks_top'] )
	echo FN_HtmlBlocks("top");

echo FN_HtmlMenu("&nbsp;|&nbsp;");
echo "\n\t</td>
</tr>
<tr>
";
if ( $config['show_blocks_left'] )
{
	echo "
	<td id=\"left\" valign=\"top\">";
	echo FN_HtmlBlocks("left");
	echo "
	</td>
";
}
echo "
	
	<td  id=\"center\"  valign=\"top\">";
if ($_FN['sectionvalues']['parent']!="")
{	
	echo FN_HtmlNavbar()."<br />";
}
echo FN_HtmlSection();
echo "
	</td>
";
if ( $config['show_blocks_right'] )
{
	echo "
	<td  id=\"right\"  valign=\"top\">";
	echo FN_HtmlBlocks("right");
	echo "
	</td>
</tr>
";
}

if ( $config['show_blocks_bottom'] )
{
	echo "
<tr>
	<td  id=\"bottom\" colspan=\"$colspan\">";
	echo FN_HtmlBlocks("bottom");
	echo "
</td></tr>";
}
echo "<tr><td id=\"footer\" colspan=\"$colspan\">" . FN_HtmlCredits()
 . "
<br />Page generated in " . FN_GetExecuteTimer() . " seconds.
	</td>
</tr></table>";
echo "</body>
</html>
";
?>