<?
if($set['gzip'] == 'on'){
	include_once('gzip.php');
}

include_once('style.php');

echo '<!DOCTYPE html><html><head>';
echo '<link rel="stylesheet" type="text/css" href="/style.css" />';
echo '<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />';
echo '<meta http-equiv="content-type" content="text/html;UTF-8">';
echo '<meta http-equiv="content-language" content="ru">';
echo '<meta http-equiv="cache-control" content="no-cache">';
echo '<meta http-equiv="pragma" content="no-cache">';

if($country AND $user){
	if(mysql_num_rows(mysql_query("SELECT * FROM `tasks` WHERE `country` = ".$country['id']."")) != 0){
		$country_task = mysql_fetch_array(mysql_query("SELECT * FROM `tasks` WHERE `country` = ".$country['id']." ORDER BY `time_end` ASC LIMIT 1"));
		echo '<meta http-equiv="refresh" content="'.($country_task['time_end'] - time()).'">';
	}
}

// echo '<meta name="cypr-verification" content="cea91e67c15eab3061d340324974745d"/>';
echo '<meta name="viewport" content="width=device-width; minimum-scale=1; maximum-scale=1"/>';
if($description != null) echo '<meta name="description" content="'.$description.'">';
if($keywords != null) echo '<meta name="keywords" content="'.$keywords.'">';
if($set['background'] == 'on') echo '<style>body{ background: #0D0A05 url(/images/style/background.jpg); background-repeat:no-repeat; background-position:top,center; }</style>';

echo '<title>'.$title;
if(!$notitle) echo ' | '.$set['site_name'];
echo '</title></head><body>';

// Верхняя панель
echo '<div class="head">';
if($user){
	if($user['level'] == 1) $icon = $user['gender'];
	else $icon = 'mod';
	echo '<small>';
    if($set['images'] == 'on'){
		echo '<span class="nick"><img src="/images/icons/users/'.$icon.'_on.png" class="icon_small" alt=""> '.$user['nick'].' <a href="/exit.php?'.$gets.'">'.icon2('exit').'</a></span>';
		if($user['country'] != 0) echo icon2('money').res_okrugl($country['money'],'монет').' '.icon2('wood').res_okrugl($country['wood'],'дерева').' '.icon2('stone').res_okrugl($country['stone'],'камня').' '.icon2('iron').res_okrugl($country['iron'],'железа').' '.icon2('grain').res_okrugl($country['grain'],'зерна').' '.icon2('oil').res_okrugl($country['oil'],'нефти');
    }
    else{
    	echo '<span class="nick">'.$user['nick'].' <a href="/exit.php?'.$gets.'"><font color="red">[x]</font></a></span>';
		if($user['country'] != 0) echo 'Монеты: '.res_okrugl($country['money'],'монет').' | Дерево: '.res_okrugl($country['wood'],'дерева').' | Камень: '.res_okrugl($country['stone'],'камня').' | Железо: '.res_okrugl($country['iron'],'железа').' | Зерно: '.res_okrugl($country['grain'],'зерна').' | Нефть: '.res_okrugl($country['oil'],'нефти');
	}
    echo '</small>';
}
echo '</div>';

echo '<div class="main"><div class="title"><b>'.$title.'</b></div>';
?>