<?php
/**
 * @package Flatnux_theme_mobile
 * @author Alessandro Vernassa <speleoalex@gmail.com>
 * @copyright Copyright (c) 2011
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License
 *
 *
 */
if ( strpos(strtolower($_SERVER['SCRIPT_NAME']),strtolower(basename(__FILE__))) )
	die();
global $_FN,$sitename,$keywords,$sectiondefault;
$title = $sitename;

$force_width=320;
$menuitem_color="3084c8";
$color_rightblocks="ffffda";
$color_leftblocks="ffffda";
$color_rightblocks_text="000000";
$color_leftblocks_text="000000";
$section_title_background="E46E25";
include("themes/{$_FN['theme']}/config.php");
if ( $_FN['vmod'] != "" )
{
	$tmp = preg_replace("/^[0-9][0-9]_/s","",$_FN['vmod']);
	$title = str_replace("_","&nbsp;",str_replace(".php","",$tmp));
	$titlesun = getLang("sections/{$_FN['vmod']}/lang.xml",$title);
	$title = "$sitename - $titlesun";
}
$agent = getparam("HTTP_USER_AGENT",PAR_SERVER,SAN_FLAT);
$is_PC = false;
if (fn_ergi("Linux i686",$agent))
{
	$is_PC=true;
}
if (fn_ergi("Windows NT",$agent))
{
	$is_PC=true;
}

echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.2//EN\" \"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd\">";
echo "<head>";
echo "
<style type=\"text/css\">body {margin:0; padding:0; font-size:x-small;}
div {margin:0; padding:0; font-size:x-small;}
table {border:0; margin:0; padding:0; font-size:x-small;border-collapse:collapse }
td {margin:0; padding:0; font-size:x-small;}
form {margin:0; padding:0; font-size:x-small;}
img {border:0;}
.small {font-size:xx-small;}
body {color:#666666; background-color:#ffffff; font-family:Tahoma, Verdana; margin:0 auto; padding:0;}
img {border:0; margin:0;}
div {color:#666666;}
form {margin:0px; padding:0px;}
input {color:#000000; background-color:#ffffff;}
a {color:#3084c8; text-decoration:none; font-weight:bold;}
a:focus {background-color:#3084c8; color:#ffffff;}
a:hover {background-color:#3084c8; color:#ffffff;}
.menuitem{
	height:25px;
	border:1px solid ;
	padding: 2px;
	margin-left: 1px;
	margin-top: 1px;
	line-height: 25px;
	float:left;
	background-color: #$menuitem_color;
}
.menuitem a{
	text-decoration: none;
	color:#ffffff;
	white-space: nowrap;
	font-size: 20px;
}

.lang{
	text-decoration: none;
	color:#ffffff;
	white-space: nowrap;
	font-size: 20px;
	line-height: 25px;
	float:left;
	margin-left: 1px;
}
.menuitem a:focus {background-color:#ffffff; color:#$menuitem_color;}
.menuitem a:hover {background-color:#ffffff; color:#$menuitem_color;}
a.active{
	color:#ffff00;
	
}
.sectiontitle{
	background-color: #$section_title_background;
	color:#ffffff;
	font-size: 20px;
	text-align: center;
	margin-bottom: 1px;
}
.rightblocks{
	background-color: #$color_rightblocks;
	color:#$$color_rightblocks_text;

}
.leftblocks{
	background-color: #$color_leftblocks;
	color:#$color_leftblocks_text;

}
";
if ( $is_PC )
//if ( false )
{

	echo "html {background-color:#525051;}
body{width:{$force_width}px}
img,input,table,div,p,textarea,select {
max-width:{$force_width}px;
width:expression(document.body.clientWidth > {$force_width}? \"{$force_width}px\": \"auto\" );
}

";
}
echo "
</style>
";
if ( file_exists("sections/{$_FN['vmod']}/sethead.php") )
	include ("sections/{$_FN['vmod']}/sethead.php");
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . _CHARSET . "\">
<meta name=\"KEYWORDS\" content=\"$keywords\" >
<title>{$_FN['sitetitle']}</title>
";
echo "
<meta name=\"Content-Language\" content=\"{$_FN['lang']}\" />\n
<link href=\"themes/{$_FN['theme']}/navigati.css\" rel=\"stylesheet\" type=\"text/css\" >
";
if ( file_exists("{$_FN['datadir']}/{$_FN['lang']}/backend.xml") )
	echo "\t<link rel=\"alternate\" type=\"application/rss+xml\" title=\"$sitename\" href=\"{$_FN['siteurl']}" . "{$_FN['datadir']}/{$_FN['lang']}/backend.xml\" >\n";
if ( file_exists("themes/{$_FN['theme']}/header.php") ) //aggiunte personalizzate per l'header
	include ("themes/{$_FN['theme']}/header.php");
IncludeJavascripts();
IncludeCss();
echo "</head>\n";
?>