{include file="$admingentemplates/admin_top.tpl"}
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_club.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.admin.razdel_name}</div>
<div class="cr"></div><div class="cr"></div>
	<table width="100%" border="0" cellpadding="0" cellspacing="1">
	<tr>
		<td valign="top" class="text">
			<table cellpadding="0" cellspacing="0" border="0" width="100%">
			<tr>
				<td valign="top" style="padding-top: 10px; padding-bottom: 10px;">
				<form name="club_form" id="club_form" action="{$form.action}" method="post" enctype="multipart/form-data">
					<div class="panel_section"><div class="panel_content">
                	{$form.hidden}
					<table border="0" cellpadding="0" cellspacing="0" class="admin_edit_form">
					<tr>
						<td>{$lang.club.club_name}<font class=main_error_text>*</font>:</td>
						<td><input type="text" name="club_name" value="{$data.club_name}" style="width: 150px" maxlength="500"></td>
					</tr>
					<tr>
						<td>{$lang.club.club_icon}:</td>
						<td><input type="file" name="upload"></td>
					</tr>
					<tr>
						<td>{$lang.club.club_category}<font class=main_error_text>*</font>:</td>
						<td height="30">
							<select style="width: 160px" name="club_category">
								<option value="0">{$lang.home_page.select_default}</option>
								{section name=s loop=$club_categories}
								<option value="{$club_categories[s].id}" {if $club_categories[s].sel}selected{/if}>{$club_categories[s].name}</option>
								{/section}
							</select>
						</td>
					</tr>
					<tr>
						<td>{$lang.club.open_join}:</td>
						<td><input type="checkbox" name="open_join" value="1" {if $data.is_open eq '1'}checked=""{/if}></td>
					</tr>
					<tr>
						<td>{$lang.club.hidden_club}:</td>
						<td><input type="checkbox" name="hidden_club" value="1" {if $data.is_hidden eq '1'}checked=""{/if}></td>
					</tr>
					<tr>
						<td>{$lang.club.members_can_invite}:</td>
						<td><input type="checkbox" name="members_can_invite"  value="1" {if $data.can_invite eq '1'}checked=""{/if}></td>
					</tr>
					<tr>
						<td>{$lang.club.members_can_post_images}:</td>
						<td><input type="checkbox" name="members_can_post_images" value="1" {if $data.can_post_images eq '1'}checked=""{/if}></td>
					</tr>
					<tr>
						<td>{$lang.club.country}:</td>
						<td>
							<select style="width: 160px" name="country" onchange="SelectRegion(this.value, document.getElementById('region_div'), document.getElementById('city_div'));">
								<option value="0">{$lang.home_page.select_default}</option>
								{section name=s loop=$countries}
								<option value="{$countries[s].id}" {if $countries[s].sel}selected{/if}>{$countries[s].name}</option>
								{/section}
							</select>
						</td>
					</tr>
					<tr>
						<td>{$lang.club.region}:</td>
						<td>
							<div id="region_div">
							{if $regions}
							<select style="width: 160px" name="region" onchange="SelectCity(this.value, document.getElementById('city_div'));">
								<option value="0">{$lang.home_page.select_default}</option>
								{section name=s loop=$regions}
								<option value="{$regions[s].id}" {if $regions[s].sel}selected{/if}>{$regions[s].name}</option>
								{/section}
							</select>
							{/if}
							</div>
						</td>
					</tr>
					<tr>
						<td>{$lang.club.city}:</td>
						<td height="30">
							<div id="city_div">
							{if $cities}
							<select style="width: 160px" name="city">
								<option value="0">{$lang.home_page.select_default}</option>
								{section name=s loop=$cities}
								<option value="{$cities[s].id}" {if $cities[s].sel}selected{/if}>{$cities[s].name}</option>
								{/section}
							</select>
							{/if}
							</div>
						</td>
					</tr>
					<tr>
						<td valign="top" style="padding-top:5px;">{$lang.club.description}<font class=main_error_text>*</font>:</td>
						<td style="padding-top:5px;padding-bottom:5px;">
							{$redactor_description}
							<textarea id="description" name="description" class="redactor_normal">{*$data.description*}</textarea>
						</td>
					</tr>
					<tr>
						<td>{$lang.club.use_agreement}:</td>
						<td><input type="checkbox" name="use_agreement" id="use_agreement" value="1" {if $data.use_agreement eq 1} checked{/if} onclick="AgreementForm();"></td>
					</tr>
					<tr id="agreement_text_cont">
						<td valign="top" style="padding-top:5px;">{$lang.club.user_agreement}:</td>
						<td style="padding-top:5px;padding-bottom:5px;">
							{$redactor_agreement_text}
							<textarea name="agreement_text" id="agreement_text" class="redactor_normal">{*$data.agreement_text*}</textarea>
						</td>
					</tr>
					</table></div></div><table style="float:left;">
					<tr>
						<td colspan="2"><a class="admin_button_major" onclick="javascript: document.club_form.submit();">{if $id_club}{$lang.button.save}{else}{$lang.button.add}{/if}<span>&nbsp;</span></a></td>
					</tr>
					</table>
				</form>
				</td>
			</tr>
			</table>
		</td>
	</tr>
	</table>
{literal}
<script type="text/javascript">
	AgreementForm();
	
	function AgreementForm() {
		if (document.getElementById('use_agreement').checked) {
			$('#agreement_text_cont').show();
		} else {
			$('#agreement_text_cont').hide();
		}
		return;
	}
</script>
{/literal}
{include file="$admingentemplates/admin_bottom.tpl"}