{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>
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/area-editor.js"></script>
<script>
{literal}

var tab_link = 'admin_kisses.php?ajax=1';
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');
	}
};
{/literal}
</script>
<div class="cr"></div>
	<div class="error" style="border: 1px solid #E2EFE4;margin-top: 5px;padding: 10px;display: none;">
	</div>
</div>
<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">{$lang.admin_menu.ref_kiss_types}</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>{$lang.admin_help.ref_kiss_types}
    </div>
</div>
<div class="cr">&nbsp;</div>
<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 class="current">{$lang.admin_menu.ref_kiss_types}</a>
    </li>
</ul>

<div class="panel">
    <div class="user_operation_line">
    	<div style="padding: 12px;">
            <table cellSpacing="3" cellPadding="0">
                <tr>
                	<td><span style="color:white;">{$lang.settings.translate_into}:</span>
						<select onchange="javascript:window.open(this.value,'lang_edit', 'height=750, width=1050, left=10, top=50, resizable=yes, scrollbars=yes, menubar=no,status=no'); return false;">
								{section name=s loop=$lang_link}
							<option value="{$lang_link[s].link}">{$lang_link[s].name}</option>
							{/section}
						</select>
					</td>
                </tr>
            </table>
		</div>
    </div>
    <div class="cr"></div>
    <div class="user_status_line">
        <div class="cr"></div>
		<form id="settings_form" name="settings_form" class="settings_form" action="{$site_url}{$site_root}/admin/admin_kisses.php?sel=save&ajax_kiss=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_kiss_types}:&nbsp;</td>
				<td class="main_content_text" align="center"><input type="checkbox" name="use_kiss_types" id="use_kiss_types" value="1" {if $data.use_kiss_types}checked{/if}></td>
				<td align="left">
					<div id="error_box" class="error_box_blue" style="padding-top:0px;"></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(){
				$("#use_kiss_types").change(function (){
					$('.settings_form').ajaxSubmit(options);
					return false;
				});
			});
		{/literal}
		</script>
		<div class="cr"></div>
			<div id="show_block">
{/if}
				<table border="0" cellspacing="0" cellpadding="0" width="50%">
					<tr class="table_header">
						<td align="center" width="20">{$lang.kisses_spr.number}</td>
						<td align="center" >{$lang.kisses_spr.name}</td>
					</tr>
					{if $types}
						{section name=spr loop=$types}
							<tr {if $smarty.section.spr.index mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
								<td align="center" width="20">{$types[spr].number}</td>
								<td align="center">
									<table border=0 cellspacing=0 cellpadding=0 width="100%"><tr>
									{if $types[spr].image_path}<td align="right" width="30%"><a href="{$types[spr].editlink}" onclick="ShowBlock('show_block','{$types[spr].editlink}'); return false;"><img src="{$types[spr].image_path}" border=0></a>&nbsp;&nbsp;</td>{/if}
									<td align="left" width="70%"><a href="{$types[spr].editlink}" onclick="ShowBlock('show_block','{$types[spr].editlink}'); return false;">{$types[spr].name}</a></td>
									</tr></table>
								</td>
							</tr>
						{/section}
					{else}
					<tr height="40">
						<td class="main_error_text" align="left" colspan="2">{$lang.kisses_spr.empty}</td>
					</tr>
					{/if}
					<tr class="table_header"><td colspan="2">&nbsp;</td></tr>
				</table>
				<table>
					<tr height="40">
						<td>
							<a class="admin_button_major" onclick="ShowBlock('show_block','{$form.add_link}')">{$lang.button.add}<span>&nbsp;</span></a>
						</td>
					</tr>
				</table>
{if $ajax eq 0}			
		</div>
	</div>
</div>
{include file="$admingentemplates/admin_bottom.tpl"}
{/if}
