<?php
/* 
	Appointment: Выбор языка

*/
if(!defined('MOZG'))
	die('Hacking attempt!');

NoAjaxQuery();

$tpl->load_template('lang/main.tpl');

$useLang = intval($_COOKIE['lang']);
if($useLang <= 0) $useLang = 1;
$config['lang_list'] = nl2br($config['lang_list']);
$expLangList = explode('<br />', $config['lang_list']);
$numLangs = count($expLangList);
$cil = 0;
foreach($expLangList as $expLangData){
	
	$expLangName = explode(' | ', $expLangData);
	$expLangIco = 'languages/'.$expLangName[1].'/icon.png';
	
	if($expLangName[0]){
		
		$cil++;
		
		if($cil == $useLang OR $numLangs == 1)
		
			$langs .= "<li id=\"language_active\"><img src=".$expLangIco." />{$expLangName[0]} </li>";
			
		else
		
			$langs .= "<a href=\"/index.php?act=chage_lang&id={$cil}\"><li><img src=".$expLangIco." />{$expLangName[0]}</li></a>";
		
	}
	
}

if(!$checkLang) $checkLang = 'English';

$tpl->set('{langs}', $langs);

$tpl->compile('content');

AjaxTpl();

exit();

?>