{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_last = 'info_pages';
var tab_link = 'admin_addition_info.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.area_editor}</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.area_help}
    </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 href="admin_kisses.php">{$lang.admin_menu.ref_kiss_types}</a>
    </li>
</ul>
<div class="panel">
    <div class="user_operation_line" style="height: 5px;">
    </div>
    <div class="cr"></div>
    <div class="user_status_line">
        <div id="tab_info_pages" class="user_status_elem_active" onclick="ShowEditor('info_pages','admin_addition_info.php?ajax=1');">
            {$lang.admin_menu.area_info}
        </div>
        <div id="tab_help" class="user_status_elem" onclick="ShowEditor('help','admin_advice.php?par=faq&ajax=1');">
            <a>{$lang.admin_menu.area_help}</a>
        </div>
        <div id="tab_take_tour" class="user_status_elem" onclick="ShowEditor('take_tour','admin_taketour.php?ajax=1');">
            <a>{$lang.admin_menu.area_take_tour}</a>
        </div>
        <div id="tab_advice_section" class="user_status_elem" onclick="ShowEditor('advice_section','admin_advice.php?par=advice&ajax=1');">
            <a>{$lang.admin_menu.area_advices}</a>
        </div>
        <div id="tab_success_stories" class="user_status_elem" onclick="ShowEditor('success_stories','admin_success_stories.php?ajax=1');">
            <a>{$lang.admin_menu.area_stories}</a>
        </div>
        <div class="cr"></div>
			<div id="show_block">
{/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}
				<table border="0" cellspacing="0" cellpadding="0" width="100%">
					<tr class="table_header">
						<td align="left" colspan="2" width="80">{$lang.addition.number}</td>
						<td align="left" width="200">{$lang.addition.name}</td>
						<td align="left">{$lang.addition.code}</td>
						<td align="center" width="70">{$lang.addition.status}</td>
						<td align="right" width="100">{$lang.button.action}</td>
					</tr>
					{if $pages}
					{section name=spr loop=$pages}
					<tr {if $smarty.section.spr.index mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
						<td align="left" width="70" valign="top" style="padding:4px;">
							<table>
								<tr>
									<td align="center">
										<div style="cursor: pointer;" onclick="ShowBlock('show_block','{$pages[spr].uplink}')"><img src="{$site_root}{$template_root}/images/arrow_sort_up.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.up}');return false" border="0"></div>
									</td>
								</tr>
								<tr>
									<td align="center">
										<div style="cursor: pointer;" onclick="ShowBlock('show_block','{$pages[spr].downlink}')"><img src="{$site_root}{$template_root}/images/arrow_sort_down.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.down}');return false" border="0"></div>
									</td>
								</tr>
							</table>
						</td>
						<td align="left" valign="top" width="10" style="padding:4"><a href="{$pages[spr].editlink}" onclick="ShowBlock('show_block','{$pages[spr].editlink}'); return false;">{$pages[spr].number}</a></td>
						<td align="left" valign="top" style="padding:4"><a href="{$pages[spr].editlink}" onclick="ShowBlock('show_block','{$pages[spr].editlink}'); return false;">{$pages[spr].name}</a></td>
						<td align="left" valign="top" style="padding:4">{$pages[spr].content}</td>
						<td align="center" valign="top" style="padding:4">{$pages[spr].status}</td>
						<td align="right" valign="top">
							{*<a class="admin_button" onclick="{literal}javascript: if(confirm({/literal}'{$form.confirm|escape:javascript}'{literal})){ShowBlock('show_block','{/literal}{$pages[spr].deletelink}{literal}')}{/literal}">{$lang.button.delete}<span>&nbsp;</span></a>*}
							<div class="block_action fr" style="display: none;">
								<div class="action_del" style="display: block;">
									<img width="16" alt="" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false" src="{$site_root}{$template_root}/images/photo_delete.png" onclick="{literal}javascript: if(confirm({/literal}'{$form.confirm|escape:javascript}'{literal})){ShowBlock('show_block','{/literal}{$pages[spr].deletelink}{literal}')}{/literal}">
								</div>
							</div>	
						</td>
					</tr>
					{/section}
					{else}
					<tr height="40">
						<td class="main_error_text" align="left" colspan="5">{$lang.addition.empty}</td>
					</tr>
					{/if}
					<tr class="table_header">
						<td colspan="6">
							&nbsp;
						</td>
					</tr>
				</table>
<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>
				<table style="margin-top:15px;">
					<tr height="40">
						<td>
							<a class="admin_button_major" onclick="ShowBlock('show_block','{$add_link}')">{$lang.button.add}<span>&nbsp;</span></a>
						</td>
					</tr>
				</table>
<script type="text/javascript">
	tab_link = 'admin_addition_info.php?ajax=1';
</script>
{if $ajax eq 0}
			</div>
	</div>
</div>
{include file="$admingentemplates/admin_bottom.tpl"}
{/if}
