<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 $forum.empty eq 1}
<span style="padding-left: 13px;">{$lang.forum.no_topics_found}</span>
{else}
<table cellpadding="0" cellspacing="0" width="100%" border="0">
	<tr class="table_header">
		<td height="27" valign="middle" align="left" style="padding-left: 13px; padding-right: 13px;" class="index_quick_search"><b>{$lang.forum.topics}</b></td>
{*		<td width="50" valign="middle" align="left" style="padding-left: 13px; padding-right: 13px;" class="index_quick_search"><b>{$lang.forum.edit}</b></td>
		<td width="50" valign="middle" align="left" style="padding-left: 13px; padding-right: 13px;" class="index_quick_search"><b>{$lang.forum.delete}</b></td>*}
		<td width="1%" valign="middle" align="left" style="padding-left: 13px; padding-right: 13px;" class="index_quick_search"><b>{$lang.forum.author}</b></td>
		<td width="1%" valign="middle" align="left" style="padding-left: 13px; padding-right: 13px;" class="index_quick_search"><b>{$lang.forum.last_post_date}</b></td>
		<td width="1%" valign="middle" align="centr" style="padding-left: 13px; padding-right: 13px;" class="index_quick_search"><b>{$lang.forum.posts}</b></td>
		<td width="70" valign="middle" align="right" style="padding-left: 13px; padding-right: 13px;" class="index_quick_search"><b>{$lang.button.action}</b></td>
	</tr>
	{section name=f loop=$forum}
	<tr {if $smarty.section.f.index mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
		<td height="27" align="left" style="padding-left: 13px;">
{*			<a href="{$file_name}?sel=subcategory&amp;id_subcategory={$forum[f].id}">{$forum[f].subcategory}</a>*}
			<div id="inform_div{$forum[f].id}" class="error_msg" style="display:none;float:right;"></div>
			<a href="{$file_name}?sel=subcategory&amp;id_subcategory={$forum[f].id}&type={$type}" id="link{$forum[f].id}">{$forum[f].subcategory}</a>
			<input id="text_input{$forum[f].id}" type="text" value="{$forum[f].subcategory}" style="display:none;"/>
		</td>
		<td align="left" nowrap style="padding-left: 13px; padding-right: 13px;">{if $forum[f].poster_profile eq 1}<a href='admin_users.php?sel=edituser&editpage=1&page=1&id={$forum[f].poster_id}' target="_blank">{/if}{$forum[f].poster_login}{if $forum[f].poster_profile eq 1}</a>{/if}</td>
		<td align="left" nowrap style="padding-left: 13px; padding-right: 13px;">{$forum[f].date}</td>
		<td align="center" nowrap>{$forum[f].total_posts}</td>
		<td align="right" style="padding-left: 13px; padding-right: 13px; padding-top: 5px;">
{*			<input type="button" onclick="document.location.href='{$file_name}?sel=edit_subcategory&id_subcategory={$forum[f].id}';" value="{$lang.button.edit}">*}
{*			<div class="block_action fr" style="display: none;">
				<div class="action_del" style="display: block;">
					<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="{literal}if (confirm('{/literal}{$lang.forum.del_confirm|escape:javascript}{literal}')) {document.location.href='admin_forum.php?sel=del_subcategory&id_subcategory={/literal}{$forum[f].id}{literal}';}{/literal}">
				</div>
			</div>
			<div style="width:10px;float:right;" class="fl">&nbsp;</div>*}
{*		</td>
		<td align="center" style="padding-left: 13px; padding-right: 13px; padding-top: 5px;">*}
{*			<input type="button" onclick="{literal}if (confirm('{/literal}{$lang.forum.del_confirm|escape:javascript}{literal}')) {document.location.href='admin_forum.php?sel=del_subcategory&id_subcategory={/literal}{$forum[f].id}{literal}';}{/literal}" value="{$lang.button.delete}">*}
{*			<div class="block_action fr" style="display: none;">
				<div class="action_del" style="display: block;">
					<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.href='{$file_name}?sel=edit_subcategory&id_subcategory={$forum[f].id}';">
				</div>
			</div>
		</td>*}
					<div class="block_action" >  
						<img id="edit_button{$forum[f].id}" src="{$site_root}{$template_root}/images/edit.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.edit}');return false" alt="" height="13" style="cursor: pointer;" onclick="javascript: editAction_sub({$forum[f].id});" />&nbsp;
						<img id="save_button{$forum[f].id}" src="{$site_root}{$template_root}/images/success.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.save}');return false" alt="" height="13" style="cursor: pointer; display:none;" onclick="javascript: saveAction_sub({$forum[f].id}, {$forum[f].poster_id});" />&nbsp;
						<img src="{$site_root}{$template_root}/images/photo_delete.png" alt="" height="13" style="cursor: pointer;" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false" onclick="{literal}if (confirm('{/literal}{$lang.forum.del_confirm|escape:javascript}{literal}')) {document.location.href='admin_forum.php?sel=del_subcategory&id_subcategory={/literal}{$forum[f].id}{literal}';}{/literal}">&nbsp;&nbsp;
					</div>
	</tr>
	{sectionelse}
	<tr height="40">
		<td class="main_error_text" align="left" colspan="5">{$lang.interests_spr.empty}</td>
	</tr>
	{/section}
	<tr class="table_header"><td colspan="5">&nbsp;</td></tr>
</table>
{/if}
<script type="text/javascript">
{literal}
function editAction_sub(id){
	link_obj = getById('link'+id);
	text_input_obj = getById('text_input'+id);
	edit_button_ogj = getById('edit_button'+id);
	save_button_ogj = getById('save_button'+id);

	link_obj.style.display = 'none';
	text_input_obj.style.display = '';
	edit_button_ogj.style.display = 'none';
	save_button_ogj.style.display = '';

	text_input_obj.focus();
}

function saveAction_sub(id, id_user){
	inform_div_obj = getById('inform_div'+id);
	link_obj = getById('link'+id);
	text_input_obj = getById('text_input'+id);
	edit_button_ogj = getById('edit_button'+id);
	save_button_ogj = getById('save_button'+id);
	value = text_input_obj.value;

	file_name = '{/literal}{$form.action}{literal}';
	str = 'sel=save_edited_subcategory&par=edit&subcategory_id='+id+'&subcategory_name='+value+'&id_user='+id_user;
	destination_odj = inform_div_obj;
	tmp_text = 'Saving...';
	anisochronous = false;
	ShowAjaxError(tmp_text, '', 'info');
	
	ajaxRequest(file_name, str, destination_odj, tmp_text, anisochronous);

	CloseAjaxError(1);
	
	saved_obj = getById('saved'+id);
	saved = saved_obj.value;
	if (saved == '1'){
		ShowAjaxError($('#inform_div1').text(), '', 'success');
		link_obj.style.display = '';
		link_obj.innerHTML = value;
		text_input_obj.style.display = 'none';
		edit_button_ogj.style.display = '';
		save_button_ogj.style.display = 'none';
		edit_button_ogj.focus();
	}
}
		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>