{if $ajax eq 0}
{include file="$admingentemplates/admin_top.tpl"}
<script language="JavaScript" type="text/javascript" src="{$site_root}{$index_theme_path}/js/jquery.form.js"></script>
{if $sec eq '4'}
<div class="cr"></div>
	<div class="error" style="padding: 10px;display: none;">
	</div>
</div>
{/if}
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_settings.php">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$section.name}</div>
<div class="cr">&nbsp;</div>
<div class="cr">&nbsp;</div>
<div class="help_text" style="display:block;">
    <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>{$section.help}
    </div>
</div>
<div class="cr">&nbsp;</div>
{* tabs *}
{*///////////////////////use_default_smiles start////////////////////*}
{if $sec eq 17 || $sec eq 9 || $sec eq 13 || $sec eq 21 || $sec eq 23 || $sec eq 31 || $sec eq 32 || $sec eq 117}
{*///////////////////////use_default_smiles stop////////////////////*}
<ul class="tabs">
    <li>
        <a {if $sec eq 17 || $sec eq 32 || $sec eq 117} class="current" {else} href="admin_settings.php?section=17" {/if}>{$lang.admin.design_management.tab_1}</a>
    </li>
    <li>
        <a {if $sec eq 9} class="current" {else} href="admin_settings.php?section=9" {/if}>{$lang.settings.section_name.9}</a>
    </li>
    <li>
        <a {if $sec eq 13 || $sec eq 21 || $sec eq 31} class="current" {else} href="admin_settings.php?section={$par}" {/if}>{$lang.settings.site_banner}</a>
    </li>
	{*///////////////////////use_default_smiles start////////////////////*}
	<li>
        <a {if $sec eq 23} class="current" {else} href="admin_settings.php?section=23" {/if}>{$lang.settings.section_name.23}</a>
    </li>
	{*///////////////////////use_default_smiles start////////////////////*}
</ul>
<div class="cr"></div>
{/if}
{if $sec eq 4}
<ul class="tabs">
    <li>
        <a {if $active_tab eq 1} class="current" {else} href="admin_settings.php?section=4" {/if}>{$lang.settings.uploads.tab_1}</a>
    </li>
    <li>
        <a {if $active_tab eq 2} class="current" {else} href="admin_settings.php?section=4&tab=2" {/if}>{$lang.settings.uploads.tab_2}</a>
    </li>
</ul>
<div class="cr"></div>
{/if}
{if $sec eq 1 || $sec eq 2 || $sec eq 5 || $sec eq 20}
<ul class="tabs">
    <li>
        <a {if $sec eq 1} class="current" {else} href="admin_settings.php?section=1" {/if}>{$lang.settings.section_name.1}</a>
    </li>
    <li>
        <a {if $sec eq 2} class="current" {else} href="admin_settings.php?section=2" {/if}>{$lang.settings.section_name.2}</a>
    </li>
    <li>
        <a {if $sec eq 5} class="current" {else} href="admin_settings.php?section=5" {/if}>{$lang.settings.section_name.5}</a>
    </li>
    <li>
        <a href="admin_moderators.php?sel=list">{$lang.moderators.name}</a>
    </li>
    <li>
        <a {if $sec eq 20} class="current" {else} href="admin_settings.php?section=20" {/if}>{$lang.settings.section_name.20}</a>
    </li>
</ul>
<div class="cr"></div>
{/if}
{if $sec eq 12 || $sec eq 14}
<ul class="tabs">
    <li>
        <a {if $sec eq 12} class="current" {else} href="admin_settings.php?section=12" {/if}>{$lang.settings.section_name.12}</a>
    </li>
    <li>
        <a {if $sec eq 14} class="current" {else} href="admin_settings.php?section=14" {/if}>{$lang.settings.section_name.14}</a>
    </li>
</ul>
<div class="cr"></div>
{/if}
{if $sec eq 19 || $sec eq 29 || $sec eq 118}
<ul class="tabs">
    {*<li>
        <a href="configOpenInviter.php">{$lang.modules.config_open_inviter.name}</a>
    </li>*}
	<li>
        <a {if $sec eq 118} class="current" {else}href="admin_settings.php?section=118"{/if}>{$lang.settings.section_name.118}</a>
    </li>
    <li>
        <a {if $sec eq 19} class="current" {else}href="admin_settings.php?section=19"{/if}>{$lang.settings.section_name.19}</a>
    </li>
    <li>
        <a {if $sec eq 29} class="current" {else}href="admin_settings.php?section=29"{/if}>{$lang.settings.section_name.29}</a>
    </li>
    <li>
        <a href="admin_settings.php?section=30">{$lang.admin_menu.sharing_tools}</a>
    </li>
</ul>
<div class="cr"></div>
{/if}
{if $sec eq 30}
<ul class="tabs">
    {*<li>
        <a href="configOpenInviter.php">{$lang.modules.config_open_inviter.name}</a>
    </li>*}
	<li>
        <a href="admin_settings.php?section=118">{$lang.settings.section_name.118}</a>
    </li>
    <li>
        <a href="admin_settings.php?section=19">{$lang.settings.section_name.19}</a>
    </li>
    <li>
        <a href="admin_settings.php?section=29">{$lang.settings.section_name.29}</a>
    </li>
    <li>
        <a class="current" href="admin_settings.php?section=30">{$lang.admin_menu.sharing_tools}</a>
    </li>
</ul>
<div class="cr"></div>
{/if}
{if $sec eq 3}
<ul class="tabs">
	<li>
        <a {if $tab eq '3'}class="current"{else}href="admin_settings.php?section=3"{/if}>{$lang.admin_menu.ref_languages}</a>
    </li>
    <li>
        <a {if $tab eq '1'}class="current"{else}href="admin_addition_info.php"{/if}>{$lang.admin_menu.area_editor}</a>
    </li>
    <li>
        <a {if $tab eq '2'}class="current"{else}href="admin_news.php"{/if}>{$lang.news.razdel_name}</a>
    </li>
    <li style="padding-right:0px;">
        <a {if $ref eq '16'}class="current"{else}href="admin_reference.php?ref=16"{/if}>{$lang.admin_menu.ref_hotlist_types}</a>
    </li>
    <li style="padding-right:0px;">
        <a {if $ref eq '22'}class="current"{else}href="admin_reference.php?ref=22"{/if}>{$lang.admin_menu.uploads_gallery_categories}</a>
    </li>
    <li style="padding-right:0px;">
        <a href="admin_kisses.php">{$lang.admin_menu.ref_kiss_types}</a>
    </li>
</ul>
<div class="cr"></div>
{/if}
{* /tabs *}
{/if}
<div id="tooltip" onclick="hideToolTip()" style="text-align:center; background-color: #FFFFFF; border: 1px dotted; text-align: {$default_left}; position:absolute; display:none; padding:5px;"></div>
{literal}
<script type="text/javascript">
$(function() {
$('#tool_tip_4 *').tooltip();
});
</script>
{/literal}

{if $sel eq 'get_reg_settings'}
    <form id="settings_form" name="settings_form" class="settings_form" action="{$site_url}{$site_root}/admin/admin_settings.php?sel=set_reg_settings" method="POST">
    <div class="sg_settings_text_box" style="width:100%">
        {*<div>
            <div class="fl">
                <input type="checkbox" name="use_registration_approve" id="use_registration_approve" value="1" {if $data.use_registration_approve eq 1}checked{/if}>
            </div>
            <div class="fl sg_text_line">
                <label for="use_registration_approve">{$lang.settings.use_registration_approve}</label>
            </div>
        </div>
        <div class="cr"></div>
        <div>
            <div class="fl">
                <input type="checkbox" name="use_registration_confirmation" id="use_registration_confirmation" value="1" {if $data.use_registration_confirmation eq 1}checked{/if}>
            </div>
            <div class="fl sg_text_line">
                <label for="use_registration_confirmation">{$lang.settings.use_registration_confirmation}</label>
            </div>
        </div>
        <div class="cr"></div>*}
		<table border=0 cellspacing=0 cellpadding=5 width="100%">
{*								<tr>
									<td align="left" nowrap class="main_header_text" width="350">{$lang.settings.use_icon_approve}:&nbsp;</td>
									<td class="main_content_text" align="left" width="300"><input type="checkbox" name="use_icon_approve" value="1" {if $data.use_icon_approve}checked{/if}></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" width="350">{$lang.settings.use_photo_approve}:&nbsp;</td>
									<td class="main_content_text" align="left"><input type="checkbox" name="use_photo_approve" value="1" {if $data.use_photo_approve}checked{/if}></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" width="350">{$lang.settings.use_audio_approve}:&nbsp;</td>
									<td class="main_content_text" align="left"><input type="checkbox" name="use_audio_approve" value="1" {if $data.use_audio_approve}checked{/if}></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" width="350">{$lang.settings.use_video_approve}:&nbsp;</td>
									<td class="main_content_text" align="left"><input type="checkbox" name="use_video_approve" value="1" {if $data.use_video_approve}checked{/if}></td>
								</tr>*}
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.use_registration_approve}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="use_registration_approve" id="use_registration_approve" value="1" {if $data.use_registration_approve eq 1}checked{/if}></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.use_registration_confirmation}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="use_registration_confirmation" id="use_registration_confirmation" value="1" {if $data.use_registration_confirmation eq 1}checked{/if}></td>
								</tr>
								<tr><td colspan="2"><hr style="width: 100%;"></td></tr>
                                <tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.user_name_settings}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;">
                                    <input type="radio" name="user_name_settings" value="nickname" {if $data.use_fullname_on_site ne 1}checked{/if}/>{$lang.settings.nickname}&nbsp;&nbsp;
                                    <input type="radio" name="user_name_settings" value="full_name" {if $data.use_fullname_on_site eq 1}checked{/if}/>{$lang.settings.full_name}
									</td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.auth_login}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;">
                                    <input type="radio" name="use_method_auth" value="login" {if $data.use_method_auth eq 0}checked{/if}/>{$lang.settings.login}&nbsp;&nbsp;
									<input type="radio" name="use_method_auth" value="email" {if $data.use_method_auth eq 1}checked{/if}/>{$lang.settings.email}&nbsp;&nbsp;
									<input type="radio" name="use_method_auth" value="both" {if $data.use_method_auth eq 2}checked{/if}/>{$lang.settings.login}+{$lang.settings.email}&nbsp;&nbsp;
									</td>
								</tr>
								<tr><td colspan="2"><hr style="width: 100%;"></td></tr>
                                <tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.show_online_user_count}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="show_online_user_count" id="show_online_user_count" value="1" {if $data.show_online_user_count eq 1}checked{/if}></td>
								</tr>
								<tr class="userType" bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.add_fake_online_users}&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="add_fake_online_users" id="add_fake_online_users" value="1" {if $data.add_fake_online_users eq 1}checked{/if}></td>
								</tr>
								{* User types *}
								{foreach from=$user_types item=user_type}
									{* user types are unknown, and smarty doesn't seem to know how to work with variable variables, so... *}
									{php}
										$this->assign("onlineUserTypeValue", $this->_tpl_vars['data'][$this->_tpl_vars['user_type']['key']]);
									{/php}
										<tr class="userType" bgcolor="#FFFFFF">
											<td align="left" nowrap class="main_header_text" style="width:40%;padding-left:50px;">
												{$user_type.name}{if $user_type.noSubTypeUserCount && isset($user_type.subvalues)}&nbsp;({$lang.settings.no_subtype}){/if}:&nbsp;
											</td>
											<td class="main_content_text" align="left" style="width:60%;">
												{if $user_type.noSubTypeUserCount || false == isset($user_type.subvalues)}
													<input class="userType" maxlength="5" id="{$user_type.key}" type="text" name="{$user_type.key}" value="{$onlineUserTypeValue}" size=10>
													{*/<span id="{$user_type.key}_max">{if $user_type.noSubTypeUserCount}{$user_type.noSubTypeUserCount}{else}0{/if}</span>*}
												{/if}
											</td>
										</tr>
										{* User subtypes *}
										{if isset($user_type.subvalues)}
											<tbody class="userSubType">
											{foreach from=$user_type.subvalues item=user_subtype}
												{php}
													$this->assign("onlineUserTypeValue", $this->_tpl_vars['data'][$this->_tpl_vars['user_subtype']['key']]);
												{/php}
												{*$data.$user_subtype.value*}
												<tr bgcolor="#FFFFFF">
													<td align="left" nowrap class="main_header_text" style="width:40%; padding-left:100px;">{$user_subtype.name}:&nbsp;</td>
													<td class="main_content_text" align="left" style="width:60%;">
														<input class="userSubType" maxlength="5" title="" parentType="{$user_type.key}" type="text" name="{$user_subtype.key}" value="{$onlineUserTypeValue}" size=10>
														{*/<span id="{$user_subtype.key}_max">{if $user_subtype.userCount}{$user_subtype.userCount}{else}0{/if}</span>*}
													</td>
												</tr>
											{/foreach}
											</tbody>
										{/if}
								{/foreach}
								{*<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.online_women_count}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="text" name="online_women_count" value="{$data.online_women_count}" size=10>&nbsp;</td>
								</tr>*}
								<tr><td colspan="2"><hr style="width: 100%;"></td></tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.new_faces_period}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="text" name="new_faces_period" value="{$data.new_faces_period}" size=10>&nbsp;{$lang.periods.day}&nbsp;{$lang.settings.in_search}</td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.profile_limit}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="text" name="guest_profile_limit" value="{$data.guest_profile_limit}" size=10></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.mail_attaches_limit}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="text" name="mail_attaches_limit" value="{$data.mail_attaches_limit}" size=10></td>
								</tr>
								<!--tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.min_age_limit}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="text" name="min_age_limit" value="{$data.min_age_limit}" size=10></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.max_age_limit}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="text" name="max_age_limit" value="{$data.max_age_limit}" size=10></td>
								</tr-->
								<tr><td colspan="2"><hr style="width: 100%;"></td></tr>
								{*<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.show_users_name_str}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="show_users_name_str" value="1" {if $data.show_users_name_str}checked{/if}></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.show_users_sname_str}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="show_users_sname_str" value="1" {if $data.show_users_sname_str}checked{/if}></td>
								</tr>*}
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.show_users_zipcode_str}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="show_users_zipcode_str" value="1" {if $data.show_users_zipcode_str}checked{/if}></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.show_users_birthdate_str}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="show_users_birthdate_str" value="1" {if $data.show_users_birthdate_str}checked{/if}></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" class="main_header_text" style="width:40%;">{$lang.settings.show_users_connection_str}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="show_users_connection_str" value="1" {if $data.show_users_connection_str}checked{/if}></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.show_users_comments}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="show_users_comments" value="1" {if $data.show_users_comments}checked{/if}></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.show_users_group_str}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="show_users_group_str" value="1" {if $data.show_users_group_str}checked{/if}></td>
								</tr>
								<tr><td colspan="2"><hr style="width: 100%;"></td></tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.use_hide_profile_feature}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="use_hide_profile_feature" value="1" {if $data.use_hide_profile_feature}checked{/if}></td>
								</tr>
								<!--tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.use_humanized_profile_links}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;">
										<input type="checkbox" name="use_humanized_profile_links" value="1" {if $data.use_humanized_profile_links}checked{/if}>&nbsp;
										<a onclick="CheckUseLink('{$test_mod_rewrite}');">{$lang.settings.test_humanized_profile_links}</a>
										<span id='status' style="margin-left:10px;"></span>
									</td>
								</tr>
								<script language="JavaScript" type="text/javascript">
								{literal}
									var doc = null;
									function ajax() {
									// Make a new XMLHttp object
										if (typeof window.ActiveXObject != 'undefined' ) doc = new ActiveXObject("Microsoft.XMLHTTP");
										else doc = new XMLHttpRequest();
									}
								    function CheckUseLink(url){
										ajax();
										if (doc){
											doc.onreadystatechange = function() {
												if (doc.readyState == 4) {
													if (doc.responseText == 1){
														document.getElementById('status').innerHTML = "<font color='green'>* {/literal}{$lang.settings.yes_humanized_profile_links}{literal}</font>";
													}else{
														document.getElementById('status').innerHTML = "<font color='red'>* {/literal}{$lang.settings.no_humanized_profile_links}{literal}</font>";
													}
												} else {
													document.getElementById('status').innerHTML = "Checking...";
												}
											}
											doc.open("GET", url, true);
											doc.send(null);
										}
									}
									// Online users check
									$(document).ready(function() {
										var goodColor = $('input.userType').css('color');
										var badColor = 'red';
										var isInt = false;
										var error = false;
										var value;
										$('input.userType, input.userSubType').bind('focus', function() {
											value = parseInt($(this).val());
										})
										$('input.userType, input.userSubType').bind('keyup', function(e) {
											if($(this).val() == null || $(this).val() != parseInt($(this).val()) /*|| $(this).val() > parseInt($(this).next().html())*/) {
												error = true;
												$(this).css("color", badColor).css("border-color", badColor);
											} else {
												error = false;
												$(this).css("color",goodColor).css("border-color", goodColor);
											}
										})
										$('input.userType, input.userSubType').bind('change', function() {
											if (true == error || $(this).val() == '') {
												$(this).val(value?value:0);
												$(this).css("color",goodColor).css("border-color", goodColor);;
											}
										})
									})
								{/literal}
								</script-->
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.admin_settings.session_lifetime}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input id="session_lifetime" type="text" name="session_lifetime" value="{$data.session_lifetime}" size="6">&nbsp;{$lang.admin_settings.session_lifetime_second}</td>
								</tr>
								<tr><td colspan="2"><hr style="width: 100%;"></td></tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.date_format}:&nbsp;<br>
									</td>
									<td class="main_content_text" align="left" style="vertical-align:top;width:60%;">
										<select name="date_format" onchange="javascript: UpdateDate(this);" id=date_format>
											<option value="d-m-Y" {if $data.date_format eq 'd-m-Y'}selected{/if}>d-m-Y</option>
											<option value="e-m-Y" {if $data.date_format eq 'e-m-Y'}selected{/if}>e-m-Y</option>
											<option value="d-c-Y" {if $data.date_format eq 'd-c-Y'}selected{/if}>d-c-Y</option>
											<option value="e-c-Y" {if $data.date_format eq 'e-c-Y'}selected{/if}>e-c-Y</option>
											<option value="d-m-y" {if $data.date_format eq 'd-m-y'}selected{/if}>d-m-y</option>
											<option value="e-m-y" {if $data.date_format eq 'e-m-y'}selected{/if}>e-m-y</option>
											<option value="d-c-y" {if $data.date_format eq 'd-c-y'}selected{/if}>d-c-y</option>
											<option value="e-c-y" {if $data.date_format eq 'e-c-y'}selected{/if}>e-c-y</option>
											<option value="m-d-Y" {if $data.date_format eq 'm-d-Y'}selected{/if}>m-d-Y</option>
											<option value="m-e-Y" {if $data.date_format eq 'm-e-Y'}selected{/if}>m-e-Y</option>
											<option value="c-d-Y" {if $data.date_format eq 'c-d-Y'}selected{/if}>c-d-Y</option>
											<option value="c-e-Y" {if $data.date_format eq 'c-e-Y'}selected{/if}>c-e-Y</option>
											<option value="m-d-y" {if $data.date_format eq 'm-d-y'}selected{/if}>m-d-y</option>
											<option value="m-e-y" {if $data.date_format eq 'm-e-y'}selected{/if}>m-e-y</option>
											<option value="c-d-y" {if $data.date_format eq 'c-d-y'}selected{/if}>c-d-y</option>
											<option value="c-e-y" {if $data.date_format eq 'c-e-y'}selected{/if}>c-e-y</option>
											<option value="Y-m-d" {if $data.date_format eq 'Y-m-d'}selected{/if}>Y-m-d</option>
											<option value="Y-m-e" {if $data.date_format eq 'Y-m-e'}selected{/if}>Y-m-e</option>
											<option value="Y-c-d" {if $data.date_format eq 'Y-c-d'}selected{/if}>Y-c-d</option>
											<option value="Y-c-e" {if $data.date_format eq 'Y-c-e'}selected{/if}>Y-c-e</option>
											<option value="y-m-d" {if $data.date_format eq 'y-m-d'}selected{/if}>y-m-d</option>
											<option value="y-m-e" {if $data.date_format eq 'y-m-e'}selected{/if}>y-m-e</option>
											<option value="y-c-d" {if $data.date_format eq 'y-c-d'}selected{/if}>y-c-d</option>
											<option value="y-c-e" {if $data.date_format eq 'y-c-e'}selected{/if}>y-c-e</option>
										</select>
										<br>
											<table>
												<tr>
													<td class="main_content_text" style="paddingleft:0px;"><i>{$lang.settings.date_example}:</i></td>
													<td class="main_content_text">
														<i><div id="date_example">{$data.date_format_example}</div></i>
													</td>
												</tr>
											</table>
									</td>
								</tr>
								<script>
								{literal}
									function ZeroFormat(str, num){
										var len = str.length;
										num = num-len;
										for(var i=0; i < num; i++){
											str = '0'+str;
										}
										return str;
									}
								function UpdateDate(obj){
									var str = obj.value;
									var expr = new Array('Y', 'y', 'd', 'e', 'm', 'c');
									var newDateObj = new Date();									
									var day = newDateObj.getDate();
									day = day.toString( );
									var month = newDateObj.getMonth()+1;
									month = month.toString( );
									var year = newDateObj.getFullYear();
									year = year.toString( );
									var rep = new Array(year, year.substr(2), ZeroFormat(day, 2), day, ZeroFormat(month, 2), month);
									for (i in expr){
										while(str.lastIndexOf(expr[i])>=0){
											str = str.replace(expr[i], rep[i]);
										}
									}
									var date_div = document.getElementById('date_example');
									date_div.innerHTML = str;
									return;
								}
								{/literal}
								</script>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.zip_code_count}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="text" name="zip_count" value="{$data.zip_count}" size=10></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.zip_code_simvols}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="zip_letters" value="1" {if $data.zip_letters}checked{/if}></td>
								</tr>
								<tr><td colspan="2"><hr style="width: 100%;"></td></tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.use_mailbox}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="use_mailbox" value="1" {if $data.use_mailbox}checked{/if}></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left" nowrap class="main_header_text" style="width:40%;">{$lang.settings.use_pilot_module_organizer}:&nbsp;</td>
									<td class="main_content_text" align="left" style="width:60%;"><input type="checkbox" name="use_pilot_module_organizer" value="1" {if $data.use_pilot_module_organizer eq 3}checked{/if}></td>
								</tr>
								<tr bgcolor="#FFFFFF">
									<td align="left">
										<a href="#" id="save_settings" class="admin_button_major">{$lang.button.save}<span>&nbsp;</span></a>
									</td>
									<td align="left">
										<div id="error_box" class="error_box_blue"></div>
									</td>
								</tr>
		</table>
    </div>
    </form>
    <script language="JavaScript" type="text/javascript">
    {literal}
        var options = { 
            success: function(data){
				ajaxIndicator(0, 'error_box');
				ShowAjaxError(data, '', 'success');
                return false;
            },
            beforeSubmit: function() { 
                ajaxIndicator(1, 'error_box');
            }
        };
        $(document).ready(function(){
            $("#save_settings").click(function (){
                $('.settings_form').ajaxSubmit(options);
				return false;
            });
        });
    {/literal}
    </script>
{/if}
{if $sec eq 17}
	{if $ajax eq 0}
	<div class="panel">
		<div class="user_operation_line">
			<div class="uol_item">
				<div class="uol_in_item2" style="position:relative;">
					<div class="select_box" style="text-align: center; border: 0;" onclick="javascript: $('#active_themes').toggle();">
						{$lang.admin.design_management.tab_1_sub_1}
					</div>
					<div class="option_box" id="active_themes" style="margin-left:-10px;margin-top:5px;">
						{foreach from=$color_themes item=item name=color}
							<div class='option_box_item'>
								<div class='option_box_item_box' id='{$item.name}'>
									<div style='width:90%;float:left;'>{$item.title}</div>
									<div class='theme_list' id='active_{$item.name}' style='width:10%;float:left;{if $item.sel eq 1}display:block{else}display:none{/if};'>
										<img width="16" alt="" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.save}');return false" src="{$site_root}{$template_root}/images/success.png"> 
									</div>
									<div class="cr"></div>
								</div>
							</div>
						{/foreach}
						<div id='bottom_corner' style='height:5px;'></div>
					</div>
				</div>
			</div>
		</div>
		<div class="cr">&nbsp;</div>
		<div class="user_status_line" style="margin-bottom:0px;">
			<div id="tab_css" class="user_status_elem_active" onclick="ShowDesign('css');">
				{$lang.settings.section_name.17}
			</div>
			<div id="tab_styles" class="user_status_elem" onclick="ShowDesign('styles');">
				<a>{$lang.settings.section_name.117}</a>
			</div>
			<div id="tab_template" class="user_status_elem" onclick="ShowDesign('template');">
				<a>{$lang.admin.design_management.subtab_1_item_2}</a>
			</div>
			<div id="tab_theme" class="user_status_elem" onclick="ShowDesign('theme');">
				<a>{$lang.admin.design_management.subtab_1_item_3}</a>
			</div>
			<div id="tab_index" class="user_status_elem" onclick="ShowDesign('index');">
				<a>{$lang.admin.design_management.subtab_1_item_4}</a>
			</div>
			<div class="cr"></div>
			
			<div id="show_block">
	{/if}        
				<div class="panel_subtabs">
					<link rel="stylesheet" media="screen" type="text/css" href="{$site_root}{$template_root}/css/colorpicker.css"/>
					<script type="text/javascript" src="{$site_root}{$template_root}/js/colorpicker.js"></script>
						<div class="main_content_text">
							<dl class="design_dl">
								<dd class="fl design_left_dd"><b>{$lang.settings.color_theme}:&nbsp;</b></dd>
								<dd class="fl design_right_dd">
									<form method="GET" name="theme" id="theme" action="{$form.action}">
									<input type="hidden" name="section" value="17">
									{*<input type="hidden" name="sel" value="change">
									<input type="hidden" name="par" value="color">*}
									&nbsp;&nbsp;
									<select name="color_theme" style="width: 147px" onchange="document.theme.submit();">
									{foreach item=item from=$color_themes}
										<option value="{$item.name}" {if $item.sel_css eq 1}selected{/if}>{$item.title}</option>
									{/foreach}
									</select>
									</form>
								</dd>
							</dl>
						</div>
						<div class="main_content_text">
							<form method="POST" name="admin_form" id="admin_form" action="{$form.action}" enctype="multipart/form-data">
							<input type="hidden" name="sel" value="change"/>
							<input type="hidden" name="par" value="css"/>
							<input type="hidden" name="section" value="17"/>
							<input type="hidden" name="bg_picture_name" value="{$bg.bg_picture}"/>
							<input type="hidden" name="current_theme" value="{$current_theme}"/>
								<div id="colors"><b>{$lang.mobile.colors_management}</b></div>
								{foreach from=$colors name=color item=item}
									<dl class="design_dl">
										<dd class="fl design_left_dd">{$item.lang}:&nbsp;</dd>
										<dd class="fl design_right_dd">
											#<input type="text" name="color[{$item.name}]" id="color_{$smarty.foreach.color.iteration}" value="{$item.value}" size="8" />&nbsp;&nbsp;
											{if $smarty.foreach.color.iteration eq 1}
												<input type="hidden" disabled="disabled" id="bg_color_hid" name="color[{$item.name}]" value="{$item.value}" />
											{/if}
										</dd>
										<dd class="fl design_left_dd" style="width: 10%;">
											<div id="color_area_{$smarty.foreach.color.iteration}" style="background-color: #{$item.value}; width: 18px; height: 18px; border: 1px #000 solid;">&nbsp;</div>
											{if $item.tooltip_url}
											<img class="mtooltip1" style="position:relative; top: 1px;" src="{$site_root}{$template_root}/images/question_icon.gif" main_src="{$item.tooltip_url}">
											{/if}
										</dd>
										{literal}
											<script type="text/javascript">
												$(document).ready(function(){
													$('.mtooltip1').tooltip({
														delay: 0,
														showURL: false,
														bodyHandler: function() {
															return "<img src='" +$(this).attr('main_src')+"'>";
														}
													});
												});
											</script>
										{/literal}
										{if $smarty.foreach.color.iteration eq 1}
										<dd class="fl design_right_dd" style="margin: 0px; width: 17%;">
											<div align="right" style="float:left; padding-right:10px;">
												<input type="checkbox" id="use_bg_picture" name="use_bg_picture" value="1" {if $bg.bg_picture ne ''}checked{/if}>
											</div>
											<div align="left">
												{$lang.settings.css.use_bg_picture}
											</div>
										</dd>
										<dd class="fl design_right_dd">
											<input type="file" id="bg_picture" {if $bg.bg_picture eq ''}disabled{/if} name="bg_picture">
										</dd>
										{/if}
									</dl>
								{/foreach}
								<dl>
									<dd> 
										<div id="error_box_css">
										</div>
									</dd>
								</dl>
							</form>
						</div>
				</div>
				<div>
					<a href="#" class="admin_button_major" onclick="SaveCss(); return false;">{$lang.button.save}<span>&nbsp;</span></a>
					<a href="javascript:void(0)" style="float: right;" class="admin_button" onclick="Restore();">{$lang.button.restore}<span>&nbsp;</span></a>
				</div>
	{if $ajax eq 0}
			</div>              
		</div>          
		</div>
	</div>
	{/if}
{/if}

{if $sec eq 17}
    {literal}
    <script type="text/javascript">
        var tab_last = 'css';
        $(document).ready(function(){
            $("#use_bg_picture").click(function(){
                if ($('#use_bg_picture').is(':checked')) {
                    $("#bg_picture").removeAttr("disabled");
                    $("#bg_color_hid").removeAttr("disabled");
                    /*$("#color_1").attr("disabled", "disabled");
                    $("[name='color[bg_color_index]']").attr("disabled", "disabled");*/
				} else {
                    $("#bg_picture").attr("disabled", "disabled");
                    $("#bg_color_hid").attr("disabled", "disabled");
                    /*$("#color_1").removeAttr("disabled");
                    $("[name='color[bg_color_index]']").removeAttr("disabled");*/
                }
            });
            {/literal}{foreach from=$colors item=item name=color}{literal}
                $('#color_{/literal}{$smarty.foreach.color.iteration}{literal}').ColorPicker({
                    onSubmit: function(hsb, hex, rgb, el) {
                        $(el).val(hex);
                        $(el).ColorPickerHide();
                        $('#color_area_{/literal}{$smarty.foreach.color.iteration}{literal}').css({'background-color' : hex});
                    },
                    onBeforeShow: function () {
						$(this).ColorPickerSetColor(this.value);
                    }
				});
            {/literal}{/foreach}{literal}
            
            $('#bottom_corner').corner("bottom 3px");
            $(".option_box_item_box").hover(
                function(){
                    $(this).addClass('option_box_item_box_hover');
                },
                function () {
                    $(this).removeClass('option_box_item_box_hover');
                }
            );
			$(".option_box_item_box").click(function(){
				if(!DEMO_MODULE){
					$.post('admin_settings.php',{sel:'change',par:'color',color_theme:this.id});
					$(".theme_list").css('display','none');
					$("#active_"+this.id).css('display','block');
					$('#active_themes').oneTime(500, function() {
						$("#active_themes").css('display','none');
					});
				}else{
					ShowAjaxError('{/literal}{$lang.err.demo_mode}{literal}','','error');
				}
			});
        });
	function Restore() {
            var url = "{/literal}{$form.action}{literal}?sel=change&par=css&section=17&restore={/literal}{$current_theme}&current_theme={$current_theme}{literal}";
            ajaxIndicator(1, 'error_box_css');
            $.post(url, '', function(data){
                ajaxIndicator(0, 'error_box_css');
				ShowAjaxError(data);
				location.href='';
            });
        }
        function ShowDesign(par) {
            if ($('#tab_'+par).find('a').text() == '') return;

            $('#tab_'+tab_last).html("<a>"+$('#tab_'+tab_last).text()+"<\/a>");
            $('#tab_'+par).text($('#tab_'+par).text());

            $('#tab_'+tab_last).removeClass('user_status_elem_active');
            $('#tab_'+tab_last).addClass('user_status_elem');
            $('#tab_'+par).removeClass('user_status_elem');
            $('#tab_'+par).addClass('user_status_elem_active');
            var sec = '7';
            if (par == 'css') sec = '17';
            if (par == 'index') sec = '32';
			if (par == 'styles') sec = '117';
            ajaxLoadingImage(1, 'show_block');
            $.post("admin_settings.php", {section:sec,ajax:'1',subsec:par}, function(data){
                ajaxLoadingImage(0, 'show_block');
                $('#show_block').html(data);
            });
            tab_last = par;
        }
		
        var options_css = { 
            success: function(data){
				ShowAjaxError(data, '', 'success');
				ajaxIndicator(0, 'error_box_css');
                return false;
            },
            beforeSubmit: function() { 
                ajaxIndicator(1, 'error_box_css');
            }
        };
		
        function SaveCss() {
            $('#admin_form').ajaxSubmit(options_css);
            return false;
        }
        function SaveDesign() {           
            $('#change_design_colors').ajaxSubmit(options_css);  
            return false;
        }    
    </script>
    {/literal}
{/if}

{if $sec eq 117}
	<script>                       
		{literal}
		var tab_last = 'styles';
        function ShowDesign(par) {
            if ($('#tab_'+par).find('a').text() == '') return;

            $('#tab_'+tab_last).html("<a>"+$('#tab_'+tab_last).text()+"<\/a>");
            $('#tab_'+par).text($('#tab_'+par).text());

            $('#tab_'+tab_last).removeClass('user_status_elem_active');
            $('#tab_'+tab_last).addClass('user_status_elem');
            $('#tab_'+par).removeClass('user_status_elem');
            $('#tab_'+par).addClass('user_status_elem_active');
            var sec = '7';
            if (par == 'css') sec = '17';
            if (par == 'index') sec = '32';
			if (par == 'styles') sec = '117';
            ajaxLoadingImage(1, 'show_block');
            $.post("admin_settings.php", {section:sec,ajax:'1',subsec:par}, function(data){
                ajaxLoadingImage(0, 'show_block');
                $('#show_block').html(data);
            });
            tab_last = par;
        }
		
		function toggleDiv(divId) {
		$("#"+divId).toggle();
		}
		function pickColorPicker(id, color, param){
			param = param || '';
			$('#'+id+'_color').ColorPicker({
					color: color,
					onShow: function (cp) {
							$(cp).fadeIn(300);
							return false;
					},
					onHide: function (cp) {
							$(cp).fadeOut(300);
							return false;
					},
					onSubmit: function(hsb, hex, rgb, el) {
						if(param == 'my')
							$('#'+id+'_color').css('backgroundColor', '#'+hex);
						else      
							$('#'+id+'_color div').css('backgroundColor', '#'+hex);
						$('#'+id+'_text').val(hex);
						$(el).val(hex);
						$(el).ColorPickerHide();
					}
			});
			$('#'+id+'_color').ColorPickerShow();
		}
		$(document).ready(function(){
			$(".my_theme_sq").click(function(){
				var my_color = $(this).css('background-color');
				$('html').css('background-image', 'url('+my_bg_image+')');
				   // alert(my_bg_image);
				$(".my_theme_sq").css('border','1px solid black');
				//$(".my_theme_sq").css('background-image','none');    
				$(this).css('border','1px solid red');
				$("#mybg_img").val(this.id);
				
				$.ajax({
					type: "POST",
					url: "admin_settings.php",                           
					data: "sel=get_home_colors&bg_img="+this.id,
					success: function(msg){
						var theme_color = $.parseJSON(msg);
							
						$("#bg_content_color_color").css('background-color', '#'+theme_color.bg_content_color);     
						$("#bg_content_color_text").val(theme_color.bg_content_color);
							
						$("#main_text_color_color").css('background-color', '#'+theme_color.main_text_color);     
						$("#main_text_color_text").val(theme_color.main_text_color);
							
						$("#home_menu_color").css('background-color', '#'+theme_color.home_menu);     
						$("#home_menu_text").val(theme_color.home_menu);
							
						$("#link_color").css('background-color', '#'+theme_color.link);     
						$("#link_text").val(theme_color.link);
						 
						$("#tabs_block_border_color").css('background-color', '#'+theme_color.tabs_block_border);     
						$("#tabs_block_border_text").val(theme_color.tabs_block_border);  
					}
				 });
			});
		})
		{/literal}
	</script>
	{if !$ajax}
		<div class="panel">
			<div class="user_operation_line">
				<div class="uol_item">
					<div class="uol_in_item2" style="position:relative;">
						<div class="select_box" style="text-align: center; border: 0;" onclick="javascript: $('#active_themes').toggle();">
							{$lang.admin.design_management.tab_1_sub_1}
						</div>
						<div class="option_box" id="active_themes" style="margin-left:-10px;margin-top:5px;">
							{foreach from=$color_themes item=item name=color}
								<div class='option_box_item'>
									<div class='option_box_item_box' id='{$item.name}'>
										<div style='width:90%;float:left;'>{$item.title}</div>
										<div class='theme_list' id='active_{$item.name}' style='width:10%;float:left;{if $item.sel eq 1}display:block{else}display:none{/if};'>
											<img width="16" alt="" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.save}');return false" src="{$site_root}{$template_root}/images/success.png"> 
										</div>
										<div class="cr"></div>
									</div>
								</div>
							{/foreach}
							<div id='bottom_corner' style='height:5px;'></div>
						</div>
					</div>
				</div>
			</div>
			<div class="cr">&nbsp;</div>
			<div class="user_status_line" style="margin-bottom:0px;">
				<div id="tab_css" class="user_status_elem" onclick="ShowDesign('css');">
					<a>{$lang.settings.section_name.17}</a>
				</div>
				<div id="tab_styles" class="user_status_elem_active" onclick="ShowDesign('styles');">
					{$lang.settings.section_name.117}
				</div>
				<div id="tab_template" class="user_status_elem" onclick="ShowDesign('template');">
					<a>{$lang.admin.design_management.subtab_1_item_2}</a>
				</div>
				<div id="tab_theme" class="user_status_elem" onclick="ShowDesign('theme');">
					<a>{$lang.admin.design_management.subtab_1_item_3}</a>
				</div>
				<div id="tab_index" class="user_status_elem" onclick="ShowDesign('index');">
					<a>{$lang.admin.design_management.subtab_1_item_4}</a>
				</div>
				<div class="cr"></div>
				<div id="show_block">
	{/if}
					<div class="panel_subtabs">
						<h3>{$lang.organizer.my_change_styles}</h3>
						<div style="float:left;">      
						   {section name = mySection start = 0 loop = 10 step = 1}              
								<div {if $mycolors.mybg_img == $smarty.section.mySection.index}style="border:1px solid red;"{/if} id="{$smarty.section.mySection.index}" class="my_theme_sq  my_theme_cust{$smarty.section.mySection.index}"></div>
						   {/section}
						</div>
						<form name="change_design_colors" id="change_design_colors" action="{$form.action}" method="POST" style="margin: 0px;" enctype="multipart/form-data">
							<div style="margin-bottom:30px;">
								<input type="button" value="{$lang.organizer.change_bg_image}" onclick="toggleDiv('change_bg_image');$('#change_design').css('display', 'none');">
								<input type="button" value="{$lang.organizer.change_design}" onclick="toggleDiv('change_design');$('#change_bg_image').css('display', 'none');">
							</div>
							<div id="change_bg_image" style="display:none;float:left;padding-top: 10px;">
								<input type="hidden" name="sel" value="change"/>
								<input type="hidden" name="par" value="css"/>
								<input type="hidden" name="section" value="17"/>
								<input type="hidden" name="bg_picture_name" value="{$bg.bg_picture}"/>
								<input type="hidden" name="current_theme" value="{$current_theme}"/> 
								<input type="hidden" id="mybg_img" name="mybg_img" value="10">
								<div align="right" style="float:left; padding-right:10px;">
									<input type="checkbox" id="use_bg_picture" name="use_bg_picture" value="1">
								</div>
								<div align="left">
									{$lang.settings.css.use_bg_picture}
								</div>
								<input type="file" id="bg_picture" name="bg_picture" onchange="$('#my_bg_image').css('border','double 4px black');$('#my_bg_image').css('background','#E6E1E1');$('#my_bg_image').text('')">&nbsp;
								<br><br>
								{$lang.organizer.img_text}
								<br><br>
								<div id="my_bg_image" class="my_bg_image">
									{$lang.organizer.no_bg_img}
								</div>
								<div style="margin-bottom:10px;">
									<label><input type="checkbox" name="tile_bg" id="tile_bg"> {$lang.organizer.tile_bg}</label>
								</div>
							</div>
							<div id="change_design" style="float:left;display:none;padding-left: 1px;margin-bottom: 50px;">
								<div class="div_head">
									{$lang.organizer.background}
									<div id="bg_content_color_color" style="background-color:#{$mycolors.bg_content_color};" class="my_change" onclick="pickColorPicker('bg_content_color', '#{$mycolors.bg_content_color}','my')">
										<input id="bg_content_color_text" type="hidden" size="6" value="{$mycolors.bg_content_color}" name="color[bg_content_color]">
									</div>
								</div> 

								<div class="div_head">
									{$lang.organizer.main_texts}
									<div id="main_text_color_color" style="background-color:#{$mycolors.main_text_color};" class="my_change" onclick="pickColorPicker('main_text_color', '#{$mycolors.main_text_color}','my')">
										<input id="main_text_color_text" type="hidden" size="6" value="{$mycolors.main_text_color}" name="color[main_text_color]">
									</div >
								</div>

								<div class="div_head">
									{$lang.organizer.headlines}
									<div id="home_menu_color" style="background-color:#{$mycolors.home_menu};" class="my_change" onclick="pickColorPicker('home_menu', '#{$mycolors.home_menu}','my')">
										<input id="home_menu_text" name="color[home_menu]" type="hidden" size="6" value="{$mycolors.home_menu}">
									</div>
								</div>

								<div class="div_head">
									{$lang.organizer.links}
									<div id="link_color" style="background-color:#{$mycolors.link};" class="my_change" onclick="pickColorPicker('link', '#{$mycolors.link}','my')">
										<input id="link_text" type="hidden" size="6" value="{$mycolors.link}" name="color[link]">       
									</div>
								</div>

								<div class="div_head">
									{$lang.organizer.active_tabs}
									<div id="tabs_block_border_color" style="background-color:#{$mycolors.tabs_block_border};" class="my_change" onclick="pickColorPicker('tabs_block_border', '#{$mycolors.tabs_block_border}','my')">
										<input id="tabs_block_border_text" type="hidden" size="6" value="{$mycolors.tabs_block_border}" name="color[tabs_block_border]">
									</div>
								</div>
								{foreach name=color item=item from=$colors}
									{if  $item.name ne 'bg_picture_path' && $item.name ne 'bg_picture' && $item.name ne 'link' && $item.name ne 'main_text_color' && $item.name ne 'tabs_block_border' && $item.name ne 'bg_content_color' && $item.name ne 'home_menu'}    
										<input type="hidden" name="color[{$item.name}]" id="color_{$smarty.foreach.color.iteration}" value="{$item.value}" size="6">
									{/if}
								{/foreach}
							</div>                   
						</form>
					</div>
	{if !$ajax}
				</div>
			</div>
		</div>
	{/if}
	
	<div>
		<a href="#" class="admin_button_major" onclick="SaveDesign()">{$lang.button.save}<span>&nbsp;</span></a>
		<a href="" style="float: right;" class="admin_button" onclick="Restore();">{$lang.button.restore}<span>&nbsp;</span></a>
	</div>           
{/if}
{if $sec eq 32}
<div class="panel">
    <div class="user_operation_line">    
        <div class="uol_item">
            <div class="uol_in_item2" style="position:relative;">
                <div class="select_box" style="text-align: center; border: 0;" onclick="javascript: $('#active_themes').toggle();">
                    {$lang.admin.design_management.tab_1_sub_1}
                </div>
                <div class="option_box" id="active_themes" style="margin-left:-10px;margin-top:5px;">
                    {foreach from=$themes item=item name=color}
                        <div class='option_box_item'>
                            <div class='option_box_item_box' id='{$item.name}'>
                                <div style='width:90%;float:left;'>{$item.title}</div>
                                <div class='theme_list' id='active_{$item.name}' style='width:10%;float:left;{if $item.sel eq 1}display:block{else}display:none{/if};'>
                                    <img width="16" alt="" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.save}');return false" src="{$site_root}{$template_root}/images/success.png"> 
                                </div>
                                <div class="cr"></div>
                            </div>
                        </div>
                    {/foreach}
                    <div id='bottom_corner' style='height:5px;'></div>
                </div>
            </div>
        </div>    
    </div>
    <div class="cr">&nbsp;</div>
    <div class="user_status_line" style="margin-bottom:0px;">
        <div id="tab_css" class="user_status_elem" onclick="ShowDesign('css');">
            <a>{$lang.settings.section_name.17}</a>
        </div>
        <div id="tab_styles" class="user_status_elem" onclick="ShowDesign('styles');">
            <a>{$lang.settings.section_name.117}</a>
        </div>
        <div id="tab_template" class="user_status_elem" onclick="ShowDesign('template');">
            <a>{$lang.admin.design_management.subtab_1_item_2}</a>
        </div>
        <div id="tab_theme" class="user_status_elem" onclick="ShowDesign('theme');">
            <a>{$lang.admin.design_management.subtab_1_item_3}</a>
        </div>
        <div id="tab_index" class="user_status_elem_active" onclick="ShowDesign('index');">
            {$lang.admin.design_management.subtab_1_item_4}
        </div>
        <div class="cr"></div>
    {include file="$admingentemplates/admin_settings_index.tpl"}
    </div>
</div>

<script type="text/javascript">
{literal}
	var tab_last = 'index';
	$(document).ready(function(){
		$('#bottom_corner').corner("bottom 3px");
		$(".option_box_item_box").hover(
			function(){
				$(this).addClass('option_box_item_box_hover');
			},
			function () {
				$(this).removeClass('option_box_item_box_hover');
			}
		);
		$(".option_box_item_box").click(function(){
			$.post('admin_settings.php',{sel:'change',par:'color',color_theme:this.id});
			$(".theme_list").css('display','none');
			$("#active_"+this.id).css('display','block');
			$('#active_themes').oneTime(500, function() {
				$("#active_themes").css('display','none');
			});
		});
	});

	function ShowDesign(par) {
		if ($('#tab_'+par).find('a').text() == '') return;

		$('#tab_'+tab_last).html("<a>"+$('#tab_'+tab_last).text()+"<\/a>");
		$('#tab_'+par).text($('#tab_'+par).text());

		$('#tab_'+tab_last).removeClass('user_status_elem_active');
		$('#tab_'+tab_last).addClass('user_status_elem');
		$('#tab_'+par).removeClass('user_status_elem');
		$('#tab_'+par).addClass('user_status_elem_active');
		var sec = '7';
		if (par == 'css') sec = '17';
		if (par == 'index') sec = '32';
		if (par == 'styles') sec = '117';
		ajaxLoadingImage(1, 'show_block');
		$.post("admin_settings.php", {section:sec,ajax:'1',subsec:par}, function(data){
			ajaxLoadingImage(0, 'show_block');
			$('#show_block').html(data);
		});
		tab_last = par;
	}
{/literal}
</script>
{/if}

{if $sec eq 7}
    {if $subsec eq 'template'}
        <div class="panel_subtabs">
			<div class="main_content_text">
				<table cellSpacing="0" cellPadding="0" border="0" width="100%" >
					<tr><td colspan="3">&nbsp;</td></tr>
				<form id="template_form" name="template_form" action="{$form.action}" method="POST" enctype="multipart/form-data">
					<input type="hidden" name="par" value="template">
					<input type="hidden" name="sel" value="change">
					<input type="hidden" name="section" value="7">
					<tr>
						<td width="17%" class="main_header_text">{$lang.settings.site_template}:&nbsp;</td>
						<td class="main_content_text" align="left">
							<select name="template" style="width: 283px" onchange="selectTemplate(this.value);">
							{section name=s loop=$templates}
								<option value="{$templates[s].value}" {if $templates[s].sel eq 1}selected{/if}>{$templates[s].name}</option>
							{/section}
							</select>
						</td>
						<td class="main_header_text" align="left" width="65%">&nbsp;</td>
					</tr>
					<tr height="10">
						<td colspan="2" ></td>
						<td align="left">
							<!--div class="error_box_blue" id="error_box_template">
							</div-->
						</td>
					</tr>
				</form>
				<form id="add_template_form" name="add_template_form" action="{$form.action}" method="post">
					<input type="hidden" name="sel" value="add_template">
					<input type="hidden" name="section" value="7">
					<tr>
						<td width="17%" class="main_header_text">{$lang.settings.template_name}:&nbsp;</td>
						<td class="main_content_text" align="left">
						{section name=s loop=$templates}
							<input {if $templates[s].sel != 1}style="display:none;"{/if} type="text" name="templ_name" value="{$templates[s].name}" size="45" id="templ_name_{$templates[s].value}">
						{/section}
						</td>
						<td class="main_header_text" align="left" width="65%">&nbsp;</td>
					</tr>
					<tr>
						<td colspan="3" style="height:10px;"></td>
					</tr>
					<tr>
						<td width="17%" class="main_header_text">{$lang.settings.template_path}:&nbsp;</td>
						<td class="main_content_text" align="left">
						{section name=s loop=$templates}
							<input {if $templates[s].sel != 1}style="display:none;"{/if} type="text" name="templ_path" value="{$templates[s].path}" size="45" id="templ_path_{$templates[s].value}">
						{/section}
						</td>
						<td class="main_content_text" align="left" width="65%">&nbsp;<i>{$lang.settings.template_comment}</i></td>
					</tr>
					<tr height="10"><td colspan="3"></td></tr>
					<tr>
						<td colspan="3">
							<div style="padding:10px 0;" class="error_box_blue" id="error_box_template">
							</div>
						</td>
					</tr>            
				</form>
				</table>
			</div>
        </div>
        <div>
            <a href="#" class="admin_button_major" onclick="SaveTemplate()">{$lang.button.save}<span>&nbsp;</span></a>
            <a href="#" class="admin_button" onclick="AddTemplate()">{$lang.settings.add_new_template}<span>&nbsp;</span></a>
        </div>
    {/if}
    {if $subsec eq 'theme'}
        <div class="panel_subtabs">
			<div class="main_content_text">
				<form id="add_theme_form" name="add_theme_form" action="{$form.action}" method="post">
					<input type="hidden" name="sel" value="add_theme">
					<input type="hidden" name="theme_tpl" id="theme_tpl" value="{$data.theme_tpl}">
					<input type="hidden" name="section" value="7">
					<table cellSpacing="0" cellPadding="0" border="0" width="100%" >
						<tr><td colspan="3">&nbsp;</td></tr>
						<tr>
							<td width="17%" class="main_header_text">{$lang.settings.theme_name}:&nbsp;</td>
							<td class="main_content_text" align="left">
								<select name="theme" id="theme_select" style="width: 283px">
								{foreach from=$themes item=theme}
									<option value="{$theme.value}" {if $theme.sel eq 1}selected{/if}>{$theme.name}</option>
								{/foreach}
								</select>
							</td>
							<td class="main_header_text" align="left" width="65%">&nbsp;</td>
						</tr>
						<tr>
							<td colspan="3" style="height:10px;"></td>
						</tr>
						<tr>
							<td width="17%" class="main_header_text">{$lang.settings.theme_name}:&nbsp;</td>
							<td class="main_content_text" align="left"><input type="text" name="theme_name" id="theme_name" value="{$data.theme_name}" size=45></td>
							<td class="main_header_text" align="left" width="65%">&nbsp;</td>
						</tr>
						<tr>
							<td colspan="3" style="height:10px;"></td>
						</tr>
						<tr>
							<td width="17%" class="main_header_text">{$lang.settings.theme_css_path}:&nbsp;</td>
							<td class="main_content_text" align="left"><input type="text" name="theme_css_path" id="theme_css_path" value="{$data.theme_css_path}" size=45></td>
							<td class="main_content_text" align="left" width="65%">&nbsp;<i>{$lang.settings.theme_css_comment}</i></td>
						</tr>
						<tr>
							<td colspan="3" style="height:10px;"></td>
						</tr>
						<tr>
							<td width="17%" class="main_header_text">{$lang.settings.theme_images_path}:&nbsp;</td>
							<td class="main_content_text" align="left"><input type="text" name="theme_images_path" id="theme_images_path" value="{$data.theme_images_path}" size=45></td>
							<td class="main_content_text" align="left" width="65%">&nbsp;<i>{$lang.settings.theme_images_comment}</i></td>
						</tr>
						 <tr>
							<td colspan="3" style="height:10px;"></td>
						</tr>
					
					</table>
				</form>
			</div>
        </div>
        <div>
            <a href="javascript:void(0)" class="admin_button_major" onclick="SaveTheme()">{$lang.button.save}<span>&nbsp;</span></a>
            <a href="javascript:void(0)" class="admin_button" onclick="AddTheme()">{$lang.settings.add_new_theme}<span>&nbsp;</span></a>
        </div>
    {/if}
    {literal}
    <script type="text/javascript">
        function SaveTemplate() {
            var template_sel = $('select[name="template"]').val();
			$.post('admin_settings.php',{sel:'change',par:'template',section:'7',template:template_sel},
                function(data){
					ShowAjaxError(data, '');
                }
            );
        }
    
        function AddTemplate() {
            var templ_name = $('input[name="templ_name"]').val();
            var templ_path = $('input[name="templ_path"]').val();
			$.post('admin_settings.php',{sel:'add_template',section:'7',templ_name:templ_name,templ_path:templ_path},
                function(data){
                    if (data == 'saved') {
						ShowAjaxError(data, '', 'success');
                        ajaxLoadingImage(1, 'show_block');
                        $.post("admin_settings.php", {section:'7',ajax:'1',subsec:'template'}, function(data){
                            ajaxLoadingImage(0, 'show_block');
                            $('#show_block').html(data);
                        });
                    } else {
						ShowAjaxError(data, '', 'error');
                    }
                }
            );
        }
		
        function SaveTheme() {
            var theme = $('#theme_select').val();
			$.post(
				'admin_settings.php',
				{
					ajax: 1,
					sel: 'change',
					par: 'theme',
					section: '7',
					theme: theme
				},
                function(data){
					ShowAjaxError(data, '');
                }
            );
        }
    
        function AddTheme() {
            var theme_name = $('#theme_name').val();
            var theme_css = $('#theme_css_path').val();
            var theme_images = $('#theme_images_path').val();
            var theme_tpl = $('#theme_tpl').val();
			$.post(
				'admin_settings.php',
				{
					sel: 'add_theme',
					section: '7',
					theme_css_path: theme_css,
					theme_images_path: theme_images,
					theme_tpl: theme_tpl,
					theme_name: theme_name,
					ajax: 1
				},
                function(data){
					if(data.status === 'succ'){
						ShowAjaxError(data.msg, '', 'success');
						ajaxLoadingImage(1, 'show_block');
						$.post("admin_settings.php", {section: 7, ajax: '1', subsec: 'theme'}, function(data){
							ajaxLoadingImage(0, 'show_block');
							$('#show_block').html(data);
						});
					}else{
						ShowAjaxError(data.msg, '', 'error');
					}
                },
				'json'
            );
        }
		function selectTemplate(id){
			$("input[name^='templ_name']").hide();
			$("input[id='templ_name_"+id+"']").show();
			$("input[id^='templ_path']").hide();
			$("input[id='templ_path_"+id+"']").show();
				
		}
    </script>
    {/literal}
{/if}
{if $sec eq '9'}
	<link type="text/css" href="{$site_root}{$template_root}/css/jquery.css" rel="stylesheet">
	<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/jquery-ui.js"></script>
	{literal}
	<script language="JavaScript" type="text/javascript">
		$(document).ready(function(){
			$("#add_special_logo").click(function () {
				document.getElementById('special_logotype_name').value = "";
				document.getElementById('date_start').value = "";
				document.getElementById('date_end').value = "";
				document.getElementById('special_logotype_id').value = "";
				document.getElementById('special_logotype_width').value = "";
				document.getElementById('special_logotype_height').value = "";
				document.getElementById('special_logotype_old').value = "";
				document.getElementById('special_logotype_show').innerHTML = '';
				return false;
			});
		});
		{/literal}
		{foreach from=$special_logotype item=item}
		{literal}
		$(document).ready(function(){
			$("#edit{/literal}{$item.id}{literal}").click(function () {
				$("#special_logo").show();
				return false;
			});
		});
		{/literal}
		{if $special_logotype_name ne ''}
		{literal}
		$(document).ready(function(){
			$("#special_logo").show();
		});
		{/literal}
		{/if}
		{/foreach}
		{literal}
		$(function() {
			$.datepicker.setDefaults($.extend({showMonthAfterYear: false}));
			$("#date_start").datepicker({changeMonth: true, changeYear: true, showOn: 'button', buttonImage: '{/literal}{$site_root}{$template_root}{literal}/images/calendar.gif', buttonImageOnly: true});
			$("#date_end").datepicker({changeMonth: true, changeYear: true, showOn: 'button', buttonImage: '{/literal}{$site_root}{$template_root}{literal}/images/calendar.gif', buttonImageOnly: true});
		});
		function edit(par_name,par_start,par_end,par_id,par_value,par_width,par_height,par_type) {
			document.getElementById('special_logotype_name').value = par_name;
			document.getElementById('date_start').value = par_start;
			document.getElementById('date_end').value = par_end;
			document.getElementById('special_logotype_id').value = par_id;
			document.getElementById('special_logotype_width').value = par_width;
			document.getElementById('special_logotype_height').value = par_height;
			document.getElementById('special_logotype_old').value = par_value;
			if (par_type == 'image') {
				document.getElementById('special_logotype_show').innerHTML = '<table cellpadding="0" cellspacing="0"><tr><td style="border: 1px solid silver; padding: 1px;"><a href="{/literal}{$site_root}{$top_menu.index}{literal}"><img src="{/literal}{$site_root}{literal}'+par_value+'" border="0" alt="" width="'+par_width+'" height="'+par_height+'"></a></td></tr></table>';
			} else {
				document.getElementById('special_logotype_show').innerHTML = '<table cellpadding="0" cellspacing="0"><tr><td style="padding: 1px;">{/literal}{$site_root}{literal}'+par_value+'</td></tr></table>';
			}
		}
	</script>
	{/literal}
<div class="panel">
	<div class="user_operation_line" style="height: 5px;">
	</div>
    <div class="cr">&nbsp;</div>
    <div class="user_status_line">
        <div id="tab_default" class="{if $tab eq 'default'}user_status_elem_active{else}user_status_elem{/if}" onclick="location.href='admin_settings.php?section=9&tab=default'">
            {if $tab eq 'default'}
            {$lang.admin.settings_9.default_logo}
            {else}
            <a>{$lang.admin.settings_9.default_logo}</a>
            {/if}
        </div>
        <div id="tab_special" class="{if $tab eq 'special'}user_status_elem_active{else}user_status_elem{/if}" onclick="location.href='admin_settings.php?section=9&tab=special'">
        	{if $tab eq 'special'}
        	{$lang.admin.settings_9.spacial_logo}
        	{else}
            <a>{$lang.admin.settings_9.spacial_logo}</a>
            {/if}
        </div>
        <div class="cr"></div>
        <div id="show_block">
			<div class="panel_subtabs">
				<div class="main_content_text">
					<table cellSpacing="0" cellPadding="0" border="0" width="100%" >				
						{if $tab eq 'default'}
						<tr>
							<td colspan="3">
							<form name="images_form" action="{$form.action}" method="post" enctype="multipart/form-data">
							<input type="hidden" name="par" value="site_images">
							<input type="hidden" name="sel" value="change">
							<input type="hidden" name="section" value="9">
							<input type="hidden" name="tab" value="default">
								<table width="700" cellpadding="5" cellspacing="1">
									<tr>
										<td nowrap>{$lang.settings.site_top_logo}:&nbsp;</td>
										<td class="main_content_text" align="left">
											<input type="file" name="site_logotype">
										</td>
										<td align="left">
											<input type="checkbox" name="restore_logotype" value="1">&nbsp;{$lang.settings.restore_logotype}
										</td>
									</tr>
									<tr>
										<td nowrap>{$lang.settings.site_logotype_width}:&nbsp;</td>
										<td class="main_content_text" align="left">
											<input type="text" name="site_logotype_width" value="{$logo_setup.site_logotype_width}" size="15">
										</td>
										<td align="left" width="65%">&nbsp;</td>
									</tr>
									<tr>
										<td nowrap>{$lang.settings.site_logotype_height}:&nbsp;</td>
										<td class="main_content_text" align="left">
											<input type="text" name="site_logotype_height" value="{$logo_setup.site_logotype_height}" size="15">
										</td>
										<td align="left" width="65%">&nbsp;</td>
									</tr>
									{if $logo_setup.site_top_logotype!=''}
									<tr>
										<td colspan="3">
											<table cellpadding="0" cellspacing="0">
												<tr>
													<td style="border: 1px solid silver; padding: 1px;">
														{if $logo_setup.site_logotype_format=='image'}
														<a href="{$site_root}{$top_menu.index}"><img src="{$site_root}{$logo_setup.site_top_logotype}" border="0" alt="" width="{$logo_setup.site_logotype_width}" height="{$logo_setup.site_logotype_height}"></a>
														{else}
														<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
															width="780" height="233" type="application/x-shockwave-flash">
															<param name="movie" value="{$site_root}{$logo_setup.site_top_logotype}" >
															<param name="quality" value="high" >
															<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" >
															<embed src="{$site_root}{$logo_setup.site_top_logotype}" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="{$logo_setup.site_logotype_width}" height="{$logo_setup.site_logotype_height}"></embed>
														</object>
														{/if}
													</td>
												</tr>
											</table>
										</td>
									</tr>
									{/if}							
								</table>
							</form>
							</td>
						</tr>
						{else}
						<tr>
							<td colspan="3">
							<form name="images_form" action="{$form.action}" method="post" enctype="multipart/form-data">
							<input type="hidden" name="par" value="special_logotype">
							<input type="hidden" name="sel" value="change">
							<input type="hidden" name="section" value="9">
							<input type="hidden" name="tab" value="special">
								<div id="special_logo">
									<table width="100%" cellpadding="5" cellspacing="1" border="0">
										<tr>
											<td nowrap>{$lang.settings.site_top_specal_logo}:&nbsp;</td>
											<td class="main_content_text" align="left">
												<input type="text" id="special_logotype_name" name="special_logotype_name" value="{$special_logotype_name}" size="20">
												<input type="hidden" id="special_logotype_id" name="special_logotype_id" value="{$special_logotype_id}">
												<input type="hidden" id="special_logotype_old" name="special_logotype_old" value="{$special_logotype_old}">
											</td>
										</tr>
										<tr>
											<td align="left" nowrap>{$lang.settings.site_top_logo}:&nbsp;</td>
											<td class="main_content_text" align="left">
												<input type="file" name="special_logotype">
											</td>
										</tr>
										<tr>
											<td align="left" nowrap >{$lang.settings.site_logotype_width}:&nbsp;</td>
											<td class="main_content_text" align="left">
												<input type="text" id="special_logotype_width" name="special_logotype_width" value="{$width}" size="20">
											</td>
											<td align="left" width="65%">&nbsp;</td>
										</tr>
										<tr>
											<td align="left" nowrap>{$lang.settings.site_logotype_height}:&nbsp;</td>
											<td class="main_content_text" align="left">
												<input type="text" id="special_logotype_height" name="special_logotype_height" value="{$height}" size="20">
											</td>
											<td align="left" width="65%">&nbsp;</td>
										</tr>
										<tr>
											<td align="left" nowrap><b>{$lang.admin.settings_9.spacial_logo_date}:</b>&nbsp;</td>
										</tr>
										<tr>
											<td nowrap>{$lang.admin.settings_9.spacial_logo_date_start}&nbsp;</td>
											<td class="main_content_text" align="left">
												<input type="text" value="{$date_start}" id="date_start" name="date_start" style="margin-right:5px;" onmousedown="{literal}$('#date_start').datepicker('show');{/literal}" readonly>
											</td>
											<td align="left" width="65%">&nbsp;</td>
										</tr>
										<tr>
											<td>{$lang.admin.settings_9.spacial_logo_date_end}&nbsp;</td>
											<td class="main_content_text" align="left">
												<input type="text" value="{$date_end}" id="date_end" name="date_end" style="margin-right:5px;" onmousedown="{literal}$('#date_end').datepicker('show');{/literal}" readonly>
											</td>
											<td align="left" width="65%">&nbsp;</td>
										</tr>
										<tr>
											<td colspan="3">
												<div id="special_logotype_show">
												</div>
											</td>
										</tr>
									</table>
								</div>
							</form>
							</td>
						</tr>
						<tr>
							<td>
								{if $special_logotype}
								<table width="100%" cellpadding="0" cellspacing="0">
									<tr class="table_header">
										<td width="10%" align="left">
											№
										</td>
										<td width="30%" align="left">
											{$lang.special_logotype_table.name}
										</td>
										<td width="20%" align="center">
											{$lang.special_logotype_table.from}
										</td>
										<td width="20%" align="center">
											{$lang.special_logotype_table.to}
										</td>
										<td width="20%" align="right">
											{$lang.special_logotype_table.action}
										</td>
									</tr>
									{section name=i loop=$special_logotype}
									<tr {if $smarty.section.i.index mod 2 eq 1}class="even"{else}class="odd"{/if}>
										<td width="10%" align="left">
											<div style="padding-left:10px;">{$smarty.section.i.index+1}</div>
										</td>
										<td width="30%" align="left">
											{$special_logotype[i].name}
										</td>
										<td width="20%" align="center">
											{$special_logotype[i].date_start}
										</td>
										<td width="20%" align="center">
											{$special_logotype[i].date_end}
										</td>
										<td width="20%" align="center">
																			<div class="block_action fr" style="display: none;">
																				<div class="action_edit" style="display: block;float:left;" onclick="edit('{$special_logotype[i].name}','{$special_logotype[i].date_start}',
												'{$special_logotype[i].date_end}','{$special_logotype[i].id}',
												'{$special_logotype[i].value}','{$special_logotype[i].width}',
												'{$special_logotype[i].height}','{$special_logotype[i].type}')"><img width="16" alt="" src="{$site_root}{$template_root}/images/edit.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.edit}');return false"></div>
																				<div class="action_save" style="float:left;"><img width="16" alt="" src="{$site_root}{$template_root}/images/success.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.save}');return false"></div>
																				<div style="width:10px;" class="fl">&nbsp;</div>
																				<div class="action_del" style="display: block;float:left;" onclick="javascript:location.href='{$form.action}?sel=delete_special_logotype&id={$special_logotype[i].id}&val={$special_logotype[i].value}'"><img height="16" alt="" src="{$site_root}{$template_root}/images/photo_delete.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false"></div>
																			</div>
										</td>
									</tr>
									{/section}
									<tr class="table_header">
										<td colspan="5"></td>
									</tr>
								</table>
								{/if}
							</td>
						</tr>
						{/if}
					</table>
				</div>
            </div>
            <div>
                <a href="#" class="admin_button_major" onclick="javascript:document.images_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
            </div>
        </div>
    </div>
</div>
<script>
    {literal}
    $(document).ready(function() {
        $("tr.table_row").hover(
            function(){
                $(this).addClass('select_tr');
                    $('.block_action', this).css('display', 'block');
			},
			function () {
				$(this).removeClass('select_tr');
				$('.block_action', this).css('display', 'none');
			}
        );
    });
    {/literal}
</script>
{/if}
{if $sec eq '13' || $sec eq '21' || $sec eq '31'}
{if $ajax eq 0}
<div class="panel">
	<div class="user_operation_line" style="line-height: 4; color: #fff;font-size:13px;">
        &nbsp;&nbsp;{$lang.settings.main_page}&nbsp;&nbsp;
        <input type="radio" value="sliders" onclick="f(21);" {if $sec eq '21'}checked=""{/if} name="show" />{$lang.settings.slider}&nbsp;&nbsp;
        <input type="radio" value="banners" onclick="f(13);" {if $sec eq '13'}checked=""{/if} name="show" />{$lang.settings.banners}&nbsp;&nbsp;
        <input type="radio" value="video" onclick="f(31);" {if $sec eq '31'}checked=""{/if} name="show" />{$lang.settings.video}&nbsp;&nbsp;
    </div>
    <div class="user_status_line">
{/if}
    <div id="show_block">
    {if $sec eq '13'}
        {include file="$admingentemplates/admin_settings_banners.tpl"}
    {elseif $sec eq '21'}
        {include file="$admingentemplates/admin_settings_sliders.tpl"}
    {else}
        {include file="$admingentemplates/admin_settings_video.tpl"}
    {/if}
    </div>
    </div>  
</div>
{/if}
<script type="text/javascript">
{literal}
function f(par){
   $.post("admin_settings.php", {section:par, ajax:'1'}, function(data){
        $('#show_block').html(data);
   })
}
{/literal}
</script>
{*///////////////////////use_default_smiles start////////////////////*}
{if $sec eq '23'}
<div class="panel">
			<div id="show_block">
				<div class="panel_section">
				<div class="panel_content">
				<form name="smiles_form" action="{$form.action}" method="post" enctype="multipart/form-data">
					<input type="hidden" name="par" value="use_default_smiles">
					<input type="hidden" name="sel" value="change">
					<input type="hidden" name="section" value="23">
				<table>
					<tr>
						<td>{$lang.settings.use_default_smiles}:&nbsp;</td>
				
						<td>
                            <div style="float: left;"><input type="radio" name="use_default_smiles" id="use_default_smiles" value="1" {if $use_default_smiles eq 1}checked{/if} onclick="javascript:document.getElementById('uploads_smile').disabled = true;"/></div>
                            <div style="height: 16px; width: 10px; float: left;" onclick="return displaySmileLayer('smiles');"><img src="{$server}/templates/pilot_3_theme/emoticons/{$smiles[0].file}" class="smile_icon" alt=""/></div>
                            <div id="smiles" class="smiles" style="display:none; left: 415px; width: 255px;">                                   
                    			<ul>
                    			{section name=sm loop=$smiles}
                    			<li><a style="cursor:default;" ><img src="{$server}/templates/pilot_3_theme/emoticons/{$smiles[sm].file}" class="smile_icon" alt=""></a></li>                    		
                    			{/section}
                    			</ul>
                    		</div>    
                        </td>
					</tr>
					<tr>
						<td>{$lang.settings.use_new_smiles}:&nbsp;</td>
						<td><input type="radio" name="use_default_smiles" id="use_default_smiles" value="0" {if $use_default_smiles eq 0}checked{/if} onclick="javascript:document.getElementById('uploads_smile').disabled = false;"></td>
					</tr>
					<tr>
						<td>{$lang.settings.upload_smiles}:&nbsp;</td>
						<td><input type="file" size="25" name="uploads_smile" id="uploads_smile" {if $use_default_smiles eq 1} disabled {/if} style="margin-left:5px;"></td>
					</tr>
					<tr>
						<td></td>
						<td style="padding-left:6px;">
						{if $use_default_smiles eq 0}
						<link rel="stylesheet" type="text/css" href="{$site_root}{$admin_theme_path}/js/jquery/fancybox/jquery.fancybox.css" media="screen" />
						
						<script type="text/javascript" src="{$site_root}{$admin_theme_path}/js/jquery/fancybox/jquery.easing.1.3.js"></script>
						<script type="text/javascript" src="{$site_root}{$admin_theme_path}/js/jquery/fancybox/jquery.fancybox-1.2.1.pack.js"></script>
						{literal}
							<script type="text/javascript">
							$(document).ready(function() {
								$("a.gallery").fancybox({
								"frameWidth": 200,
								"frameHeight": 200
								});
							});
							</script>
						{/literal}
						<a class="gallery" href="{$site_url}{$site_root}/admin/admin_settings.php?sel=new_smiles">{$lang.settings.current_smiles}</a>&nbsp;&nbsp;&nbsp;
						
						{/if}
						</td>
					</tr>
				
				</table>
				</form>
				</div>
				</div>
			</div>
			<div class="fl">
			<a href="#" class="admin_button_major" onclick="javascript:document.smiles_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
				</div>
		</div>
		{/if}
  <script>
  {literal}
    function displaySmileLayer(id)
    {
    	if (document.getElementById(id).style.display == 'none') {
    		document.getElementById(id).style.display = 'inline-block';
    	} else {
    		document.getElementById(id).style.display = 'none';
    	}
    	return false;
    }
  {/literal}
  </script>
		{*///////////////////////use_default_smiles stop////////////////////*}
{if $sec eq '4'}
{if $active_tab eq 1}
<div class="panel">
	<div id="show_block">
        <div class="panel_section" style="width: 100%;">
        	<div class="panel_content" style="width: 100%;">					
        	<form name="image_form" id="image_form" action="{$form.action}" method="post"  enctype="multipart/form-data">
			<input type="hidden" name="par" value="upload">
			<input type="hidden" name="sel" value="change">
			<input type="hidden" name="section" value="1">
			<div class="fl" style="padding-top:5px;width: 100%;">
				<div class="cr">&nbsp;</div>
				<div style="margin:0px; float:left;width:220px;">
					{$lang.settings.upload_photo}:&nbsp;
				</div>
				<div class="fl">
					&nbsp;<input type="text" size="8" name="photo_size" value="{$data.photo_max_size}">
					{$lang.settings.upload_size_mb}
				</div>
				<div class="cr">&nbsp;</div>
				<div style="margin: 0px; float:left;width:220px;">
					{$lang.settings.audio}:&nbsp;{$lang.settings.upload_size_text}
				</div>
				<div class="fl">
					&nbsp;<input type="text" size="8" name="audio_size" value="{$data.audio_max_size}">
					{$lang.settings.upload_size_mb}
				</div>
				<div class="cr">&nbsp;</div>
				<div style="margin: 0px;; float:left;width:220px;">
					{$lang.settings.video}:&nbsp;{$lang.settings.upload_size_text}
				</div>
				<div class="fl">					
					&nbsp;<input type="text" size="8" name="video_size" value="{$data.video_max_size}">
					{$lang.settings.upload_size_mb}
				</div>
				<div class="fl">
					&nbsp;&nbsp;<input type="checkbox" id="use_ffmpeg" name="use_ffmpeg" value="1" {if $data.use_ffmpeg eq 1}checked{/if}>
					{$lang.settings.use_ffmpeg}
				</div>
				<div class="cr">&nbsp;</div>
				{if $use_pilot_module_club}
				<div style="margin: 0px;; float:left;width:220px;">
					{$lang.settings.upload_group_icons}:&nbsp;
				</div>
				<div class="fl">
					&nbsp;<input type="text" size="8" name="club_photo_size" value="{$data.club_photo_max_size}">
					{$lang.settings.upload_size_mb}
				</div>
				<div class="cr">&nbsp;</div>
				{/if}
				<div style="margin: 0px; float:left;width:220px;">
					{$lang.settings.newsletter}:&nbsp;
				</div>
				<div class="fl">
					&nbsp;<input type="text" size="8" name="newsletter_size" value="{$data.subscrimage_max_size}">
					{$lang.settings.upload_size_mb}
				</div>
			</div>
			<div class="fl" style="float:right;padding-right:23px;45%;{if $data.use_ffmpeg eq 1}display: block;{else}display: none;{/if}" id="ffmpeg_block">
				<table width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 1px solid #29B43D;">
					<tr class="table_header">
						<td align="center">
							{$lang.settings.upload_ffmpeg_settings}
						</td>
					</tr>
					<tr>
						<td>
							<div style="padding: 5px;">
								<div class="fl" style="margin: 0px">{$lang.settings.path_to_ffmpeg}:</div>
								<div class="fl">&nbsp;<input type="text" size="15" name="path_to_ffmpeg" value="{$data.path_to_ffmpeg}">&nbsp;<i>{$lang.settings.example_path_to_ffmpeg}</i></div>
								<div class="cr">&nbsp;</div>
								<div class="fl" style="margin: 0px">{$lang.settings.flv_output_dimension}:</div>
								{*<div class="fl">&nbsp;<input type="text" size="15" name="flv_output_dimension" value="{$data.flv_output_dimension}">&nbsp;<i>{$lang.settings.example_flv_output_dimension}</i></div>*}
								<div class="fl">&nbsp;<select name="flv_output_dimension"><option value="240" {if $data.flv_output_dimension == 240}selected{/if}>240p</option><option value="320" {if $data.flv_output_dimension == 320}selected{/if}>320p</option><option value="360" {if $data.flv_output_dimension == 360}selected{/if}>360p</option><option value="480" {if $data.flv_output_dimension == 480}selected{/if}>480p</option></select></div>
								<div class="cr">&nbsp;</div>
								<div class="fl" style="margin: 0px">{$lang.settings.flv_output_video_bit_rate}:</div>
								<div class="fl">&nbsp;<input type="text" size="15" name="flv_output_video_bit_rate" value="{$data.flv_output_video_bit_rate}">&nbsp;(kbps)&nbsp;<i>{$lang.settings.example_flv_output_video_bit_rate}</i></div>
								<div class="cr">&nbsp;</div>
								<div class="fl" style="margin: 0px">{$lang.settings.flv_output_audio_sampling_rate}:</div>
								<div class="fl">&nbsp;<input type="text" size="15" name="flv_output_audio_sampling_rate" value="{$data.flv_output_audio_sampling_rate}">&nbsp;<i>{$lang.settings.example_flv_output_audio_sampling_rate}</i></div>
								<div class="cr">&nbsp;</div>
								<div class="fl" style="margin: 0px">{$lang.settings.flv_output_audio_bit_rate}:</div>
								<div class="fl">&nbsp;<input type="text" size="15" name="flv_output_audio_bit_rate" value="{$data.flv_output_audio_bit_rate}">&nbsp;<i>{$lang.settings.example_flv_output_audio_bit_rate}</i></div>
								<div class="cr">&nbsp;</div>
								{*<div class="fl" style="margin: 0px">{$lang.settings.flv_output_foto_dimension}:</div>
								<div class="fl">&nbsp;<input type="text" size="15" name="flv_output_foto_dimension" value="{$data.flv_output_foto_dimension}">&nbsp;<i>{$lang.settings.example_flv_output_foto_dimension}</i></div>
								<div class="cr"></div>*}
								<div class="fl" style="margin: 0px">{$lang.settings.ffmpeg_codec_str}:</div>
								<div class="fl">&nbsp;<input type="text" size="40" name="ffmpeg_codec_str" value="{$data.ffmpeg_codec_str|escape:html}"></div>
								<div class="cr"></div>
								<div style="width: 430px;">{$lang.settings.default}: <i>-vcodec libx264 -vprofile baseline -preset slow -pix_fmt yuv420p -b:v %video_bitrate% -maxrate %video_maxrate% -bufsize %bufsize% -vf scale="trunc(oh*a/2)*2:%video_resolution%" -threads 0 -acodec libmp3lame -ar %audio_sampling_rate% -ab %audio_bit_rate%</i></div>
								<div class="fl">
									<input type="button" value="{$lang.button.check} ffmpeg" onclick="checkFfmpeg()" />
									<input type="button" value="{$lang.button.test}" onclick="checkCodec()" />
								</div>
							</div>
						</td>
					</tr>
				</table>
			</div>
			</form>
			</div>
			<div class="cr"></div>
			<div id="check_codec_result_cont" style="display: none; padding: 10px; border: 1px solid #ccc; margin: 10px;">
				<div><input type="button" value="{$lang.button.close}" onclick="$('#check_codec_result_cont').hide();"></div>
				<div id="check_codec_result"></div>
			</div>
		</div>
		<div>
			<div class="fl"><a href="#" class="admin_button_major" id="save_settings">{$lang.button.save}<span>&nbsp;</span></a></div>
			<div id="error_box" class="fl"></div>
			<div class="cr"></div>
		</div>
	</div>
</div>
<script type="text/javascript">
	{literal}
	function checkFfmpeg(){
		var ffpath = $('#ffmpeg_block').find('input[name="path_to_ffmpeg"]').val();
		$.post(
			'',
			{sel: 'check_ffmpeg', ffpath: ffpath},
			function(resp){
				var status = resp.status == 1 ? 'success' : 'error';
				ShowAjaxError(resp.msg, '', status);
			},
			'json'
		);
	}
	
	function checkCodec(){
		var ffpath = $('#ffmpeg_block').find('input[name="path_to_ffmpeg"]').val();
		var ffmpeg_codec_str = $('#ffmpeg_block').find('input[name="ffmpeg_codec_str"]').val();
		var flv_output_dimension = $('#ffmpeg_block').find('select[name="flv_output_dimension"]').val();
		var flv_output_video_bit_rate = $('#ffmpeg_block').find('input[name="flv_output_video_bit_rate"]').val();
		var flv_output_audio_sampling_rate = $('#ffmpeg_block').find('input[name="flv_output_audio_sampling_rate"]').val();
		var flv_output_audio_bit_rate = $('#ffmpeg_block').find('input[name="flv_output_audio_bit_rate"]').val();
		$.post(
			'',
			{
				sel: 'check_codec',
				ffpath: ffpath,
				ffmpeg_codec_str: ffmpeg_codec_str,
				flv_output_dimension: flv_output_dimension,
				flv_output_video_bit_rate: flv_output_video_bit_rate,
				flv_output_audio_sampling_rate: flv_output_audio_sampling_rate,
				flv_output_audio_bit_rate: flv_output_audio_bit_rate
			},
			function(resp){
				var status = resp.status == 1 ? 'success' : 'error';
				$('#check_codec_result').html(resp.output);
				$('#check_codec_result_cont').show();
			},
			'json'
		);
	}
	
	$(document).ready(function() {
		$('#use_ffmpeg').click(function(){
			if($('#use_ffmpeg').is(':checked')) {
				$('#ffmpeg_block').show(10);
			} else {
				$('#ffmpeg_block').hide(10);
			}
		});
	});
	
	var options = { 
		success: function(data){
			ajaxIndicator(0, 'error_box');
			data = data.replace(/\<\/?(head|body)\>/g,'');
			if (data == 'saved'){
				ShowAjaxError('{/literal}{$lang.country.saved|escape:javascript}{literal}', '', 'success');
			} else {
				ShowAjaxError(data, '', 'error');
			}
			return false;
		},
		beforeSubmit: function() { 
			ajaxIndicator(1, 'error_box');
		}
	};
	$(document).ready(function(){
		$("#save_settings").click(function (){
			$('#image_form').ajaxSubmit(options);
			return false;
		});
	});
	{/literal}
</script>
{/if}
{if $active_tab eq 2}
<div class="user_operation_line" style="height:4px;font-size:0px;"></div>
<div class="user_status_line">
	<div id="tab_watermark" class="user_status_elem_active" onclick="ShowUploads('watermark');">
		{$lang.settings.site_logo}
	</div>
	<div id="tab_default" class="user_status_elem" onclick="ShowUploads('default');">
		<a>{$lang.settings.upload_default}</a>
	</div>
	<div id="tab_adult" class="user_status_elem" onclick="ShowUploads('adult');">
		<a>{$lang.settings.icon_default_adult}</a>
	</div>
	<div class="cr"></div>
	<div class="panel_subtabs">
		<div id="block_watermark">
			<form name="watermark_form" id="watermark_form" action="{$form.action}" method="post"  enctype="multipart/form-data">
			<input type="hidden" name="par" value="upload">
			<input type="hidden" name="sel" value="change">
			<input type="hidden" name="section" value="2">
			<input type="hidden" name="subsection" value="1">
	        <div style="float: left;width: 100%">
	        	<table width="100%" cellspacing="0" cellpadding="0" border="0">
	        		<tbody>
	        			<tr>
	        				<td>
	        					<div class="panel_section" style="border:0px;margin-bottom:0px;">
        							<div class="panel_content">
        								<div class="fl" style="margin: 0px;" id="photo_logo_div">
        									{$lang.settings.use_photo_logo}
        								</div>
        								<div class="fl">
        									&nbsp;<input type="checkbox" name="use_photo_logo" value="1" {if $data.use_photo_logo}checked{/if} {if $data.use_photo_logo_disabled}disabled{/if}>
        								</div>
        								<div class="cr">&nbsp;</div>
        								<div class="fl" style="margin: 0px;" id="insert_text">
        									{$lang.settings.insert_text}:
        								</div>
        								<div class="fl">
        									&nbsp;<input type="radio" name="site_logo_type" value="1" onclick="SiteLogoChange('1');" {if $data.site_logo_type eq 'text'} checked="" {/if} />&nbsp;
        								</div>
        								<div class="fl">
        									&nbsp;
        									<select name="font-size" onchange="" id="font-size" {if $data.site_logo_type eq 'image'} disabled {/if}>
												<option value="">font-size</option>
												{include file="$admingentemplates/admin_options_size.tpl"}
											</select>
											&nbsp;
											<select name="font-face" onchange="" id="font-face" {if $data.site_logo_type eq 'image'} disabled {/if}>
												<option value="">font-face</option>
												{include file="$admingentemplates/admin_options_face_forlogo.tpl"}
											</select>
											&nbsp;
											<input value="{$site_logo_name}" name="site_logo_name" type="text" size="15" id="site_logo_name"  {if $data.site_logo_type eq 'image'} disabled {/if}>
        								</div>
        								<div class="cr">&nbsp;</div>
        								<div class="fl" style="margin: 0px;" id="upload_image">
        									{$lang.settings.upload_image}:
        								</div>
        								<div class="fl">
        									&nbsp;<input type="radio" name="site_logo_type" value="2" onclick="SiteLogoChange('2');" {if $data.site_logo_type eq 'image'} checked="" {/if} />
        								</div>
        								<div class="fl">
        									&nbsp;<input type="file" name="site_logo_picture" id="site_logo_picture"  {if $data.site_logo_type eq 'text'} disabled="" {/if}/>
        									&nbsp;<i>{$lang.settings.watermark_hint}</i>
        								</div>
        							</div>
        						</div>
	        				</td>
	        			</tr>
	        		</tbody>
	        	</table>
			</div>
			<div style="float: left;width: 50%">
			</div>
			</form>
		</div>
		<div id="block_default" style="display: none;">
			<form name="default_form" id="default_form" action="{$form.action}" method="post"  enctype="multipart/form-data">
			<input type="hidden" name="par" value="upload">
			<input type="hidden" name="sel" value="change">
			<input type="hidden" name="section" value="2">
			<input type="hidden" name="subsection" value="2">
			<div style="float: left;width: 100%">
	        	<table width="100%" cellspacing="0" cellpadding="0" border="0">
	        		<tbody>
	        			<tr>
	        				<td>
	        					<div class="panel_section" style="border:0px;margin-bottom:0px;">
        							<div class="panel_content fl" style="width: 80%">
        								<div class="fl" style="margin: 0px;" id="upload_image_2">
        									{$lang.settings.upload_image}:
        								</div>
        								<div class="fl">
        									&nbsp;<input type="file" name="upload_file">
        								</div>
        								<div class="cr">&nbsp;</div>
        								<div class="fl" style="margin: 0px" id="icon_2">
        									{$lang.settings.icon}:
        								</div>
        								<div class="fl">
											&nbsp;{$lang.settings.upload_size_text}
											&nbsp;
											<input type="text" size="8" name="icon_size" value="{$data.icon_max_size}">
											{$lang.settings.upload_size_mb}
										</div>
										<div class="cr">&nbsp;</div>
										<div class="fl" style="margin: 0px;" id="use_image_resize_2">
											{$lang.settings.use_image_resize}:
										</div>
										<div class="fl">
											<input type="checkbox" name="use_image_resize" value="1" {if $data.use_image_resize}checked{/if} {if $data.use_image_resize_disabled}disabled{/if}>
										</div>
        							</div>
        							<div class="panel_content fl" align="right">
										<div class="panel_content">
    										{$data.male_icon}
    									</div>
									</div>
        						</div>
	        				</td>
	        			</tr>
	        		</tbody>
	        	</table>
			</div>
			</form>
		</div>
		<div id="block_adult" style="display: none;">
			<form name="adult_form" id="adult_form" action="{$form.action}" method="post"  enctype="multipart/form-data">
			<input type="hidden" name="par" value="upload">
			<input type="hidden" name="sel" value="change">
			<input type="hidden" name="section" value="2">
			<input type="hidden" name="subsection" value="3">
			<div style="float: left;width: 100%">
	        	<table width="100%" cellspacing="0" cellpadding="0" border="0">
	        		<tbody>
	        			<tr>
	        				<td>
	        					<div class="panel_section" style="border:0px;margin-bottom:0px;">
        							<div class="panel_content fl" style="width: 70%">
        								<div class="fl" style="margin: 0px;">
        									{$lang.settings.upload_image}:
        								</div>
        								<div class="fl">
        									&nbsp;<input type="file" name="upload_icon_adult">
        								</div>
        								<div class="cr">&nbsp;</div>
        							</div>
        							<div class="panel_content fl" align="right">
										<div class="panel_section" style="border:0px;" align="center">
											<div class="panel_content">
												{$data.adult_icon}
											</div>
										</div>
									</div>
        						</div>
	        				</td>
	        			</tr>
	        		</tbody>
	        	</table>
			</div>
			</form>
		</div>
	</div>
		<div class="fl"></div>
		<div class="cr">
			<div class="fl"><a href="#" class="admin_button_major" id="save_settings">{$lang.button.save}<span>&nbsp;</span></a></div>
			<div id="error_box" class="fl"></div>
			<div class="cr"></div>
		</div>
</div>
			<script type="text/javascript">
			{literal}
			$(document).ready(function(){
				$('#insert_text').width($('#photo_logo_div').width());
				$('#upload_image').width($('#photo_logo_div').width());
				$('#big_icon_2').width($('#use_image_resize_2').width());
				$('#icon_2').width($('#use_image_resize_2').width());
				$('#upload_image_2').width($('#use_image_resize_2').width());
			});
			{/literal}
			</script>
<script type="text/javascript">
	var tab_last = 'watermark';
	{literal}
	function SiteLogoChange(par) {
		if (par == 1) {
			$('#font-size, #font-face, #site_logo_name').fadeTo('slow',1);
            $('#font-size, #font-face, #site_logo_name').removeAttr("disabled");
			$('#pict_image, #site_logo_picture').fadeTo('slow',0.4);
            $('#pict_image, #site_logo_picture').attr('disabled', 'disabled');
		}
		if (par == 2) {
			$('#pict_text, #font-size, #font-face, #site_logo_name').fadeTo('slow',0.4);
            $('#pict_text, #font-size, #font-face, #site_logo_name').attr('disabled', 'disabled');
			$('#pict_image, #site_logo_picture').fadeTo('slow',1);
            $('#pict_image, #site_logo_picture').removeAttr("disabled");
		}
	}
	function ShowUploads(par) {
		if ($('#tab_'+par).find('a').text() == '') return;

		$('#tab_'+tab_last).html("<a>"+$('#tab_'+tab_last).text()+"<\/a>");
		$('#tab_'+par).text($('#tab_'+par).text());

		$('#tab_'+tab_last).removeClass('user_status_elem_active');
		$('#tab_'+tab_last).addClass('user_status_elem');
		$('#tab_'+par).removeClass('user_status_elem');
		$('#tab_'+par).addClass('user_status_elem_active');
		
		$('#block_'+tab_last).hide();
		$('#block_'+par).show();
		tab_last = par;
				$('#insert_text').width($('#photo_logo_div').width());
				$('#upload_image').width($('#photo_logo_div').width());
				$('#big_icon_2').width($('#use_image_resize_2').width());
				$('#icon_2').width($('#use_image_resize_2').width());
				$('#upload_image_2').width($('#use_image_resize_2').width());
	}
	var options = { 
		success: function(data){
			ajaxIndicator(0, 'error_box');
			data = data.replace(/\<\/?(head|body)\>/g,'');
			if (data == 'saved'){
				ShowAjaxError('{/literal}{$lang.country.saved|escape:javascript}{literal}', '', 'success');
			} else {
				ShowAjaxError(data, '', 'error');
			}
			return false;
		},
		beforeSubmit: function() { 
			ajaxIndicator(1, 'error_box');
		}
	};
	$(document).ready(function(){
		$("#save_settings").click(function (){
			$('#'+tab_last+'_form').ajaxSubmit(options);
			return false;
		});
	});
	{/literal}
</script>
{/if}
{/if}{*end 4*}

{if $sec eq '15'}
<div class="panel">
    <div class="user_status_line">
        <div class="cr"></div>
        <div id="show_block">
            <table cellSpacing="0" cellPadding="0" border="0" width="100%" >
				<tr>
					<td>
						<form method="POST" name="seo_form" id="seo_form" action="{$form.action}" style="margin-bottom:10px;">
                		<input type="hidden" name="sel" value="change">
                		<input type="hidden" name="par" value="seo">
                		<input type="hidden" name="section" value="15">
						<table width="100%" cellpadding="0" cellspacing="3" border="0">
							<tr>
								<td>
								<table>
								<tr>
									<td align="left" nowrap class="main_header_text" style="float:left; padding-left:0px;padding-top:4px; padding-bottom:4px;width: auto; margin-right:10px;">{$lang.settings.use_global_seo.left}:&nbsp;</td>
									<td class="main_content_text" align="left" style="float:left;width:auto;"><input type="checkbox" name="use_global_seo" value="1" {if $data.use_global_seo}checked{/if} onchange="javascript:document.seo_form.submit();"></td>
								</tr>
								</table>
								</td>
							</tr>
							<tr><td colspan="2">{$lang.settings.use_global_seo.right}</td></tr>
						</table>
						</form>
						<form method="POST" name="admin_form" id="admin_form" action="{$form.action}">
                        <table cellSpacing="3" cellPadding="0">
							<tr>
{*							{section name=s loop=$lang_link}
								<td align="center"><a href="#" onclick="javascript:window.open('./admin_translate_seo.php{$lang_link[s].link}','lang_edit', 'height=600, resizable=yes, scrollbars=yes,width=900, menubar=no,status=no'); return false;" class=privacy_link>{$lang_link[s].name}</a></td>
							{if !$smarty.section.s.last}
								<td align="center" valign="middle" class="main_content_text">&nbsp;|&nbsp;</td>
							{/if}
							{/section}*}
								<td>
								<div style="padding-bottom: 10px;">
									<span>{$lang.settings.translate_into}:</span>
									<select name="lang_code" id="lang_code" onchange="javascript: document.location='{$form.action}?section=15&lang_code='+this.value;">
									{section name=s loop=$lang_link}
											<option value="{$lang_link[s].id}" {if $lang_link[s].id == $current_lang_id}selected{/if}>{$lang_link[s].name}</option>
									{/section}
									</select>
								</div>
								</td>
							</tr>
						</table>
					
						
                		<input type="hidden" name="sel" value="change">
                		<input type="hidden" name="pos" value="">
                		<input type="hidden" name="par" value="metatags">
                		<input type="hidden" name="section" value="15">
						<input type="hidden" name="current_lang_code" value="{$current_lang_code}">
						<table width="100%" cellpadding="3" cellspacing="1" border="0">
						{foreach from=$meta name=metatags item=item}
							<tr>
								<td colspan="2" style="padding-top: 10px; padding-bottom: 10px;font-size:14px;color:#208b2f;">
									<input type="hidden" name="pages[]" value="{$item.page}">
									<b>{$item.page_name}</b>
								</td>
							</tr>
							{if $use_global_seo && $item.page != 'main' && $item.page != 'location_city' && $item.page != 'location_region' && $item.page != 'location_country' && $item.page != 'viewprofile' && $item.page != 'news' && $item.page != 'index'}
							<tr>
								<td valign="top">{$lang.seo.seo_link}:</td>
								<td>
									<input name="seo_link[]" class="main_content_text" value="{$item.seo_link}">
								</td>
							</tr>
							{/if}
							<tr>
								<td width="5%" valign="top">{$lang.settings.meta_title}:</td>
								<td>
								{if $item.page == 'main' || $item.page == 'location_city' || $item.page == 'location_region' || $item.page == 'location_country' || $item.page == 'viewprofile' || $item.page == 'news' || $item.page == 'index'}
									<input type="hidden" name="seo_link[]" class="main_content_text" value="{$item.seo_link}">
								{/if}
								{strip}
									<textarea name="title[]" rows="2" class="main_content_text" style="font-size:14px;width:100%;">
								{if $item.page == 'main' && $item.title == ""}
									{$lang.main_title}
								{else}
									{$item.title}
								{/if}
									</textarea>
								{/strip}
								</td>
							</tr>
							<tr>
								<td valign="top">{$lang.settings.meta_description}:</td>
								<td>
								{strip}
									<textarea name="description[]" rows="2" class="main_content_text" style="font-size:14px;width:100%;">
								{if $item.page == 'main' && $item.description == ""}
									{$lang.description}
								{else}
									{$item.description}
								{/if}
									</textarea>
								{/strip}
								</td>
							</tr>
							<tr>
								<td valign="top">{$lang.settings.meta_keywords}:</td>
								<td>
								{strip}
									<textarea name="keywords[]" rows="2" class="main_content_text" style="font-size:14px;width:100%;">
								{if $item.page == 'main' && $item.keywords == ""}
									{$lang.keywords}
								{else}
									{$item.keywords}
								{/if}
									</textarea>
								{/strip}
								</td>
							</tr>
							{if $item.page == 'main_location' && $use_global_seo}
							<tr>
								<td valign="top">&nbsp;</td>
								<td>
									<input type="checkbox" name="settings_main_location" value="1" {if $location_type}checked{/if}> {$lang.seo.locations_links}<br />
									{$lang.seo.text} <input type="text" name="location_text" value="{$location_text}">&nbsp;
									<select name="location_type">
										<option {if !$location_type}selected{/if} value="0">--</option>
										<option {if $location_type==1}selected{/if} value="1">{$lang.country.country}</option>
										<option {if $location_type==2}selected{/if} value="2">{$lang.country.region}</option>
										<option {if $location_type==3}selected{/if} value="3">{$lang.country.city}</option>
									</select>
								</td>
							</tr>
							{/if}
							{if !$smarty.foreach.metatags.last}
								<tr><td colspan="2">&nbsp;</td></tr>
								<tr><td colspan="2"><hr style="width: 100%;"></td></tr>
							{/if}
						{/foreach}
							<tr>
                				<td colspan="2">
                					<a href="#" class="admin_button_major" onclick="javascript:document.admin_form.submit();">{$lang.button.save}<span></span></a>
                				</td>
                			</tr>
						</table>
						</form>
					</td>
				</tr>
            </table>
        </div>
    </div>
</div>
{/if}{*end 15*}

{if $sec eq 1}
<div class="panel">
	<div class="panel_section">
		<div class="panel_content">
			<form name="email_form" action="{$form.action}" method="post">
			<input type="hidden" name="par" value="email">
			<input type="hidden" name="sel" value="change">
			<input type="hidden" name="section" value="1">
				<div class="cr">&nbsp;</div>
				<div class="fl" style="margin: 0px;">
					{$lang.settings.email}:
				</div>
				<div class="fl">
					&nbsp;<input type="text" name="email" value="{$data.email}" size=30>
				</div>
			</form>
		</div>
	</div>
				<div class="fl">
					<a href="#" class="admin_button_major" onclick="javascript:document.email_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
				</div>
</div>
{/if}{*end 1*}

{if $sec eq 2}
<div class="panel">
	<div class="panel_section">
		<div class="panel_content">
			<form name="aname_form" action="{$form.action}" method="post">
			<input type="hidden" name="par" value="aname">
			<input type="hidden" name="sel" value="change">
			<input type="hidden" name="section" value="2">
				<div class="cr">&nbsp;</div>
				<div class="fl" style="margin: 0px;width:165px;">
					{$lang.settings.login}:
				</div>
				<div class="fl">
					&nbsp;<input type="text" name="login" value="{$data.login}" size="30">
				</div>
				<div class="cr">&nbsp;</div>
				<div class="fl" style="margin: 0px;width:165px;">
					{$lang.settings.fname}:
				</div>
				<div class="fl">
					&nbsp;<input type="text" name="fname" value="{$data.fname}" size="30">
				</div>
				<div class="cr">&nbsp;</div>
				<div class="fl" style="margin: 0px;width:165px;">
					{$lang.settings.sname}:
				</div>
				<div class="fl">
					&nbsp;<input type="text" name="sname" value="{$data.sname}" size="30">
				</div>
				<div class="cr">&nbsp;</div>
				<div class="fl" style="margin: 0px;width:165px;">
					{$lang.settings.email}:
				</div>
				<div class="fl">
					&nbsp;<input type="text" name="email" value="{$data.email}" size="30">
				</div>
				<div class="cr">&nbsp;</div>

				<div class="fl" style="margin: 0px;width:165px;">
					{$lang.settings.pass}:
				</div>
				<div class="fl">
					&nbsp;<input type="password" name="pass" value="{$data.pass}" size="30">
				</div>
				<div class="cr">&nbsp;</div>
				<div class="fl" style="margin: 0px;width:165px;">
					{$lang.settings.repass}:
				</div>
				<div class="fl">
					&nbsp;<input type="password" name="repass" value="{$data.repass}" size="30">
				</div>
				<div class="cr">&nbsp;</div>
				<div class="fl" style="margin: 0px;width:165px;">
					{$lang.settings.oldpass}:
				</div>
				<div class="fl">
					&nbsp;<input type="password" name="oldpass" value="{$data.oldpass}" size="30">
				</div>

			</form>
		</div>
	</div>
				<div>
					<a href="#" class="admin_button_major" onclick="javascript:document.aname_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
				</div>
</div>
{/if}{*end 2*}

{if $sec eq 12}
<div class="panel">
	<div class="panel_section">
		<div class="panel_content" style="width:100%;">
                    <form method="POST" name="admin_form" id="admin_form" action="{$form.action}">
                    <input type="hidden" name="sel" value="change">
                    <input type="hidden" name="pos" value="">
                    <input type="hidden" name="par" value="site_status">
                    <input type="hidden" name="section" value="12">
                    <div style="width: 97%; margin-top: 10px;">
                        <dl>
                            <dt style="width:20px;float:left;"><input type="radio" name="site_status" value="0" {if $site_status eq 0} checked {/if} id="status_0" onclick="toggleMaintenanceDetails();"></dt><dd> <label for="status_0"> {$lang.settings.status_0}</label> </dd>
                        </dl>
                        <dl>
                            <dt style="width:20px;float:left;"><input type="radio" name="site_status" value="1" {if $site_status eq 1} checked {/if} id="status_1" onclick="toggleMaintenanceDetails();"></dt><dd> <label for="status_1"> {$lang.settings.status_1}</label> </dd>
                            {*<td id="tr_PageEditor" {if $site_status eq 0} style="display:none;"{/if}><a href="#" onclick="javascript: window.open('admin_settings.php?sel=statusedit','langfile', 'height=750, resizable=yes, scrollbars=yes,width=750, menubar=no,status=no'); return true;">{$lang.settings.edit_page}</a></td>*}
                        </dl>
                        <dl id="tr_PageEditor"  {if $site_status eq 0} style="display:none;"{/if}>
                            <dt style="width:20px;float:left;"> &nbsp;
                            </dt>
                            <dd id="redactor_close_site">
                                {$redactor}
                                <textarea bgcolor="#000000;" width="100%" style="width:100%; height: 720px;" name="text" id="description" class="redactor_normal"></textarea>
                                <div id="bad_div_description" class="bad_div_left"></div>
                            </dd>
                        </dl>
                    </div>
                    </form>
		</div>
	</div><a href="#" class="admin_button_major" onclick="Save12();">{$lang.button.save}<span>&nbsp;</span></a>
	{literal}
	<script>
		function Save12() {
			$("#description").html($("#imp_redactor_frame_description").contents().find('body').html());
			text = $("#imp_redactor_frame_description").contents().find('body').html();
			site_status = $('input[name=site_status]:checked').val();
			$.post("admin_settings.php",{sel:'change',par:'site_status',section:'12',text:text,site_status:site_status}, function(data){
                document.location.href="admin_settings.php?section=12";
			});
		}
	</script>
	{/literal}
</div>
{/if}{*end 12*}
	
{if $sec eq 118}{*invite friends*}
<script>
{literal}
$(document).ready(function(){
	if ($("#use_invite_friends").is(":checked"))
		$(':text, textarea').removeAttr('disabled');
	else
		$(':text, textarea').attr('disabled', 'disabled');
				
	$("#use_invite_friends").click(function () {
		if ($("#use_invite_friends").is(":checked"))
			$(':text, textarea').removeAttr('disabled');	
		else
			$(':text, textarea').attr('disabled', 'disabled');
	   });
});
{/literal}
</script>
<div class="panel">
	<div class="panel_section">
		<div class="panel_content" style="width:100%;">
			<form method="POST" name="admin_form" id="admin_form" action="{$form.action}">
		    <input type="hidden" name="sel" value="change">
			<input type="hidden" name="par" value="invite_friends">
			<input type="hidden" name="section" value="118">
				<div style="width:100%;">
						<dl style="overflow:hidden;">
							<dt style="float:left;width:18%;">
								{$lang.sharing_tools.use_invite_friends}
							</dt>
							<dd>
								<input type="checkbox" id="use_invite_friends" name="use_invite_friends" value="1" {if $invite_friends.use_invite_friends eq '1'} checked {/if}>
							</dd>				
							<br>
						</dl>
						<dl style="overflow:hidden;">
							<dt style="float:left;width:18%;">
								{$lang.admin_inviter.message_subject}
							</dt>
							<dd>
								<input type="text" class="form_field" value="{$invite_friends.invite_message_subject}" name="invite_message_subject" size="40"/>
							</dd>
						</dl>
						<dl style="overflow:hidden;">
							<dt style="float:left;width:18%;">
								{$lang.admin_inviter.message_body}
							</dt>
							<dd>
								<textarea style="width:254px;" class="form_textarea" name="invite_message_body">{$invite_friends.invite_message_body}</textarea>
							</dd>
						</dl>
						
						{*debug*}
						{foreach item=item key=key from=$default_settings} 
							<dl style="overflow:hidden;">	
							<dt style="float:left;width:18%;">
							{$lang.sharing_tools.$key}
							</dt>
							<dd>
								<input type="text" name="provider_{$key}" value="{$item}" size="40">
							</dd>
							</dl>
						{/foreach}
						{*foreach item=provider key=key from=$default_settings}
							<hr style="width:98%;">
							{foreach item=item key=mykey from=$provider}
							<dl style="overflow:hidden;">	
							<dt style="float:left;width:18%;">
							{$lang.sharing_tools.$mykey}
							</dt>
							<dd>
								<input type="text" name="provider_{$mykey}" value="{$item}" size="40">
							</dd>
							</dl>
							{/foreach}
						{/foreach*}
						
				</div>
				
			</form>
		</div>
	</div><a href="#" class="admin_button_major" onclick="javascript:document.admin_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
</div>	
	
	
{/if}{*end 118*}
	
{if $sec eq 19}
<div class="panel">
	<div class="panel_section">
		<div class="panel_content" style="width:100%;">
			<form method="POST" name="admin_form" id="admin_form" action="{$form.action}">
		    <input type="hidden" name="sel" value="change">
			<input type="hidden" name="par" value="facebook">
			<input type="hidden" name="section" value="19">
					<div style="width:100%;">
						<dl style="overflow:hidden;">
							<dt style="float:left;width:18%;">
								{$lang.sharing_tools.use_facebook_connect}
							</dt>
							<dd>
								<input type="checkbox" name="use_facebook_connect" value="1" {if $facebook.use_facebook_connect eq '1'} checked {/if}>
							</dd>
						</dl>
						<dl>
							<dt style="float:left;width:18%;padding-bottom: 10px;">
								{$lang.sharing_tools.facebook_connect_api_key} <font class="error_msg">*</font>
							</dt>
							<dd>
								<input type="text" name="api_key" value="{$facebook.facebook_connect_api_key}">
							</dd>
						</dl>
						<dl>
							<dt style="float:left;width:18%;padding-bottom: 10px;">
								{$lang.sharing_tools.facebook_connect_secret_key} <font class="error_msg">*</font>
							</dt>
							<dd>
								<input type="text" name="secret_key" value="{$facebook.facebook_connect_secret_key}">
							</dd>
						</dl>
{*						<dl>
							<dt style="float:left;width:18%;">&nbsp;
							</dt>
							<dd>*}
								{*<input type="submit" class="button" value="{$lang.button.save}">*}
								{*<a href="#" class="admin_button_major" onclick="javascript:document.admin_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
							</dd>
						</dl>*}
					</div>
			</form>
		</div>
	</div><a href="#" class="admin_button_major" onclick="javascript:document.admin_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
</div>
{/if}{*end 19*}
{if $sec eq 29} {*vkontakte*}
<div class="panel">
	<div class="panel_section">
		<div class="panel_content" style="width:100%;">
			<form method="POST" name="admin_form" id="admin_form" action="{$form.action}">
		    <input type="hidden" name="sel" value="change">
			<input type="hidden" name="par" value="vkontakte">
			<input type="hidden" name="section" value="29">
					<div style="width:100%;">
						<dl>
							<dt class="main_header_text" style="float:left;width:18%;">
								{$lang.sharing_tools.use_vk_connect}
							</dt>
							<dd>
								<input type="checkbox" name="use_vk_connect" value="1" {if $vkontakte.use_vk_connect eq '1'} checked {/if}>
							</dd>
						</dl>
						<dl>
							<dt class="main_header_text" style="float:left;width:18%;">
								{$lang.sharing_tools.vk_connect_api_key} <font class="error_msg">*</font>
							</dt>
							<dd>
								<input type="text" name="api_key" value="{$vkontakte.vk_api_id}">
							</dd>
						</dl>
						<dl>
							<dt class="main_header_text" style="float:left;width:18%;">
								{$lang.sharing_tools.vk_connect_secret_key} <font class="error_msg">*</font>
							</dt>
							<dd>
								<input type="text" name="secret_key" value="{$vkontakte.vk_secret_key}">
							</dd>
						</dl>
					</div>
			</form>
		</div>
	</div><a href="#" class="admin_button_major" onclick="javascript:document.admin_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
</div>
{/if}{*end 29*}
{if $sec eq 30} {*sharing_tools*}
<div class="panel">
	<div class="panel_section">
		<div class="panel_content" style="width:100%;">
			<form method="POST" name="admin_form" id="admin_form" action="{$form.action}">
				<input type="hidden" name="sel" value="change">
				<input type="hidden" name="par" value="sharing_tools">
				<input type="hidden" name="section" value="30">
				<br/>
				{*<b>{$lang.sharing_tools.use_tools}</b>*}
				<div style="width:100%;">
                    <dl>
                        <dt style="float:left;width:20%;">&nbsp;</dt>
                        <dd>
							<font>{$lang.sharing_tools.use_tools_1}</font>
							<font style="padding-left:50px">{$lang.sharing_tools.use_tools_2}</font>
						</dd>
                     </dl>
					<dl>
						<dt style="float:left;width:30%;">
							{$lang.sharing_tools.in_footer}&nbsp;:
						</dt>
						<dd>
							<span style="float:left;width:40%;">
								<input type="checkbox" name="footer[0]" value="1" {if $sharing.footer[0] eq '1'} checked {/if}>
							</span>
                            <span>
								<input type="checkbox" name="footer[1]" value="1" {if $sharing.footer[1] eq '1'} checked {/if}>
							</span>
                                                        
						</dd>
                                                
					</dl>
					<dl>
						<dt style="float:left;width:30%;">
							{$lang.sharing_tools.in_blog}&nbsp;:
						</dt>
						<dd>
							<span style="float:left;width:40%;">
								<input type="checkbox" name="blog[0]" value="1" {if $sharing.blog[0] eq '1'} checked {/if}>
							</span>
                            <span>
								<input type="checkbox" name="blog[1]" value="1" {if $sharing.blog[1] eq '1'} checked {/if}>
							</span>
						</dd>
					</dl>
					<dl>
						<dt style="float:left;width:30%;">
							{$lang.sharing_tools.in_forum}&nbsp;:
						</dt>
						<dd>
							<span style="float:left;width:40%;">
								<input type="checkbox" name="forum[0]" value="1" {if $sharing.forum[0] eq '1'} checked {/if}>
							</span>
                             <span>
								<input type="checkbox" name="forum[1]" value="1" {if $sharing.forum[1] eq '1'} checked {/if}>
							 </span>
						</dd>
					</dl>
				</div>
			</form>
		</div>
	</div><a href="#" class="admin_button_major" onclick="javascript:document.admin_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
</div>
{/if}{*end 30*}
{if $sec eq 14}
<div class="panel">
	<div class="panel_section">
		<div class="panel_content" style="width: 97%; margin-top: 10px;">
                    <form method="POST" name="admin_form" id="admin_form" action="{$form.action}">
                    <input type="hidden" name="sel" value="change">
                    <input type="hidden" name="pos" value="">
                    <input type="hidden" name="par" value="site_status_warning">
                    <input type="hidden" name="section" value="14">
                    <div style="width:100%;">
                        <dl>
                            <dt style="width:20px;float:left;">
                            	<input type="radio" name="site_status_warning" value="1" {if $site_status_warning == 1} checked {/if} id="status_warning_1" onclick="toggleWarningDetails();">
                            </dt>
                            <dd>
                            	<label for="status_warning_1"> {$lang.settings.status_warning_1}</label>
                            </dd>
                        </dl>
                        <dl>
                            <dt style="width:20px;float:left;">
                            	<input type="radio" name="site_status_warning" value="0" {if $site_status_warning == 0} checked {/if} id="status_warning_0" onclick="toggleWarningDetails();">
                            </dt>
                            <dd>
                            	<label for="status_warning_0"> {$lang.settings.status_warning_0}</label>
                            </dd>
                        </dl>
                        <dl>
                        	<dd colspan="2">
                        		<div id="PageEditor" {if $site_status_warning eq 0} style="display:none;"{/if}>
                        			<dl>
                            			<dd>
                                			{*$editor*}
                                                        {$redactor}
                                                        <textarea width="100%" style="width:100%; height: 400px;" name="text" id="description" class="redactor_normal"></textarea>
                                                        <div id="bad_div_description" class="bad_div_left"></div>
                            			<dd>
                        			</dl>
                        		</div>
                        	</dd>
			</dl>
                    </div>
                    </form>
		</div>
	</div><a href="#" class="admin_button_major" onclick="Save14();">{$lang.button.save}<span>&nbsp;</span></a>
	{literal}
    <script>
        function Save14() {
            $("#description").html($("#imp_redactor_frame_description").contents().find('body').html());
            text = $("#imp_redactor_frame_description").contents().find('body').html();
            site_status_warning = $('input[name=site_status_warning]:checked').val();
            $.post("admin_settings.php",{sel:'change',par:'site_status_warning',section:'14',text:text,site_status_warning:site_status_warning}, function(data){
                document.location.href="admin_settings.php?section=14";
            });
        }
    </script>
    {/literal}
</div>
{/if}{*end 14*}
{*{if $sec eq 11}
<div style="width:100%;">
	<div>
		<div>
            <form method="POST" name="admin_form" id="admin_form" action="{$form.action}">
            <input type="hidden" name="sel" value="change">
            <input type="hidden" name="pos" value="">
            <input type="hidden" name="par" value="server_errors">
            <input type="hidden" name="section" value="11">
            <table cellpadding="3" cellspacing="1" border="0" width="100%">
            <tr>
                <td>
                <div style="padding-bottom: 10px;">
                    {$lang.settings.interface_lang}:
					<select onchange="javascript: document.location=this.value;">
                    {section name=m loop=$langs_link}
							<option value="{$form.action}?section=11&language_id={$langs_link[m].id}" {if $langs_link[m].id == $current_lang_id}selected{/if}>{$langs_link[m].name}</option>
                    {/section}
					</select>
                </div>
                </td>
            </tr>
            </table>
            {if $errors}
                <table width="100%" cellpadding="3" cellspacing="0" border="0" style="margin: 0px; margin-top:10px; margin-bottom:15px;">
                <INPUT type="hidden" name="language_id" value="{$current_lang_id}">
                <tr class="table_header">
                    <td align="left" width="10%" class="main_header_text">{$lang.settings.position_number}</td>
                    <td align="left" width="30%" class="main_header_text">{$lang.settings.description}</td>
                    <td align="left" class="main_header_text">{$lang.settings.error_message}</td>
                    <td align="center" width="20%" class="main_header_text">{$lang.settings.error_to_default}</td>
                    <td align="center" width="5%" class="main_header_text">{$lang.settings.page_preview}</td>
                </tr>
                {section name=e loop=$errors}
                <tr {if $smarty.section.e.index mod 2 eq 1}class="even"{else}class="odd"{/if}>
                    <td align="left">
                    {$errors[e].code}
                    </td>
                    <td align="left">
                    {$errors[e].description}
                    </td>
                    <td align="left">
                    <textarea name="message[{$errors[e].id}]" rows="1" style="width: 80%;margin-top:5px;margin-bottom:5px;">{$errors[e].message}</textarea>
                    </td>
                    <td align="center">*}
                    {*<input type="button" value="{$lang.button.to_default}" onclick="javascript: document.admin_form.sel.value='default'; document.admin_form.pos.value='{$errors[e].id}'; document.admin_form.submit();">*}
{*					<a href="#" class="admin_button" onclick="javascript:document.admin_form.sel.value='default'; document.admin_form.pos.value='{$errors[e].id}'; document.admin_form.submit();">{$lang.button.to_default}<span>&nbsp;</span></a>
                    </td>
                    <td align="center">*}
                    {*<input type="button" value="{$lang.button.preview}" onclick="javascript: window.open('{$server}/error.php?code={$errors[e].code}&view_from_admin=1&lang_from_admin={$current_lang_id}');">*}
{*					<a href="#" class="admin_button" onclick="javascript:window.open('{$server}/error.php?code={$errors[e].code}&view_from_admin=1&lang_from_admin={$current_lang_id}');">{$lang.button.preview}<span>&nbsp;</span></a>
                    </td>
                </tr>
                {/section}
                <tr class="table_header"><td colspan="5">&nbsp;</td></tr>
				</table>
            {/if}
            <a href="#" class="admin_button_major" onclick="javascript:document.admin_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
            </form>
		</div>
	</div>
</div>
{/if}*}{*end 11*}

<script text="text/javascript">
{literal}
    function toggleMaintenanceDetails(){
        if ($("#status_1").attr("checked")){
            if ($("#tr_PageEditor").css("display")=='none'){
                $("#tr_PageEditor").css("display","");
            }
        }else if ($("#status_0").attr("checked") || !($("#status_1").attr("checked"))){
            if ($("#tr_PageEditor").css("display")!='none'){
                $("#tr_PageEditor").css("display","none");
            }
        }
        return;
    }

    function toggleWarningDetails(){
        if ($("#status_warning_1").attr("checked")){
            if ($("#PageEditor").css("display")=='none'){
                $("#PageEditor").css("display","");
            }
        }else if ($("#status_warning_0").attr("checked") || !($("#status_warning_1").attr("checked"))){
            if ($("#PageEditor").css("display")!='none'){
                $("#PageEditor").css("display","none");
            }
        }
        return;
    }
{/literal}
</script>

{if $sec eq 5}
<div class="panel_section">
<div class="panel_content">
			<form name="db_form" action="{$form.action}" method="post">
			<input type="hidden" name="par" value="db">
			<input type="hidden" name="sel" value="change">
 			<input type="hidden" name="section" value="5">
 				<table cellpadding="5">
					<tr><td colspan="2" style="margin-bottom:20px;margin-top:5px;"><b>{$lang.settings.base_accessform}</b></td></tr></table>
 				<table cellpadding="5">
					<tr>
                        <td align="left" width="150px">{$lang.settings.dbhost}:&nbsp;</td>
                        <td align="left"><input type="text" name="dbhost" value="{$data.dbhost}" size="40"></td>
                   </tr>
					<tr>
                        <td align="left" width="150px">{$lang.settings.dbuname}:&nbsp;</td>
                        <td align="left"><input type="text" name="dbuname" value="{$data.dbuname}" size="40"></td>
                   </tr>
                    <tr>
                        <td align="left" width="150px">{$lang.settings.dbname}:&nbsp;</td>
                        <td align="left"><input type="text" name="dbname" value="{$data.dbname}" size="40"></td>
                    </tr>
                    <tr>
                        <td align="left" width="150px">{$lang.settings.prefix}:&nbsp;</td>
                        <td align="left"><input type="text" name="prefix" value="{$data.prefix}" size="40"></td>
                    </tr>
                    {*<tr height="10">
                        <td colspan=2 align="left">
                        	<a href="#" class="admin_button_major" onclick="javascript:document.db_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
                        </td>
                    </tr>*}
				</table>
{*			</form>
            <form name="other_form" action="{$form.action}" method="post">*}
				{*<input type="hidden" name="par" value="dbpass">
				<input type="hidden" name="sel" value="change">*}
				<input type="hidden" name="section" value="5">
				<input type="hidden" name="point" id="point">
				<table border=0 cellspacing=0 cellpadding=5 width="100%" style="margin-top:15px;">
				<tr><td colspan="2" style="margin-bottom:20px;"><b>{$lang.settings.base_editform}</b></td></tr></table>
				<table cellpadding=5>
				<tr>
					<td align="left" width="150px">{$lang.settings.back_up_limit_file}:&nbsp;</td>
					<td align="left"><input type="text" name="back_up_limit_file" value="{$data.back_up_limit_file}" size=10></td>
				</tr>
{*				<tr height="10">
					<td colspan=2 align="left">
						<a href="#" class="admin_button_major" onclick="javascript:document.other_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
					</td>
				</tr>				*}
				</table>
{*			</form>

			<form name="dbpass_form" action="{$form.action}" method="post">*}
			{*<input type="hidden" name="par" value="dbpass">
			<input type="hidden" name="sel" value="change">
			<input type="hidden" name="section" value="5">*}
				<table cellpadding="5">
                    <tr>
                        <td align="left" width="150px">{$lang.settings.dbpass}:&nbsp;</td>
                        <td align="left"><input type="password" name="dbpass" value="" size="40"></td>
                    </tr>
                    <tr>
                        <td align="left" width="150px">{$lang.settings.repass}:&nbsp;</td>
                        <td align="left"><input type="password" name="dbrepass" value="" size="40"></td>
                    </tr>
                    <tr>
                        <td align="left" width="150px">{$lang.settings.oldpass}:&nbsp;</td>
                        <td align="left"><input type="password" name="dboldpass" value="" size="40"></td>
                    </tr>
                    <tr height="10">
                        <td colspan=2 align="left">
                        	<a href="#" class="admin_button_major" onclick="javascript:document.db_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
                        </td>
                    </tr>
					</form>
                    <tr>
                        <td colspan=2 align="left" width="350px"><font face="Tahoma" style="font-size: 11px"><b>{$lang.hint}:</b>&nbsp;&nbsp;{$lang.settings.backup_comment}</font></td>
                    </tr>
                    <tr height="10">
                        <td colspan=2 align="left">
                        	<a href="#" class="admin_button" onclick="javascript:  window.open('{$data.backup_link}','basefile', 'height=500, resizable=yes, scrollbars=yes,width=750, menubar=no,status=no');">{$lang.settings.backup}<span>&nbsp;</span></a>
                        </td>
                    </tr>
				</table>
			</form>
</div>
</div>
{/if}{*end 5*}

{if $sec eq 16}
	{if $use_pilot_module_multidomainV1}
		{include file="$admingentemplates/admin_multidomain.tpl"}
	{/if}
{/if}{*end 16*}

{if $sec eq 20}
{literal}
<style type="text/css">
	label {
		vertical-align: inherit;
		padding-bottom:8px;
	}
</style>
{/literal}
<div class="panel">
	<div class="panel_section">
		<div class="panel_content">
			<form method="POST" name="admin_form" id="admin_form" action="{$form.action}">
		    <input type="hidden" name="sel" value="change">
			<input type="hidden" name="par" value="google_analytics">
			<input type="hidden" name="section" value="20">
				<table border="0" cellpadding="4" cellspacing="1">
					<tr>
						<td class="fl" style="min-width:170px;padding-bottom:10px;">{$lang.admin.ga.activate}</td>
						<td>
							<input type="radio" name="activate" id="ga_yes" {if $data.google_analytics_activate eq 1}checked{/if} value="1">
							<label for="ga_yes">{$lang.admin.ga.yes}</label>
						</td>
						<td style="min-width:140px;">
							<input type="radio" name="activate" id="ga_no" {if $data.google_analytics_activate eq 0}checked{/if} value="0">
							<label for="ga_no">{$lang.admin.ga.no}</label>
						</td>
						<td>&nbsp;</td>
					</tr>
					<tr id="account_id" {if $data.google_analytics_activate eq 0 && $activate eq 0} style="display:none;" {/if}>
						<td class="fl" style="min-width:170px;padding-bottom:10px;">{$lang.admin.ga.account_id}</td>
						<td colspan="2">
							<input type="text" name="account_id" value="{$data.google_analytics_account_id}">
						</td>
						<td><a href="http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=113500" target="_blank">{$lang.admin.ga.account_id_what}</a></td>
					</tr>
					<tr id="placement" {if $data.google_analytics_activate eq 0 && $activate eq 0} style="display:none;" {/if}>
						<td class="fl" style="min-width:170px;">{$lang.admin.ga.placement}</td>
						<td>
							<input type="radio" name="placement" id="ga_top" {if $data.google_analytics_placement eq 1}checked{/if} value="1">
							<label for="ga_top">{$lang.admin.ga.top}</label>
						</td>
						<td style="min-width:140px;">
							<input type="radio" name="placement" id="ga_footer" {if $data.google_analytics_placement eq 0}checked{/if} value="0">
							<label for="ga_footer">{$lang.admin.ga.footer}</label>
						</td>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<td class="fl" style="min-width:170px;">{$lang.admin.ga.manual_tracker}</td>
						<td>
							<input type="radio" name="activate_manual" id="manual_yes" {if $data.manual_tracker_activate eq 1}checked{/if} value="1">
							<label for="manual_yes">{$lang.admin.ga.yes}</label>
						</td>
						<td style="min-width:140px;">
							<input type="radio" name="activate_manual" id="manual_no" {if $data.manual_tracker_activate eq 0}checked{/if} value="0">
							<label for="manual_no">{$lang.admin.ga.no}</label>
						</td>
						<td>&nbsp;</td>
					</tr>
					<tr id="placement_manual" {if $data.manual_tracker_activate eq 0 && $activate_manual eq 0} style="display:none;" {/if}>
						<td class="fl" style="min-width:170px;">{$lang.admin.ga.placement}</td>
						<td>
							<input type="radio" name="placement_manual" id="manual_top" {if $data.manual_tracker_placement eq 1}checked{/if} value="1">
							<label for="manual_top">{$lang.admin.ga.top}</label>
						</td>
						<td style="min-width:140px;">
							<input type="radio" name="placement_manual" id="manual_footer" {if $data.manual_tracker_placement eq 0}checked{/if} value="0">
							<label for="manual_footer">{$lang.admin.ga.footer}</label>
						</td>
						<td>&nbsp;</td>
					</tr>
					<tr id="another" {if $data.manual_tracker_activate eq 0 && $activate_manual eq 0} style="display:none;" {/if}>
						<td class="fl" style="min-width:170px;" valign="top">{$lang.admin.ga.another_tracker_code}</td>
						<td colspan="2">
							<textarea cols="30" rows="8" name="another">{$data.another_tracker_code}</textarea>
						</td>
						<td>&nbsp;</td>
					</tr>
					{*<tr>
						<td colspan="3" align="center">
							<a href="#" class="admin_button_major" onclick="javascript:document.admin_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
						<td>&nbsp;</td>
					</tr>*}
				</table>
			</form>
			<script text="text/javascript">
			{literal}
				$("#ga_yes").change(function(){
					$("#account_id").show(),
					$("#placement").show()
				});
				$("#ga_no").change(function(){
					$("#account_id").hide(),
					$("#placement").hide()
				});
				$("#manual_yes").change(function(){
					$("#another").show(),
					$("#placement_manual").show()
				});
				$("#manual_no").change(function(){
					$("#another").hide(),
					$("#placement_manual").hide()
				});
			{/literal}
			</script>
		</div>
	</div><a href="#" class="admin_button_major" onclick="javascript:document.admin_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
</div>
{/if}{*end 20*}

{if $sec eq 3}
{if $ajax eq 0}
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/area-editor.js"></script>
<div class="panel" style="width: 100%">
<div class="user_operation_line" style="height: 4px;font-size:0px;"></div>
    <div class="cr">&nbsp;</div>
			<div id="show_block" style="width: 100%">
{/if}
    <div class="user_status_line">
        <div id="tab_list" class="user_status_elem_active" onclick="ShowEditor('list','admin_settings.php?section=3&ajax=1');">
            {$lang.settings.section_name.3}
        </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" onclick="ShowEditor('install','admin_settings.php?sel=lang_list&ajax=1');">
            <a>{$lang.install_spr.install_lang}</a>
        </div>
        <div class="cr"></div>
        <div class="panel_subtabs" style="width: 100%">
        	<div class="panel_content" style="width: 97%">
		<form id="settings_form_lang_ident" name="settings_form_lang_ident" class="settings_form_lang_ident" action="{$form.action}?sel=change&par=other&lang_ident=1" method="POST">
		<table border=0 cellspacing=0 cellpadding=5>
			<tr>
				<td align="left" nowrap class="main_header_text" width="auto" style="margin-right:10px;">{$lang.settings.use_lang_ident_feature}:&nbsp;</td>
				<td class="main_content_text" align="center"><input type="checkbox" name="lang_ident_feature" id="lang_ident_feature" value="1" {if $data.lang_ident_feature}checked{/if}></td>
				<td align="left">
					<div id="error_box" class="error_box_blue" style="background-color:#EEF6EF"></div>
				</td>
			</tr>
		</table>
		</form>
		<script language="JavaScript" type="text/javascript">
		{literal}
			var options = { 
				success: function(data){
					ShowAjaxError(data, '', 'success');
					return false;
				},
				beforeSubmit: function() { 
					ajaxIndicator(1, 'error_box');
				}
			};
			$(document).ready(function(){
				$("#lang_ident_feature").change(function (){
					$('.settings_form_lang_ident').ajaxSubmit(options);
					return false;
				});
			});
		{/literal}
		</script>
    			<form name="lang_form" action="{$form.action}" method="post">
				<input type="hidden" name="par" value="lang">
				<input type="hidden" name="sel" value="change">
 				<input type="hidden" name="section" value="3">
 				<table border="0" width="100%">
					<tr valign=center>
                        <td align="left" width="15%">{$lang.settings.lang}:&nbsp;</td>
                        <td align="left">
							<select name="def_l" style="width:195">
							{section name=s loop=$language}
								<option value="{$language[s].value}"{if $language[s].sel}selected{/if}><span lang="{$language[s].value}">{$language[s].name}</span></option>
							{/section}
							</select>
						</td>
                        <td align="left" width="60%">
						</td>
                    </tr>

                   	<tr>
                        <td align="left" width="15%">{$lang.settings.visible_lang}:&nbsp;</td>
                        <td align="left"  width="40%">
						<table border="0" width="100%" height="100%" cellSpacing="0" cellPadding="0">
						{section name=s loop=$language}
						<tr>
							<td width="5px" height="25px"><input type=checkbox name="visible[{$smarty.section.s.index}]" value="{$language[s].value}" {if $language[s].visible}checked{/if}></td>
							<td class="main_content_text">&nbsp;{$language[s].name}&nbsp;&nbsp;</td>
							<td height="25px" align="right">
							{*	<input type="button" value="{$lang.button.edit}" class="button" onclick="{literal}javascript:EditLang({/literal}'{$language[s].value}'{literal}){/literal}">*}
								<a onclick="{literal}javascript:EditLang({/literal}'{$language[s].value}'{literal}){/literal}">{$lang.button.edit}</a>
							</td>
							<td height="25px" align="right">
								<a onclick="javascript: window.open('admin_settings.php?sel=list_ident_countries&id={$language[s].value}','','width=800, height=600, resizable=1, scrollbars=1');">{$lang.lang_ident_feature.edit_countries}</a>
								{*<input type="button" value="{$lang.lang_ident_feature.edit_countries}" class="button" onclick="javascript: window.open('admin_settings.php?sel=list_ident_countries&id={$language[s].value}','','width=800, height=600, resizable=1, scrollbars=1');">*}
							</td>
						</tr>
						{/section}
						</table>
						</td>
                        <td valign=bottom align="left" width="70%">
                        <table border="0" cellSpacing="1" cellPadding="0" width="100%" height="100%">
	 	                {section name=s loop=$language}
		                	<tr valign="center" align="center">
								<td height="24px"><div id="div_lang_name[{$language[s].value}]" style="display: none;"><b>{$lang.settings.lang_name}:</b> <input type="text" name="lang_name[{$language[s].value}]" value="{$language[s].name}" size="15" onchange="{literal}javascript:CheckEmpty({/literal}'lang_name[{$language[s].value}]'{literal}){/literal}"></div></td>
								<td height="24px"><div id="div_lang_code[{$language[s].value}]" style="display: none;"><b>{$lang.settings.lang_code}:</b> <input type="text" name="lang_code[{$language[s].value}]" value="{$language[s].code}" size="10" onchange="{literal}javascript:CheckEmpty({/literal}'lang_code[{$language[s].value}]'{literal}){/literal}"></div></td>
								<td height="24px">
									<div id="div_lang_dir[{$language[s].value}]" style="display: none;">
										<b>{$lang.settings.lang_dir}:</b>
										<select name="lang_dir[{$language[s].value}]">
											<option value="ltr" {if $language[s].dir eq 'ltr'} selected {/if}>{$lang.settings.lang_ltr}</option>
											<option value="rtl" {if $language[s].dir eq 'rtl'} selected {/if}>{$lang.settings.lang_rtl}</option>
										</select>
									</div>
								</td>
								<td height="24px"><div id="div_lang_charset[{$language[s].value}]" style="display: none;"><b>{$lang.settings.lang_charset}:</b> <input type="text" name="lang_charset[{$language[s].value}]" value="{$language[s].charset}" size="15" readonly></div></td>
	 	                	</tr>
	 	                {/section}
						</table>
                        </td>
					</tr>
                    <tr height="10">
                        <td colspan="3" align="left">
                        	<a class="admin_button_major" onclick="javascript:document.lang_form.submit();">{$lang.button.save}<span>&nbsp</span></a>
                        	{* onclick="javascript:SaveBlock('show_block', 'lang_form');"<input type="button" value="{$lang.button.save}" class="button" onclick="javascript:document.lang_form.submit();">*}
                        </td>
						{*<td align="left" width="60%">&nbsp;</td>*}
                    </tr>
				</table>
				</form>
				
			
				<form name="lang_add_form" action="{$form.action}" method="post">
				<input type="hidden" name="par" value="lang_add">
				<input type="hidden" name="sel" value="change">
 				<input type="hidden" name="section" value="3">
 				<table border="0" width="100%">
                    <tr valign="center">
                        <td align="left" width="15%">{$lang.settings.lang_add}:&nbsp;</td>
                        <td align="left" colspan="2">
							<table border="0" cellSpacing="1" cellPadding="0" width="100%">
		                		<tr valign="center" align="center">
									<td>{$lang.settings.lang_name}</td>
									<td style="margin-left:10px;">{$lang.settings.lang_dir}</td>
									<td style="margin-left:10px;">{$lang.settings.lang_code}</td>
									<td style="margin-left:10px;">{$lang.settings.lang_charset}</td>
	 	                		</tr>
		                		<tr valign="center">
									<td><input type="text" name="name" value="" size="15"> e.g. english</td>
									<td style="margin-left:10px;">
										<select name="dir">
											<option value="ltr">{$lang.settings.lang_ltr}</option>
											<option value="rtl">{$lang.settings.lang_rtl}</option>
										</select>
									</td>
									<td style="margin-left:10px;"><input type="text" name="code" value="" size="10"> e.g. en&nbsp;<a href="http://www.loc.gov/standards/iso639-2/php/code_list.php" target="_blank">{$lang.home_page.view_more}</a></td>
									<td style="margin-left:10px;"><input type="text" name="charset" value="UTF-8" size="15" readonly>&nbsp;UTF-8</td>
	 	                		</tr>
							</table>
						</td>
                    </tr>
                    <tr height="10">
						<td align="left">
							<a  onclick="javascript: document.lang_add_form.submit();" class="admin_button_major">{$lang.button.add}<span>&nbsp;</span></a>
							{*<input type="button" value="{$lang.button.add}" class="button" onclick="javascript: document.lang_add_form.submit();">*}
						</td>
                    	<td colspan="2" align="left">
                    		<div id="error_box"></div>
                    	</td>
            		</tr>
            	</table>
            	</form>
			</div>
		</div>
	</div>
{if $ajax eq 0}            	
			</div>
</div>
<div class="cr">&nbsp;</div>
<script type="text/javascript">
var tab_last = 'list';
var tab_link = 'admin_settings.php?section=3&ajax=1';
{literal}

var options = { 
	success: function(data){
		ajaxIndicator(0, 'error_box');
		data = data.replace(/\<\/?(head|body)\>/g,'');
		if (data == 'saved'){
			ShowBlock('show_block', tab_link);
		} else {
			$('.error').html(data).fadeIn(100);
			if ( $.browser.msie) {
    			DD_roundies.addRule('div.error', '10px');
			} else {
    			$('div.error').corner();
			}
			$("body").animate({"scrollTop":0},"slow");
			$('.error').oneTime(15000, function() {
				$('.error').fadeOut(500);
			});
		}
		return false;
	},
	beforeSubmit: function() { 
		ajaxIndicator(1, 'error_box');
	}
};
	function EditLang (id){
		document.getElementById('div_lang_name['+id+']').style.display = '';
		document.getElementById('div_lang_code['+id+']').style.display = '';
		document.getElementById('div_lang_charset['+id+']').style.display = '';
		document.getElementById('div_lang_dir['+id+']').style.display = '';
	}
	function CheckEmpty (name){
		if(document.lang_form[name].value ==""){
				alert({/literal}"{$lang.err.empty_language|escape:javascript}"{literal});
				return false;
			}
	}
	
{/literal}
</script>
{/if}
{/if}{*end 3*}
{if $sec eq 18}
    <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_active" onclick="ShowEditor('edit','admin_settings.php?section=18&ajax=1');">
            {$lang.settings.section_name.18}
        </div>
        <div id="tab_install" class="user_status_elem" onclick="ShowEditor('install','admin_settings.php?sel=lang_list&ajax=1');">
            <a>{$lang.install_spr.install_lang}</a>
        </div>
        <div class="cr"></div>
        <div class="panel_subtabs" style="width: 100%">
        	<div class="panel_content" style="width: 97%">

<table>
	<tr>
            	<td colspan="4">
            		<div style="height:25px;clear:both;">
            			<div class="main_header_text" style="width:170px;float:left;">
            				{$lang.settings.language_edit}:&nbsp;
            			</div>
            			<div style="float:left;">
            				<select name="language" id="language" style="width:150px;" onchange="SelectLang();">
            					{section name=s loop=$language}
									<option value="{$language[s].name}"><span lang="{$language[s].id}">{$language[s].name}</span></option>
								{/section}
            				</select>
            			</div>
            			<div align="right"  style="float:left;">
            				<span id="info" style="margin-left:400px;"></span>
            			</div>
{*            			<div align="right">
            				<a class="admin_button_major" onclick="Save();">{$lang.button.save}<span>&nbsp;</span></a>
            			</div>*}
            		</div>
            		<div style="height:25px;clear:both;">
            			<div class="main_header_text" style="width:170px;float:left;clear:both;">
            				{$lang.settings.language_edit_text}:&nbsp;
            			</div>
            			<div>
            				<select name="mode" id="mode" style="width:150px;" onchange="SelectMode(this.value);">
								<option value="">{$lang.index.please_select}</option>
								<option value="admin">{$lang.settings.admin_lang}</option>
								<option value="error">{$lang.settings.error_lang}</option>
								<option value="module">{$lang.settings.module_lang}</option>
								<option value="user">{$lang.settings.user_lang}</option>
								<option value="mail">{$lang.settings.mail_lang}</option>
								<option value="builder">{$lang.settings.builder_lang}</option>
            				</select>
            			</div>
            		</div>
            		<div id="files_list" style="height:25px;clear:both;">
            			<div class="main_header_text" style="width:170px;float:left;">
            				{$lang.settings.language_edit_list}:&nbsp;
            			</div>
            			<div id="files" style="float:left;">
            				<select name="file" id="file" disabled style="width:150px;" onchange="SelectFiles(this.value);">
								<option value="">{$lang.index.please_select}</option>
            				</select>
            			</div>
            		</div>
					
					{*<form name="search_string" action="{$server}{$site_root}/admin/admin_settings.php?sel=search_string" id="search_string" method="POST">*}
							<tr valign=center>
						<table cellpadding="0" cellspacing="0" border="0" style="margin-top: 10px;">
								<td align="left">
									{$lang.find_in} 
									<select name="find_lang" id="find_lang" style="width:195px">
										{section name=s loop=$language}
											<option value="{$language[s].name}"><span lang="{$language[s].id}">{$language[s].name}</span></option>
										{/section}
									</select>
								</td>
								<td style="padding-left:10px;">
									{$lang.search_for} 
									<input type="text" name="search_string" id="search_string_value" size="30">
								</td>
								<td style="padding-left:10px;">
									<div class="fl">
										<a class="admin_button" id="start_search">{$lang.button.search}<span>&nbsp;</span></a>
									</div>
									<div class="fl error_box"></div>
								</td>
							</tr>
						</table>
					{*</form>*}
					
	           		<div align="center">
  		 				{*<div id="edit_text">
        		 			<textarea cols="152" rows="45" id="edit"></textarea>
            		 	</div>*}
            		 	<div id="edit_search">
            		 	</div>
						
						<form name="lang_form" id="lang_form" method="POST" action='{$form.action}'>
							<input type="hidden" name="change_section" value="1">
							<input type="hidden" name="ajax" value="1">
							<input type="hidden" name="save_xml" value="1">
							<div id="edit_fields"></div>
            			<div align="left" id="save_but" style="display:none;">
            				<a class="admin_button_major" onclick="Save();">{$lang.button.save}<span>&nbsp;</span></a>
            			</div>
						</form>
        			</div>
        		</td>
        	</tr>
 </table>
 </div>
 </div>
 </div>
        	{literal}
		    <script language="JavaScript" type="text/javascript">
				$(document).on('change', '#edit_fields textarea', function(){
					$(this).css('background-color', '#FAFFE0').attr('changed','1');
				});
					
		    	var OPEN = '';
		    	var SAVED = 0;
		    	var SELECT = 0;
		    	lang_name = $('#language option:selected').val();
		    	document.body.setAttribute("onbeforeunload", "if (SAVED == 0 && (SELECT == 1 || OPEN != '')) return \"{/literal}{$lang.admin.lang_edit.confirm|escape:javascript}{literal}\";");
		    	$("#edit").focus(function () {
		    		SAVED = 0;
		    	});
				
							
				$(document).ready(function() {
				    var options = {
						data: {
							ajax: "1"
						},
						success: function(data){
							$('#edit_fields').html(data);
							return false;
						}
					};
					$('#start_search').click(function(){
						var search_str = $("#search_string_value").val();    
						var find_lang = $("#find_lang").val(); 
						search_str = search_str.replace(/^\s+|\s+$/g, '') ;
						if ($("#find_lang").val() != '' && search_str != '') {
							$.post("{/literal}{$form.action}{literal}?sel=search_string", {async:false, find_lang:find_lang, search_string:search_str, ajax:1}, 
								function(data){$('#edit_fields').html(data);
								}
							);							
							return false;
						} else { 
							alert("{/literal}{$lang.content.error_search_lang|escape:javascript}{literal}");
						}
					});
				});
				
		    	function SelectLang() {
		    		if(SAVED == 0 && SELECT == 1) {
		    			if(confirm("{/literal}{$lang.admin.lang_edit.confirm|escape:javascript}{literal}")) {
		    				$("#edit").val("");
							$("#edit_fields").html('');
		    				SELECT = 0;
		    				lang_name = $('#language option:selected').val();
		    				$('#file').html('<option value="">{/literal}{$lang.index.please_select}{literal}</option>');
		    				$('#file').attr('disabled', 'disabled');
		    				$('#mode option:first').attr('selected', 'selected');
		    			} else {
		    				$('#language option[value='+lang_name+']').attr('selected','selected');      
		    			}
		    		}
		    	}
    			function SelectMode(temp_mode) {
    				lang_name = $('#language option:selected').val();
    				if(temp_mode != '') {
   						if(SAVED == 0 && SELECT == 1) { 
   							if (confirm("{/literal}{$lang.admin.lang_edit.confirm|escape:javascript}{literal}")) {
								$('#file').removeAttr('disabled');
								$.post("{/literal}{$form.action}{literal}", {async:false, sel:"mode", lang_name:lang_name, mode:temp_mode}, function(data){$("#files").html(data);});
   								mode = temp_mode;
   								$("#edit").val("");
								$("#edit_fields").html('');
   								SELECT = 0;
   							} else {
   								$('#mode option[value='+mode+']').attr('selected','selected');	
   							}
   						} else {
    					$('#file').removeAttr('disabled');
    					$.post("{/literal}{$form.action}{literal}", {async:false, sel:"mode", lang_name:lang_name, mode:temp_mode}, function(data){$("#files").html(data);});
   							mode = temp_mode;
   							$("#edit").val("");
							$("#edit_fields").html('');
   							SELECT = 0;
   						}
    				} else {
   						if(SAVED == 0 && SELECT == 1) { 
   							if (confirm("{/literal}{$lang.admin.lang_edit.confirm|escape:javascript}{literal}")) {
   								$('#file').html('<option value="">{/literal}{$lang.index.please_select}{literal}</option>');
   								$("#edit").val("");
								$("#edit_fields").html('');
   								SELECT = 0;
   							} else {
   								$('#mode option[value='+mode+']').attr('selected','selected');	
   							}
    				} else {
   							$('#file').html('<option value="">{/literal}{$lang.index.please_select}{literal}</option>');
    					$('#file').attr('disabled', 'disabled');
   							$("#edit").val("");
							$("#edit_fields").html('');
   							SELECT = 0;
   						}
    				}
    			}
    			function SelectFiles(lang_file) {
    				lang_name = $("#language").val();
    				temp_mode = $("#mode").val();
					$("#save_but").css("display", "block");
    				if(lang_file != '') {
    					if(SAVED == 0 && SELECT == 1) {
    						if (confirm("{/literal}{$lang.admin.lang_edit.confirm|escape:javascript}{literal}")) {
    							ajaxLoadingImage(1, 'info');
    							$.post(
									"{/literal}{$form.action}{literal}", 
									{
										async:false, 
										sel:"lang_edit", 
										lang_name:lang_name, 
										mode:temp_mode, 
										lang_file:lang_file
									}, 
									function(data){
										ajaxLoadingImage(0, 'info'); 
										$("#edit_fields").html(data);
									}
								);
    							SAVED = 0;
    							SELECT = 1;
    							file = lang_file;
    						} else {
    							$('#file option[value='+file+']').attr('selected','selected');	
    						}
    					} else {
    						ajaxLoadingImage(1, 'info')
    						$.post(
								"{/literal}{$form.action}{literal}", 
								{
									async:false, 
									sel:"lang_edit", 
									lang_name:lang_name, 
									mode:temp_mode, 
									lang_file:lang_file
								}, 
								function(data){
									ajaxLoadingImage(0, 'info');
									$("#edit_fields").html(data);
								}
							);
    						SAVED = 0;
    						SELECT = 1;
    						file = lang_file;
    					}
    				} else {
    					if(SAVED == 0 && SELECT == 1) {
    						if (confirm("{/literal}{$lang.admin.lang_edit.confirm|escape:javascript}{literal}")) {
    							SAVED = 0;
    							SELECT = 0;
    							$("#edit").val("");
								$("#edit_fields").html('');
    						} else {
    							$('#file option[value='+file+']').attr('selected','selected');	
    						}
    					} else {
    						SAVED = 0;
    						SELECT = 0;
    						$("#edit").val("");
							$("#edit_fields").html('');
    					}
    				}
    			}
    			function Save(){
    				lang_name = $("#language").val();
    				temp_mode = $("#mode").val();
    				lang_file = $("#file").val();
    				lang_text = $("#edit").val();
    				$("#info").show();
    				ajaxLoadingImage(1, 'info');
    				if (OPEN != '') {
    					lang_file = $("#path_"+OPEN).val();
    					lang_text = $("#edit_"+OPEN).val();
    					$.post("{/literal}{$form.action}{literal}", {async:false, sel:"search_save", lang_name:lang_name, mode:temp_mode, lang_file:lang_file, lang_text:lang_text}, 
							function(data){
								ajaxLoadingImage(0, 'info');
								ShowAjaxError(data);
							}
						);
    				}
    				if(OPEN == '' && temp_mode != '' && lang_file != '') {
						var form_arr = $('#lang_form input,select').serializeArray();
						var form_obj = {};
						for(var i in form_arr){
							form_obj[form_arr[i].name] = form_arr[i].value;
						}
						form_obj.lang_name = lang_name;
						form_obj.sel = "lang_save";
						form_obj.mode = temp_mode;
						form_obj.lang_file = lang_file;
						$('#edit_fields').find('textarea').each(function(){
							if($(this).attr('changed') == '1'){
								form_obj[$(this).attr('name')] = $(this).val();
								$(this).removeAttr('changed').css('background-color', '#FFFFFF');
							}
						});
						
						$.post(
							'admin_settings.php',
							form_obj,
							function(data){
								ajaxLoadingImage(0, 'info');
								ShowAjaxError(data);
								return false;
							}
						);

    				}
    				SAVED = 1;
    			}
    			function Search() {
    				lang_name = $("#language").val();
    				temp_mode = $("#mode").val();
    				if (temp_mode == '') temp_mode='all';
    				search_text = $("#search").val();
    				if(search_text != '') {
    					$("#info").show();
    					ajaxLoadingImage(1, 'info');
    					$.post("{/literal}{$form.action}{literal}", {async:false, sel:"search", lang_name:lang_name, mode:temp_mode, search_text:search_text}, function(data){ajaxLoadingImage(0, 'info');$("#info").hide();$("#edit_search").html(data);});
    				}
    			}
    			function SearchBlock() {
    				if(SAVED == 0 && (SELECT == 1 || OPEN != "") ) {
    					if (confirm("{/literal}{$lang.admin.lang_edit.confirm|escape:javascript}{literal}")) {
	    					$("#search_block").toggle(200);
    						$("#files_list").toggle(200);
    						$("#edit_text").toggle(200);
    						$("#search").val("");
    						$("#edit_search").html("");
    						OPEN = "";
    					}
    				} else {
    				$("#search_block").toggle(200);
    				$("#files_list").toggle(200);
    				$("#edit_text").toggle(200);
    				$("#search").val("");
    				$("#edit_search").html("");
    				OPEN = "";
    			}
    			}
    			function SearchRes(key) {
    				$(".search").hide();
    				$("#"+key).show();
    				OPEN = key;
    			}
    		</script>
    		{/literal}
{/if}{*end 18*}

{if $sec eq 22}
    <ul class="tabs">
    <li>
        <a {if $active eq "maps"} class="current" {else} href="admin_settings.php?section=22" {/if}>{$lang.settings.map_tab}</a>
    </li>
    <li>
        <a {if $active eq "distance"} class="current" {else} href="admin_distance.php" {/if}>{$lang.settings.distanse_tab}</a>
    </li>
    <li>
        <a {if $active eq "country"} class="current" {else} href="admin_countries.php" {/if}>{$lang.settings.counries_tab}</a>
    </li>
    </ul>
	<div class="cr"></div>
        <div class="panel_section">
        <div class="panel_content" style="margin-top:10px;">
            <form name="maps_form" action="{$form.action}" method="post">
            <input type="hidden" name="sel" value="change">
            <input type="hidden" name="par" value="maps">
            <input type="hidden" name="section" value="22">
            <dl style="overflow:hidden">
                <dd style="float: left; width: 450px;margin-left:0px;"><b>{$lang.settings.google_maps_api_key}:&nbsp;</b><br />
                    <i>{$lang.settings.google_maps_hint} <a href='http://www.google.com/apis/maps/signup.html' target='_blank'>Google</a></i></dd>
                <dd style="float: left;">
                    <input type="radio" name="map_radio" value="google" {if $data.map_type eq 'google'} checked {/if} onclick="MapChange(this.value);"/>
					{$lang.settings.api_key}
                    <input type="text" name="google_app_id" id="google_app_id" value="{$data.google_app_id}" {if $data.map_type eq 'ovi'} disabled {/if} >
                </dd>
            </dl>
            <dl style="overflow:hidden">
                <dd style="float: left; width: 450px;margin-left:0px;"><b>{$lang.settings.application_id}:&nbsp;</b><br />
                    <i>{$lang.settings.application_id_hint} </i></dd>
                <dd style="float: left;">
                    <div>
                        <div style="overflow:hidden">
                            <div style="width: 25px; float: left;">
                             <input style="" type="radio" name="map_radio" value="ovi" {if $data.map_type eq 'ovi'} checked="" {/if} onclick="MapChange(this.value);"/>
                            </div>
                            <div style="float: left; margin-bottom: 5px;">
                                <div style="width: 53px; float: left;">{$lang.settings.ovi_appId}</div>
                                <input type="text" name="ovi_appId" id="ovi_appId" value="{$data.ovi_appId}"  {if $data.map_type eq 'google'} disabled="" {/if}/>
                            </div>
                        </div>
                        <div style="padding-left: 25px;">
                            <div style="width: 53px; float: left;">{$lang.settings.ovi_token}</div>
                            <input type="text" name="ovi_token" id="ovi_token" value="{$data.ovi_token}"  {if $data.map_type eq 'google'} disabled="" {/if}/>
                        </div>                                
                    </div>
                </dd>
            </dl>
        </div> 
        </div> 
        <div class="main_bottom">
            <a class="admin_button_major" onclick="javascript: document.maps_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
        </div>
        </form>
    
<script type="text/javascript">
{literal}
function MapChange(map_id) {
		if (map_id == 'google') {
			document.getElementById('google_app_id').disabled = false;
			//document.getElementById('map_app_id').disabled = true;
                        document.getElementById('ovi_appId').disabled = true;
                        document.getElementById('ovi_token').disabled = true;
		} else if (map_id == 'ovi') {
			document.getElementById('google_app_id').disabled = true;
			//document.getElementById('map_app_id').disabled = false;
                        document.getElementById('ovi_appId').disabled = false;
                        document.getElementById('ovi_token').disabled = false;
		}
		return;
	}
{/literal}
</script>
{/if}
<script type="text/javascript">
{literal}
		function showToolTip(e,text){
			if(document.all)e = event;
			var obj = document.getElementById('tooltip');
			obj.innerHTML = text;
			obj.style.display = 'block';
			var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
			var leftPos = e.clientX - $('#tooltip').width()-10;
			if(leftPos<0)leftPos = 0;
			obj.style.left = leftPos + 'px';
			obj.style.top = e.clientY - obj.offsetHeight -10 + st + 'px';
		}
		function hideToolTip(){
			document.getElementById('tooltip').style.display = 'none';
		}
{/literal}		
</script>

{if $ajax eq 0}  
{include file="$admingentemplates/admin_bottom.tpl"}
{/if}