{if $ajax eq 0}
{include file="$admingentemplates/admin_top.tpl"}
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_modules.php">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.events.razdel_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>{$lang.admin_help.events}
    </div>
</div>
<div class="cr">&nbsp;</div>
<ul class="tabs">
    <li>
        <a class="current">{$lang.events.listform}</a>
    </li>
    <li>
        <a href="{$types_link}">{$lang.events.event_types}</a>
    </li>
{*    <li>
        <a href="admin_events.php?sel=add">{$lang.events.add}</a>
    </li>*}
</ul>
{*if $form.err}
{else*}
		<div class="user_operation_line">
			<div onclick="javascript: location.href='{$add_link}'" class="uol_item">
				<div class="uol_in_item">{$lang.events.add}</div>
			</div>
{*			<div onclick="javascript: location.href='{$types_link}'" class="uol_item">
				<div class="uol_in_item">{$lang.events.event_types}</div>
			</div>*}
		</div>
		<div class="cr"></div>

<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}
<div id="event_table_div">
<table border=0 cellspacing=0 cellpadding=0 width="100%">
{*	{if $links}
	<tr bgcolor="#ffffff">
		<td height="20" align="left"  class="main_content_text" colspan="9" style="color: #656565;">{$links}</td>
	</tr>
	{/if}*}
	{if $event}
		<tr class="table_header">
			<td class="main_header_text" align="center" width="5%">{$lang.events.number}</td>
			<td class="main_header_text" align="left" width="7%">{$lang.events.event_creator}</td>
			<td class="main_header_text" align="left" width="10%">{$lang.events.type}</td>
			<td class="main_header_text" align="left" width="20%">{$lang.events.event_name}</td>
			<td class="main_header_text" align="left" width="10%">{$lang.events.event_date_begin}</td>
			<td class="main_header_text" align="left" width="10%">{$lang.events.event_date_end}</td>
			<td class="main_header_text" align="left" width="5%">{$lang.events.event_periodicity}</td>
			<td class="main_header_text" align="center" width="11%">{$lang.events.event_users}</td>
			<td class="main_header_text" align="right" width="10%">{$lang.button.action}</td>
        </tr>
		{section name=e loop=$event}
		<tr {if $smarty.section.e.index mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
			<td class="main_content_text" align="center" >{$event[e].number+$smarty.section.e.index}</td>
			<td class="main_content_text" align="left" >{if $event[e].admin_creator}{$event[e].event_creator}{else}<a href="{$event[e].creator_profile_link}">{$event[e].event_creator}</a>{/if}</td>
			<td class="main_content_text" align="left" >{$event[e].type}</td>
			<td class="main_content_text" align="left" ><a href="{$event[e].edit_link}">{$event[e].name}</a></td>
			<td class="main_content_text" align="left" >{$event[e].date_begin}</td>
			<td class="main_content_text" align="left" >{$event[e].date_end}</td>
			<td class="main_content_text" align="left" >{$event[e].periodicity} {if $event[e].date_die}{$lang.events.until} {$event[e].date_die}{/if}</td>
			<td class="main_content_text" align="center" ><a href="{$event[e].users_link}">{$event[e].num_users}</a></td>{*{$lang.groups.user_list}*}
			{if $event[e].admin_creator}
				<td align="right" >
                	<div class="block_action fr" style="display: none;">
						<div class="action_del" style="display: block;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="{literal}javascript: if(confirm('Delete this event?')){location.href={/literal}'{$event[e].delete_link}'{literal}}{/literal}">
						</div>
					</div>
					</div><div style="width:10px;float:right;" class="fl">&nbsp;</div>
					<div class="block_action fr" style="display: none;">
						<div class="action_del" style="display: block;cursor:pointer;">
							<img height="16" alt="" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.edit}');return false" src="{$site_root}{$template_root}/images/edit.png" onclick="javascript:document.location.href='{$event[e].edit_link}'">
					</div>
					</div><div style="width:10px;float:right;" class="fl">&nbsp;</div>
							
				</td>
			{else}
				<td align="right" >	
					<div class="block_action fr" style="display: none;">
						<div class="action_del" style="display: block;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="{literal}javascript: if(confirm('Delete this event?')){location.href={/literal}'{$event[e].delete_link}'{literal}}{/literal}">
						</div>
					</div>
					</div><div style="width:10px;float:right;" class="fl">&nbsp;</div>
					<div class="block_action fr" style="display: none;">
						<div class="action_del" style="display: block;cursor:pointer;">
							<img height="16" alt="" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.edit}');return false" src="{$site_root}{$template_root}/images/edit.png" onclick="javascript:document.location.href='{$event[e].edit_link}'">
					</div>
					</div><div style="width:10px;float:right;" class="fl">&nbsp;</div>
					<div class="block_action fr" style="display: none;">
						<div class="action_del" style="display: block;cursor:pointer;">
							<img height="16" alt="" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.comunicate.editform}');return false" src="{$site_root}{$template_root}/images/communicate.png" onclick="javascript:window.open('{$event[e].comunicate_link}','comunicate', 'height=800, resizable=yes, scrollbars=yes,width=600, menubar=no,status=no');">
					</div>
				</td>
			{/if}
		</tr>
		{/section}
	{else}
		<tr height="40">
			<td class="main_error_text" align="left" colspan="9" bgcolor="#FFFFFF">{$lang.events.empty}</td>
		</tr>
	{/if}
                    <tr class="table_header">
                        <td colspan="9">
                            &nbsp;&nbsp;
                            {if $links}
                            {foreach item=item from=$links.pages}
                                &nbsp;<a onclick="PageList('event_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('event_table_div', '{$links.previous}');">< {$lang.content.previous} {$per_page}</a>
                            {/if}
                            {if $links.next}
                                <a onclick="PageList('event_table_div', '{$links.next}');">{$lang.content.next} {$per_page} ></a>
                            {/if}
                            </div>
                        </td>
                    </tr>

{*	{if $links}
	<tr bgcolor="#ffffff">
		<td height="20" align="left"  class="main_content_text" colspan="9">{$links}</td>
	</tr>
	{/if}
	<tr class="table_header"><td colspan="9"></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';
		}
		function PageList(id_div, par) {
        //ajaxLoadingImage(1, 'pays');
        $.post("admin_events.php", par, function(data){
            //ajaxLoadingImage(0, 'pays');
            $('#event_table_div').html(data);
        });
    }
{/literal}		
</script>
</div>
{*/if*}
{if $ajax eq 0}
{include file="$admingentemplates/admin_bottom.tpl"}
{/if}