{*{include file="$admingentemplates/admin_top.tpl"}
<font class="red_header">{$lang.settings.razdel_name}</font><font class="red_sub_header">&nbsp;|&nbsp;{$lang.install_spr.list}</font>
<div class="help_text">
    <div class="close_help">
        <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
    </div>
    <div class="help_body">
        <span class="help_title">{$lang.help}:</span>{$lang.install_spr.help}
    </div>
</div>
*}
    <div class="user_status_line">
        <div id="tab_list" class="user_status_elem" onclick="ShowEditor('list','admin_settings.php?section=3&ajax=1');">
            <a>{$lang.settings.section_name.3}</a>
        </div>
        <div id="tab_edit" class="user_status_elem" onclick="ShowEditor('edit','admin_settings.php?section=18&ajax=1');">
            <a>{$lang.settings.section_name.18}</a>
        </div>
        <div id="tab_install" class="user_status_elem_active" onclick="ShowEditor('install','admin_settings.php?sel=lang_list&ajax=1');">
            {$lang.install_spr.install_lang}
        </div>
        <div class="cr"></div>
        <div class="panel_subtabs" style="width: 100%">
        	<div class="panel_content" style="width: 97%">

<div id="lang_list">
	<form action="{$form.action}?ajax=1&sel=install" method="POST" name="install_lang" id="install_lang" enctype="multipart/form-data">
	{$form.hiddens}
	<table cellpadding="5" cellspacing="0" border="0" width="100%">
		<tr>
			<td class="main_content_text" align="center" width="50%"><a href="#" onclick="javascript:Select('all');">Select All</a></td>
			<td class="main_content_text" align="center" width="50%"><a href="#" onclick="javascript:Select('allun');">Unselect All</a></td>
		</tr>
	</table>
	</br>
	<table cellpadding="5" cellspacing="0" border="0" width="100%" style="background:#ffffff">
		<tr>
		{section start=0 name=i max=$lang_install|@sizeof loop=$lang_install}
				<td class="main_content_text" align="left" width="195px;">{$lang_install[i].name}</td>
				<td class="main_content_text" align="left"><input type="checkbox" id="sel_language[{$lang_install[i].id}]" name="sel_language[{$lang_install[i].id}]" value="{$lang_install[i].name}"></td>
				<td class="main_content_text" align="left" {if $smarty.section.i.index eq $lang_install|@sizeof-1}colspan="11"{/if}>&nbsp;</td>
		{if $lang_install[i].index is div by 4 && $smarty.section.i.index ne 0 && $smarty.section.i.index ne $lang_install|@sizeof-1}
			</tr>
			<tr>
		{/if}
		{/section}
		</tr>
	</table>
	</form>
	</div>
	<div id="install" style="display:none;width:200px;float:left;">
	</div>
	</div>
	</div>
	<div id="install_yes" align="left">
	</div>
	<div align="left" style="padding-bottom:3px;" id="install_button">
		<a class="admin_button_major" onclick="javascript:Install();">{$lang.button.install}<span>&nbsp;</span></a>
	</div>
	</div>

<script type="text/javascript">
{literal}
function Select(par)
{
	switch(par)
	{
		case "all":
			for(var i = 1; i < {/literal}{$count}{literal}; i++)
			if(document.getElementById('sel_language['+i+']')) document.getElementById('sel_language['+i+']').checked = true;
		break
		case "allun":
			for(var i = 1; i < 265; i++)
			if(document.getElementById('sel_language['+i+']')) document.getElementById('sel_language['+i+']').checked = false;
		break
	}
}
function Install() 
{
	$("#install_button").css("display","none");
	var err = 1; 
	for(var i = 1; i < {/literal}{$count}{literal}; i++)
	{
		if(document.getElementById('sel_language['+i+']') && document.getElementById('sel_language['+i+']').checked == true)
		{
			err = 0;
		}
	}
	if (err == 0) 
	{
	document.getElementById("lang_list").style.display = 'none';
	document.getElementById("install").style.display = 'block';
	document.getElementById("install_yes").innerHTML = '<div align="left"><img border="0" src="{/literal}{$site_root}{$template_root}{literal}/images/ajax-loader.gif"></div>';
	var re = 1;
	var strhtml = '';
	file_name = '{/literal}{$form.action}{literal}'; 
	for (var i=1; i<{/literal}{$count}{literal}; i++){
		if (document.getElementById('sel_language['+i+']') && document.getElementById('sel_language['+i+']').checked == true){
			str = 'sel=install&sel_language['+i+']='+document.getElementById('sel_language['+i+']').value;
			destination_odj = document.getElementById('install');
			tmp_text = '';
			anisochronous = false;
			ajaxRequest(file_name, str, destination_odj, tmp_text, anisochronous);
			setTimeout(";",2000);
			strhtml = strhtml + '<div>'+document.getElementById('sel_language['+i+']').value+' {/literal}{$lang.admin_reference.install}{literal}</br></div>';
			document.getElementById('install').innerHTML = strhtml;
		}
	}
	strhtml = strhtml + '<div style="padding-top:5px;"><a class="admin_button_cancel" onclick="ShowBlock(\'show_block\',\'admin_settings.php?sel=lang_list&ajax=1\');">{/literal}{$lang.button.vip_cancel}{literal}<span>&nbsp;</span></a></div>';
	document.getElementById('install').innerHTML = strhtml;
	document.getElementById("install_yes").innerHTML = '';
	}
}
{/literal}
</script>
{*
{include file="$admingentemplates/admin_bottom.tpl"}
*}