{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.club.admin.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.club_list}
    </div>
</div>
<div class="cr">&nbsp;</div>
<ul class="tabs">
    <li>
        <a href="admin_club.php?sel=categories">{$lang.admin_menu.groups_categories_list}</a>
    </li>
{*    <li>
        <a href="admin_club.php?sel=add_category">{$lang.admin_menu.groups_categories_add}</a>
    </li>*}
    <li>
        <a class="current">{$lang.admin_menu.my_groups}</a>
    </li>
{*    <li>
        <a href="admin_club.php?sel=create">{$lang.admin_menu.add_group}</a>
    </li>*}
</ul>
		<div class="user_operation_line">
			<div onclick="javascript: location.href='{$form.add_club_link}'" class="uol_item">
				<div class="uol_in_item">{$lang.club.club_menu_3}</div>
			</div>
			{if $clubs}<div {literal}onclick="javascript: if (window.confirm('{/literal}{$lang.users.del_confirm|escape:javascript}{literal}'))  { document.clubs.sel.value='delete_clubs'; document.clubs.submit(); } else return false;"{/literal} class="uol_item">
				<div class="uol_in_item">{$lang.button.delete}</div>
			</div>
			{/if}
		</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="clubs_table_div">

<table border=0 cellspacing=0 cellpadding=0 width="100%">
	<tr class="table_header">	
		<td class="main_header_text" align="left" width="100"><input type="checkbox" id="select_all" name="select_all" onclick="PutAll()"></td>
		<td class="main_header_text" align="left" width="100">{$lang.club.admin.club_leader}</td>
		<td class="main_header_text" align="left">{$lang.club.admin.club_name}</td>
		<td class="main_header_text" align="center" width="100">{$lang.club.admin.club_status}</td>
		<td class="main_header_text" align="center" width="100">{$lang.club.admin.club_members_count}</td>
		<td class="main_header_text" align="right" width="100">{$lang.button.action}</td>
	</tr>
	{if $clubs}
    <form action="{$form.action}" name="clubs" method="post">
    {$form.hidden}
	{section name=c loop=$clubs}
	<tr {if $smarty.section.c.index mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
        <td class="main_content_text" align="left"><input type="checkbox" name="del_club[]" value="{$clubs[c].id}" /></td>
		<td class="main_content_text" align="left"><a href="{$clubs[c].leader_link}">{$clubs[c].leader_name}</a></td>
		<td class="main_content_text" align="left"><a href="{$clubs[c].club_link}">{$clubs[c].name}</a></td>
		<td class="main_content_text" align="center">{if $clubs[c].is_open eq 1}{$lang.club.admin.public}{else}{$lang.club.admin.private}{/if}</td>
		<td class="main_content_text" align="center">{$clubs[c].members_count}</td>
		<td class="main_content_text" align="center" width="100">
			<div style="width:10px;float:right;" class="fl">&nbsp;</div>
			<div class="block_action fr" style="display: none;">
				<div class="action_edit" style="display: block;">
					<img height="16" alt="" src="{$site_root}{$template_root}/images/communicate.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.comunicate.editform}');return false" onclick="javascript:window.open('{$clubs[c].leader_comunicate}','comunicate', 'height=800, resizable=yes, scrollbars=yes,width=600, menubar=no,status=no');">
				</div>
			</div>
			{if $clubs[c].edit_link}
			<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;">
					<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="javascript: location.href='{$clubs[c].edit_link}'">
				</div>
			</div>
			{/if}
		</td>
	</tr>
	{/section}
    </form>
	{else}
	<tr height="40">
		<td class="main_error_text" align="left" colspan="7" bgcolor="#FFFFFF">{$lang.club.admin.empty_clubs}</td>
	</tr>
	{/if}
                    <tr class="table_header">
                        <td colspan="7">
                            &nbsp;&nbsp;
                            {if $links}
                            {foreach item=item from=$links.pages}
                                &nbsp;<a onclick="PageList('clubs_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('clubs_table_div', '{$links.previous}');">< {$lang.content.previous} {$per_page}</a>
                            {/if}
                            {if $links.next}
                                <a onclick="PageList('clubs_table_div', '{$links.next}');">{$lang.content.next} {$per_page} ></a>
                            {/if}
                            </div>
                        </td>
                    </tr>	

</table>
</div>
<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>

{literal}
<script type="text/javascript">
function PutAll() {
         var o=document.getElementsByName('select_all')	
         var i
         if (o[0].checked){                    
            o=document.getElementsByName('del_club[]')
            for (i=0; i<o.length; i++){                
                if (!o[i].disabled)
                    o[i].checked = true
            }            
         }
         else{
            o=document.getElementsByName('del_club[]')
            for (i=0; i<o.length; i++){                
                o[i].checked = false
            }            
         }             
}
function PageList(id_div, par) {
        //ajaxLoadingImage(1, 'pays');
        $.post("admin_club.php", par, function(data){
            //ajaxLoadingImage(0, 'pays');
            $('#clubs_table_div').html(data);
        });
    }
</script>
{/literal}
{if $ajax eq 0}
{include file="$admingentemplates/admin_bottom.tpl"}
{/if}