{include file="$gentemplates/$header_tpl"}
<div class="club">
    <div>
        <h2>{$lang.section.club}</h2>
    </div>
    {*if $form.err}
	  <p> *&nbsp;{$form.err}</p>
    {/if*}
    <div class="club_content">
        <form name="club_form" id="club_form" action="{$site_root}/{$seo.club}?sel=add" method="post" enctype="multipart/form-data">
           <div class="form_edit_input">
				<div class="form_edit_input_text">{$lang.club.club_name}*:</div>
				<div>
					<input type="text" name="club_name" id="club_name" onkeyup="BadWords('club_name');" value="{$data.club_name}" style="width: 220px;" maxlength="500"/>
                    <div id="bad_div_club_name" class="bad_div_left"></div>
				</div>
            </div>
			<div class="form_edit_input">
                <div class="form_edit_input_text">{$lang.club.club_icon}:</div>
                <div>
					<input type="file" style="width: 300px;" name="upload"/>
				</div>
			</div>
			<div class="form_edit_input">
				<div class="form_edit_input_text">{$lang.club.club_category}*:</div>
                <div>
                    <select class="width_150" 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>
                 </div>					
			</div>
            <div class="form_edit_input">
                <div class="float_left">
					<input type="checkbox" name="open_join" value="1" checked>&nbsp;{$lang.club.open_join}
				</div>
            </div>
            <div class="form_edit_input">
                <div class="float_left">
					<input type="checkbox" name="hidden_club" value="1">&nbsp;{$lang.club.hidden_club}
				</div>
            </div>
            <div class="form_edit_input">
                <div class="float_left">
					<input type="checkbox" name="members_can_invite" value="1" checked>&nbsp;{$lang.club.members_can_invite}
				</div>
            </div>
            <div class="form_edit_input">
                <div class="float_left">
					<input type="checkbox" name="members_can_post_images" value="1" checked>&nbsp;{$lang.club.members_can_post_images}
				</div>
            </div>
            <div class="form_edit_input">
                <div class="form_edit_input_text">{$lang.club.country}:&nbsp;</div>
                <div>
                    <select class="width_150" name="country" onchange="SelectRegion('qs', 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="selected"{/if}>{$countries[s].name}</option>
                        {/section}
                    </select>
                </div>
            </div>
            <div class="form_edit_input">
                <div class="form_edit_input_text">{$lang.club.region}:&nbsp;</div>
                <div id="region_div">
                    {if $regions}
                    <select class="width_150" name="region" onchange="SelectCity('qs', 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="selected"{/if}>{$regions[s].name}</option>
                         {/section}
			         </select>
                    {/if}&nbsp;
                </div>
            </div>
            <div class="form_edit_input">
                <div class="form_edit_input_text">{$lang.club.city}:&nbsp;</div>
                <div id="city_div">
					{if $cities}
					<select class="width_150" 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="selected"{/if}>{$cities[s].name}</option>
					   {/section}
					</select>
					{/if}&nbsp;
                </div>
            </div>
            <div class="form_edit_input">
                <div class="form_edit_input_text">
                    {$lang.club.description}{*<br />
                    {$lang.club.no_html}&nbsp;*}
                </div>
				{$redactor_description}
                <textarea name="description" id="description" class="redactor_normal"></textarea>
                <div id="bad_div_description" class="bad_div_left"></div>
            </div>
            <div class="form_edit_input" style="overflow:hidden;">
                <div class="float_left">
					<input type="checkbox" name="use_agreement" id="use_agreement" value="1" {if $data.use_agreement eq 1} checked{/if} onclick="AgreementForm();">&nbsp;{$lang.club.use_agreement}
				</div>
            </div>
            <div id="agreement_text_cont" class="form_edit_input">
                <div class="form_edit_input_text">
                    {$lang.club.user_agreement}:{*<br />
                    {$lang.club.no_html}&nbsp;*}
                </div>
				{$redactor_agreement_text}
				<textarea id="agreement_text" name="agreement_text" class="redactor_normal"></textarea>
                <div id="bad_div_agreement_text" class="bad_div_left"></div>
            </div>
            <div class="form_edit_input" style="overflow:hidden;">
                <div class="form_edit_input_text">
                    {$lang.club.verification}:</div>
                <div>
					<img src="{$form.kcaptcha}" alt="{$lang.club.verification}">
					<br>
					<input style="margin:8px 0;" type="text" style="width:150px;" name="keystring"/>
				</div>
            </div>
            <div class="form_edit_input" style="overflow:hidden;">
                <input type="submit" value="{$lang.button.save}" class="button">
            </div>	
				</form>
        
    </div>
</div>
{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="$gentemplates/$footer_tpl"}