<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 width="100%" cellspacing="0" cellpadding="0" border="0">
                <tbody>
                    <tr class="table_header">
                        <td width="5%" align="center">
                            <input type="checkbox" name="select_all" onclick="PutAll()" />
                        </td>
                        <td width="10%" align="left">
                            {$lang.users.nick}
                        </td>
                        <td width="10%" align="left">
                            {$lang.users.gender}
                        </td>
                        <td width="15%" align="left">
                            {$lang.users.group}
                        </td>
                        <td width="10%" align="left">
                            {$lang.users.balance}
                        </td>
                        <td width="7%" align="center">
                            {$lang.users.age}
                        </td>
                        <td width="15%" align="left">
                            {$lang.users.date_registration}
                        </td>
                        <td width="15%" align="left">
                            {$lang.users.date_last_login}
                        </td>
                        <td width="13%" align="right">
                            {$lang.users.actions}
                        </td>
                    </tr>
                    {section name=u loop=$user}
                    <tr userid="1" {if $smarty.section.u.index mod 2 eq 1}class="even"{else}class="odd"{/if}>
                        <td align="center"><input type="checkbox" name="delete" id="delete" value="{$user[u].id}" {if $user[u].root_user}disabled{/if}></td>
                        <td align="left" style="padding-left: 10px;">{if $user[u].root_user}{$user[u].nick}{else}<a href="{$user[u].edit_link}">{$user[u].nick}</a>{/if}</td>
                        <td align="left" style="padding-left: 10px;">{$user[u].type}{if $user[u].gender}, {$user[u].gender}{/if}</td>
                        <td align="left" style="padding-left: 10px;">{$user[u].groupname}</td>
                        <td>
                            <div style="float: left; margin-left: 15px;">
                                {$user[u].account_curr}&nbsp;
                            </div>
                            <div class="block_action" style="float:left;">                               
                                <img src="{$site_root}{$template_root}/images/add_money_n.png" alt="" height="13" style="cursor: pointer;" onclick="WindowShow({$user[u].id})" />                                
                            </div>
                        </td>
                        <td align="center">{$user[u].age}</td>
                        <td align="left" style="padding-left: 10px;">{$user[u].date_rigistration}</td>
                        <td align="left" style="padding-left: 10px;">{$user[u].last_login} {if $user[u].ip}({$user[u].ip}){/if}</td>
                        {*
                        {if !$invite_users}
                        <td class="main_content_text" align="center" bgcolor="#FFFFFF"><input type="checkbox" name="active[{$user[u].number}]" value="1" {if $user[u].status}checked{/if} {if $user[u].root_user}disabled{/if}><input type="hidden" name="hactive[{$user[u].number}]" value="{$user[u].id}"></td>
                        {/if}
                        <td class="main_content_text" align="left" bgcolor="#FFFFFF">
                        {section name=p loop=$pp}
                            {if !$user[u].root_user}
                                &nbsp;&nbsp;[<a href="#" onclick="javascript: window.open('./admin_users.php?sel=edituser&id={$user[u].id}&editpage={$pp[p]}&popup=1','description', 'height=750, resizable=yes, scrollbars=yes,width=900, menubar=no,status=no'); return false;">{assign var=pps value=$pp[p]}{$lang.users.page[$pps]}</a>]<br>{/if}
                        {/section}
                            &nbsp;&nbsp;[<a href="#" onclick="javascript: window.open('{$user[u].upload_link}','upload', 'height=750, resizable=yes, scrollbars=yes,width=750, menubar=no,status=no'); return false;">{$lang.users.upload_link}</a>]<br>
                        {if $user[u].invited_link}&nbsp;&nbsp;[<a href="{$user[u].invited_link}">{$user[u].invited_link_name}</a>]<br>{/if}
			</td>
                        {if !$invite_users}
                        <td class="main_content_text" align="center" bgcolor="#FFFFFF" width="100">
                            <table cellspacing=1 cellpadding=0>
                                <tr>
                                    <td width=80><input type="button" value="{$lang.users.comunicate}" class="button" onclick="javascript:window.open('{$user[u].comunicate}','comunicate', 'height=800, resizable=yes, scrollbars=yes,width=600, menubar=no,status=no');"></td>
                                </tr>
                            </table>
                        </td>
                        {else}
                        <td class="main_content_text" align="center" bgcolor="#FFFFFF" width="100">
                        {if $user[u].invite_link}
                        <input type="button" value="{$lang.club.admin.invite_butt}" onclick="javascript: location.href='{$user[u].invite_link}'" />
                        {/if}
                        </td>
                        {/if}*}
                        <td align="left">
                            <div class="block_action">  
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                             
                                <img src="{$site_root}{$template_root}/images/communicate.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.comunicate.editform}');return false" alt="" height="13" style="cursor: pointer;" onclick="javascript:window.open('{$user[u].comunicate}','comunicate', 'height=800, resizable=yes, scrollbars=yes,width=600, menubar=no,status=no');" />&nbsp;&nbsp;
                                {if $user[u].root_user ne 1}
								{if $user[u].status}
                                    <img src="{$site_root}{$template_root}/images/user_inactive.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.make_inactive}');return false" alt="" height="13" style="cursor: pointer;" onclick="ChangeStatus({$user[u].id}, 0)" />&nbsp;&nbsp;
                                {else}
                                    <img src="{$site_root}{$template_root}/images/user_active.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.make_active}');return false" alt="" height="13" style="cursor: pointer;" onclick="ChangeStatus({$user[u].id}, 1)" />&nbsp;&nbsp;
                                {/if}
                                {/if}
                                <img src="{$site_root}{$template_root}/images/photo_delete.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false" alt="" height="13" style="cursor: pointer;" onclick="document.location.href='admin_users.php?sel=del&id='+{$user[u].id}" />
                                
                            </div>
                        </td>
                        
                    </tr>
                    {/section}
                    <tr class="table_header">
                        <td colspan="11">
                            &nbsp;&nbsp;
                            {if $links}
                            {foreach item=item from=$links.pages}
                                &nbsp;<a onclick="PageList('users_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('users_table_div', '{$links.previous}');">< {$lang.content.previous} {$per_page}</a>
                            {/if}
                            {if $links.next}
                                <a onclick="PageList('users_table_div', '{$links.next}');">{$lang.content.next} {$per_page} ></a>
                            {/if}
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
<link href="{$site_root}{$template_root}/css/alert.css" rel="stylesheet" type="text/css">
<div id="boxes">
    <div id="close" class="close" onclick="Close()"></div>
	<div id="dialog" class="window">
	</div>
</div>
<div id="mask"></div> 
            
<script type="text/javascript">
{literal}
        function PageList(id_div, par) {
        ajaxLoadingImage(1, 'users_table_div');
        $.post("admin_users.php", par, function(data){
            ajaxLoadingImage(0, 'users_table_div');
            $('#users_table_div').html(data);
        });
    }
    
    function NumUsers(){
    num_users = $("select[name=pays_numpage]").val();    
    ajaxLoadingImage(1, 'users_table_div');
    $.ajax({
        type: "POST",
        dataType: "text",
        data: 'num_on_page='+num_users+'&ajax=1&par={/literal}{$par}{literal}',
        url: "admin_users.php",
        success: function(data){
            ajaxLoadingImage(0, 'users_table_div');
            $('#users_table_div').html(data);
        }
    })
}

function PutAll() {
         var o=document.getElementsByName('select_all')	
         var i
         if (o[0].checked){                    
            o=document.getElementsByName('delete')
            for (i=0; i<o.length; i++){                
                if (!o[i].disabled)
                    o[i].checked = true
            }            
         }
         else{
            o=document.getElementsByName('delete')
            for (i=0; i<o.length; i++){                
                o[i].checked = false
            }            
         }             
}
function AddFunds(){
    var mas=[]
    var i=0
    $('input[name=delete]:checked').each(function(){
        mas[i] = $(this).val()   
        i++    
    })
    WindowShow(mas)
}
    
function WindowShow(par) {
	//var id = '#dialog';
	
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#mask').fadeIn(500);	
		$('#mask').fadeTo("fast",0.8);	
	
		//Get the window height and width
		var winH = $(document).height();
		var winW = $(window).width();
              
		//Set the popup window to center
		$('#dialog').css('top',  winH/2-$('#dialog').height()/2);
		$('#dialog').css('left', winW/2-$('#dialog').width()/2);
        
        $('#close').css('top',  winH/2-$('#dialog').height()/2+9);
		$('#close').css('left', winW/2+$('#dialog').width()/2-25);
        $('#close').fadeIn(500);
                
        var par = 'sel=add_billing&id='+par+'&user=1&par={/literal}{$par}{literal}&page={/literal}{$page}{literal}'
	
	$.ajax({
  		type: "POST",
  		url: "admin_pays.php",        
		data: (par),
		success: function(data){
			$('#dialog').html(data);
            $('#dialog').fadeIn(500); 
		}
	});
	//transition effect
}
function Close(){
    $('#mask').fadeOut(500);
    $('#close').fadeOut(500)
    $('#dialog').fadeOut(500)	
}
  
  
function MoveGroup(id){
    $("#active_themes").toggle();
    var str=[]
    var i = 0
    $('input[name=delete]:checked').each(function(){
        str[i] = $(this).val()
        i++        	  
     });
     num_users = $("select[name=pays_numpage]").val();    
     $.ajax({
        type: "POST",
        dataType: "text",
        data: 'num_on_page='+num_users+'&ajax=1&sel=move_group&id_group='+id+'&id_users='+str+'&par={/literal}{$par}{literal}',
        url: "admin_users.php",
        success: function(data){            
            $('#users_table_div').html(data);
        }
     })
} 
{/literal}
</script>

{*
{include file="$admingentemplates/admin_top.tpl"}
<font class=red_header>{$lang.users.razdel_name}</font><font class=red_sub_header>&nbsp;|&nbsp;{$lang.users.topten}</font>
<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.users_top}
    </div>
</div>
<table width="100%">
	<tr valign="top">
	<!-- main spr row -->
	<td width="100%" colspan=2>
		<table border=0 class="table_main" cellspacing=1 cellpadding=5 width="100%">
			{if $links}
			<tr bgcolor="#ffffff">
				<td height="35" colspan=5 align="left"  class="main_content_text" >{$links}</td>
			</tr>
			{/if}
			<tr>
				<td align="center" class="table_header" width="15"><font class="main_header_text"><b>{$lang.users.topten_place}</b></font></td>
				<td align="center" class="table_header"><font class="main_header_text"><b>{$lang.users.topten_login}</b></font></td>
				<td align="center" class="table_header"><font class="main_header_text"><b>{$lang.users.topten_name}</b></font></td>
				<td align="center" class="table_header" width="20"><font class="main_header_text"><b>{$lang.users.topten_rating}</b></font></td>
				<td align="center" class="table_header" width="70"><font class="main_header_text"><b>{$lang.users.topten_rated}</b></font></td>
			</tr>
			{section name=s loop=$users}
			<tr>
				<td class="main_content_text" align="center" bgcolor="#FFFFFF">{$users[s].place}</td>
				<td class="main_content_text" align="center" bgcolor="#FFFFFF"><a href="admin_users.php?sel=edituser&editpage=1&page=1&id={$users[s].id}">{$users[s].login}</a></td>
				<td class="main_content_text" align="center" bgcolor="#FFFFFF">{$users[s].name}</td>
				<td class="main_content_text" align="center" bgcolor="#FFFFFF">{$users[s].rating}</td>
				<td class="main_content_text" align="center" bgcolor="#FFFFFF">{$users[s].rated}</td>
			</tr>
			{/section}
			{if $links}
			<tr bgcolor="#ffffff">
				<td height="35" colspan=5 align="left"  class="main_content_text" >{$links}</td>
			</tr>
			{/if}
		</table>
	</td>
	<!-- /main spr row -->
	</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 - 80;
			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>

{include file="$admingentemplates/admin_bottom.tpl"}
*}