{include file="$admingentemplates/admin_top.tpl"}
<div class="back">
    <a href="{$form.back}">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.groups.editform}</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>{if $form.par eq "edit" && $price eq "1"}{$lang.admin_help.groups_costs_1}{elseif $form.par eq "edit"}{$lang.admin_help.groups_edit}{elseif $form.par eq "add"}{$lang.admin_help.groups_add}{/if}
    </div>
</div>
{*<a href="{$form.back}" style="margin-bottom: 10px; padding-bottom: 0px; float: left; width: 100%;">{$lang.button.back}</a>*}

<ul class="tabs">
    <li>
        <a href="admin_users.php">{$lang.users.razdel_name}</a>
    </li>
    <li>
        <a class="current" href="#">{$lang.groups.razdel_name}</a>
    </li>
    <li>
        <a href="admin_users.php?sel=import">{$lang.admin_user.import.sub_header}</a>
    </li>
</ul>
    <div class="user_operation_line" style="height:4px;font-size:0px;">
          
    </div>
<div class="cr">&nbsp;</div>   
<div id="tab_all_users" class="user_status_elem_active" width="80px" onclick="price_not();">
    {$lang.pays.option_general}
</div>
<div id="tab_inactive_users" class="user_status_elem" width="80px" style="{if $form.par == add} display: none; {/if}">
    <a href="{$data.permlink}" >{$lang.groups.access_permissions} </a>
</div>
{if $data.is_gender!=1}
<div id="tab_pricing" class="user_status_elem" width="80px" onclick="price();" style="{if $form.par == add} display: none; {/if}">
    <a>{$lang.users.pricing}</a>
</div>
{/if}
<div style="float: left; width: 100%;" class="panel_subtabs">
	<div class="panel_content">
        <table border=0 cellspacing=1 cellpadding=5 width="100%">
            <form action="{$form.action}" method="post" name="groups" enctype="multipart/form-data">
                {$form.hiddens}
                    <tr id="name_gr">
                        <td align="left" width="1%" class="main_header_text" nowrap>{$lang.groups.name}:&nbsp;</td>
                        <td class="main_content_text" align="left" width="200"><input type="text" name="name" value="{$data.name}" size="30" {if $data.type=='r' ||  $data.type=='g'}disabled{/if}></td>
						{if $data.type!='t' && $data.is_gender!=1 && $data.type!='g' && $data.type!='d' && $form.use_gender_membership==1}
						<td align="left" width="1%" class="main_header_text" nowrap>{$lang.groups.def_for_user_type}:&nbsp;</td>
                        <td class="main_content_text" align="left" width="200">
							<select name="user_types">
								{foreach item=item from=$user_types}
									<option value="{$item.id}" {if $item.id==$data.gender}selected="selected"{/if}>{$item.name}</option>
								{/foreach}
							</select>
						</td>
						{/if}
                        <td class="main_header_text" align="left" width="99%">&nbsp;<input type="checkbox"name="add_default" value="1" {if $data.type=='r' ||  $data.type=='g' || $data.add_default_disable}disabled{/if}{if $data.add_default} checked{/if}>&nbsp;{$lang.groups.add_default}</td>
                    </tr>
                    <tr id="price_gr" style="display:none;">
                       <td colspan="3"> 
                           <div style="margin-top: 10px; {if $form.par eq add} display: none;{/if}">
                               <table>
                                    <tr>
                                        <td width="300px">
                                            <div id="table_price">
                                                {include file="$admingentemplates/admin_group_price_table.tpl"}
                                            </div>                                            
                                        </td>
                                        <td valign="bottom">
                                            <img src="{$site_root}{$template_root}/images/add_listing.gif" alt="" style="margin-left: 10px; cursor: pointer;" onclick="AddStr();" />
                                        </td>
                                    </tr>
                               </table>
                           </div>
                       </td>
                    </tr>
                    </form>
            </table>
	</div>
</div>
<div style="float: left;width:100%;" id="buttons">			
	{if $form.par eq "edit"}
		{if $data.type ne 'r'}
			<a class="admin_button_major" onclick="javascript:document.groups.submit();">{$lang.button.save}<span>&nbsp;</span></a>        
		{/if}
		{if $data.type ne 'r' && $data.type ne 'd' &&  $data.type ne 'g' &&  $data.type ne 't' && $form.use_gender_membership ne 1}
			<a class="admin_button" style="float:right;" onclick="{literal}javascript: if(confirm({/literal}'{$form.confirm|escape:javascript}'{literal})){location.href={/literal}'{$form.delete}'{literal}}{/literal}">{$lang.button.delete}<span>&nbsp;</span></a>        
		{/if}
	{else}
		{if $data.type ne 'r' &&  $data.type ne 'g' &&  $data.type ne 't'}
			<a class="admin_button_major" onclick="javascript:document.groups.submit();">{$lang.button.add}<span>&nbsp;</span></a>
		{/if}
	{/if}
</div>
<script type="text/javascript">
{literal}
window.onload = function(){
	var pr = '{/literal}{$price}{literal}';
	if (pr=='1'){price();}
}
function price(){
	$('#tab_all_users').html("<a>"+$('#tab_all_users').text()+"<\/a>");
	$('#tab_pricing').text($('#tab_pricing').text());
	$('#tab_all_users').removeClass('user_status_elem_active');
	$('#tab_all_users').addClass('user_status_elem');
	$('#tab_pricing').removeClass('user_status_elem');
	$('#tab_pricing').addClass('user_status_elem_active');
	$('#price_gr').css('display', 'block');
	$('#name_gr').css('display', 'none');
	$('#buttons').css('display', 'none');
}
function price_not(){
	$('#tab_pricing').html("<a>"+$('#tab_pricing').text()+"<\/a>");
	$('#tab_all_users').text($('#tab_all_users').text());
	$('#tab_all_users').removeClass('user_status_elem');
	$('#tab_all_users').addClass('user_status_elem_active');
	$('#tab_pricing').removeClass('user_status_elem_active');
	$('#tab_pricing').addClass('user_status_elem');
	$('#price_gr').css('display', 'none');
	$('#name_gr').css('display', 'block');
	$('#buttons').css('display', 'block');
}
{/literal}
</script>
{include file="$admingentemplates/admin_bottom.tpl"}