{if !$ajax}
	{include file="$admingentemplates/admin_top.tpl"}
	<link href="{$site_root}{$template_root}/css/alert.css" rel="stylesheet" type="text/css">
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_blog.php">{$lang.button.back}</a>
</div>
<div class="cr"></div>

	<div class="show_help" style="display: none;">&nbsp;</div>

	<div id="boxes">
		<div id="dialog" class="window">
			{include file="$admingentemplates/admin_blog_dialog.tpl"}
		</div>
	</div>
	<div id="mask"></div>

	<div class="red_header">{$lang.blog.admin.razdel_name}</div>
	<div class="cr">&nbsp;</div>
	<div class="cr">&nbsp;</div>

	<div class="help_text">
		<div class="close_help">
			<img src="{$site_root}{$template_root}/images/close_help.png" alt="">
		</div>
		<div class="help_body">
			<span class="help_title">{$lang.help}:</span>{$lang.admin_help.blog_list}
		</div>
	</div>
	<div id="test_div" class="error_msg" style="padding: 5px 0px;display:none;">&nbsp;</div>
{/if}
	<div id="blogs_table_div" style="width:100%">
<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="3" width="100%">
			<tr class="table_header">
				<td align="center" width="2%">{$lang.blog.admin.number}</td>
				<td align="left" width="8%"%>{$lang.blog.admin.user_login}</td>
				<td align="left" width="8%">{$lang.blog.admin.creation_date}</td>
				<td align="left" width="10%">{$lang.blog.post_title}</td>
				<td align="left" width="55%">{$lang.blog.post_body}</td>
				<td align="right" width="17%">{$lang.button.action}</td>
			</tr>
			{section name=spr loop=$blog_posts}
			<tr {if $smarty.section.spr.index mod 2 eq 1}class="even"{else}class="odd"{/if}>
				<td align="center" valign="top">{$smarty.section.spr.index+$blog_posts[spr].mynumber}</td>
				<td align="left" valign="top">{$blog_posts[spr].login}</td>
				<td align="left" valign="top">{$blog_posts[spr].creation_date} {$blog_posts[spr].creation_time}</td>
				<td align="left" valign="top">{$blog_posts[spr].title}</td>
				<td align="left" valign="top"><div class="wysiwyg_content">{$blog_posts[spr].body}</div></td>
				<td align="center" valign="top">
{*					<div>
						<a href="{$file_name}?sel=edit_post&id_blog={$id_blog}&id={$blog_posts[spr].id}">{$lang.button.edit}</a>
					</div>
					<div>
						<a href="javascript:void(0)" onclick="javascript: if(confirm('{$lang.admin_blog.dialog_post|escape:javascript}')) {literal}{{/literal}answ = {$blog_posts[spr].id}; Delete();{literal}}{/literal} else return false;" "Dialog({$blog_posts[spr].id});">{$lang.button.delete}</a>
					</div>
					<div>
						<a href="{$file_name}?sel=view_comments&id_blog={$id_blog}&id={$blog_posts[spr].id}">{$lang.blog.admin.view_comments}</a>
					</div>*}
							<div class="block_action fr" style="display: none;">
								<div class="action_del" style="display: block;float:left;cursor:pointer;">
									<img height="16" alt="" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.view}');return false" src="{$site_root}{$template_root}/images/icn_view.png" onclick="document.location.href='{$file_name}?sel=view_comments&id_blog={$id_blog}&id={$blog_posts[spr].id}'">
								</div>
								<div style="width:10px;" class="fl">&nbsp;</div>
								<div class="action_edit" style="display: block;float:left;cursor:pointer;">
									<img height="16" alt="" src="{$site_root}{$template_root}/images/edit.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.edit}');return false" onclick="document.location='{$file_name}?sel=edit_post&id_blog={$id_blog}&id={$blog_posts[spr].id}'">
								</div>
								<div style="width:10px;" class="fl">&nbsp;</div>
								<div class="action_edit" style="display: block;float:left;cursor:pointer;">
									<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" onclick="javascript: if(confirm('{$lang.admin_blog.dialog_post|escape:javascript}')) {literal}{{/literal}answ = {$blog_posts[spr].id}; Delete();{literal}}{/literal} else return false;" {*"Dialog({$blog_posts[spr].id});"*}>
								</div>
							</div>
				</td>
			</tr>
			{sectionelse}
			<tr height="40">
				<td class="main_error_text" align="left" colspan="6" bgcolor="#FFFFFF">{$lang.interests_spr.empty}</td>
			</tr>
			{/section}

			<tr class="table_header">
				<td colspan="6">
					&nbsp;&nbsp;
					{if $links}
					{foreach item=item from=$links.pages}
						&nbsp;<a onclick="PageList('blogs_table_div', '{$item.link}');" class="page_link" {if $item.selected} style=" font-weight: bold; text-decoration: none;" {/if}>{$item.name}</a>&nbsp;
					{/foreach}
					{/if}
					<div class="page_navigation">
					{if $links.previous}
						<a onclick="PageList('blogs_table_div', '{$links.previous}');">< {$lang.content.previous} {$per_page}</a>
					{/if}
					{if $links.next}
						<a onclick="PageList('blogs_table_div', '{$links.next}');">{$lang.content.next} {$per_page} ></a>
					{/if}
					</div>
				</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>
	</div>
	
{if !$ajax}	
	
<script language="JavaScript" type="text/javascript">
{literal}
var answ;

function PageList(id_div, par) {
	ajaxLoadingImage(1, id_div);
	$.post("admin_blog.php", par, function(data){
		ajaxLoadingImage(0, id_div);
		$('#'+id_div).html(data);
	});
}
	
function Dialog(par) {
	answ = par;
	//e.preventDefault();
	var id = '#dialog';
	var maskHeight = $(document).height();
	var maskWidth = $(window).width();
	$('#mask').css({'width':maskWidth,'height':maskHeight});
	$('#mask').fadeIn(500);	
	$('#mask').fadeTo("fast",0.8);	
	var winH = $(window).height();
	var winW = $(window).width();
	$(id).css('top',  winH/2-$(id).height()/2);
	$(id).css('left', winW/2-$(id).width()/2);
	$(id).fadeIn(500); 
}
$(document).ready(function() {	
	$('.window .close').click(function (e) {
		e.preventDefault();
		$('#mask, .window').hide();
	});		
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});			
});
function Delete() {
	document.location.href='{/literal}{$file_name}{literal}?sel=delete_post&id={/literal}{$id_blog}{literal}&id_post='+answ;
}
{/literal}
</script>
{include file="$admingentemplates/admin_bottom.tpl"}

{/if}