{include file="$admingentemplates/admin_top.tpl"}
<div class="red_header">{$lang.banners.banners_arrea}</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.banners.help_admin_aprove_table}
    </div>
</div>
{if $form.error}
<div class="main_error_text">* {$form.error}</div>
{/if}
<form name="edit_resols" enctype="multipart/form-data" method="post" action="{$file_name}" style="padding-bottom:50px;">
<div  class="panel_section">
<div  class="panel_content">
	{$form.hiddens}
	<table cellpadding="0" cellspacing="0">
	<tr> {foreach name=a from=$areas item=item}
		<td width="50%"><input type="checkbox" id="ar{$smarty.foreach.a.iteration}" name="area[]" value="{$item.id}" {if $item.checked eq 1} checked="checked" {/if} onclick="javascript: CheckMyForm();"> {$item.description}</td>
		{if $smarty.foreach.a.last && $smarty.foreach.a.iteration is not div by 2}
		<td width="50%"></td>
		{/if}
		{if $smarty.foreach.a.iteration is div by 2 && !$smarty.foreach.a.last}</tr><tr>{/if}
		{/foreach}
		<input type="hidden" id="count" value="{$smarty.foreach.a.iteration}" />
	</tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td colspan="2" style="padding-bottom:10px;"><a href="#" onclick="javascript: checkuncheckAll(1);">{$lang.button.checkall}</a>/<a href="#" onclick="javascript: checkuncheckAll(0);">{$lang.button.uncheckall}</a></td></tr>
	</table></div></div>
	<table cellpadding="0" cellspacing="0" width="100%" style="float:left;">
	<tr>
		<td>
{*			<input id="submit_butt" type="submit" value="{$lang.banners.aprove_link}" class="button" disabled="disabled"><input type="button" value="{$lang.button.close}" class="button" onclick="javascript: window.close();">*}
			<a class="admin_button_major" id="submit_butt" onclick="javascript: document.edit_resols.submit();">{$lang.banners.aprove_link}<span>&nbsp;</span></a><a class="admin_button_cancel" onclick="javascript: window.close();" style="margin-left:10px;">{$lang.button.vip_cancel}<span>&nbsp;</span></a>
		</td>
	</tr>
	</table>
</form>
<script>
{literal}
count = document.getElementById('count').value;
function CheckForm(){
	count = document.getElementById('count').value;
	for(i=1;i<=count;i++){
		if (document.getElementById('ar'+i).checked) return true;
	}
	return false;
}

function CheckMyForm(){
	butt = document.getElementById('submit_butt');
	if (CheckForm()) butt.disabled = false;
	else butt.disabled = true;
} 
 
function checkuncheckAll(ch){
	for(i=1;i<=count;i++){
		if (document.getElementById('ar'+i).disabled==false){
			switch (ch){
				case 0: document.getElementById('ar'+i).checked=false; break;
				case 1:	document.getElementById('ar'+i).checked=true; break;
			}
		}
	}
	CheckMyForm();
}
{/literal}
</script>
{include file="$admingentemplates/admin_bottom.tpl"}