{*{include file="$admingentemplates/admin_top.tpl"}
<font class=red_header>{$lang.addition.razdel_name}</font><font class=red_sub_header>&nbsp;|&nbsp;{if $form.type == "edit"}{$lang.advices.adv_edit}{else}{$lang.advices.adv_add}{/if}</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.area_advice_edit}
    </div>
</div>
*}
<div class="panel_subtabs">
	<div class="panel_content">
	{if $form.type=='edit'}
		<table cellSpacing="3" cellPadding="0"><tr>
			<td>
			<select onchange="javascript:window.open(this.value,'lang_edit', 'height=750, width=1050, left=10, top=50, resizable=yes, scrollbars=yes, menubar=no,status=no'); return false;">
		{section name=s loop=$lang_link}
				<option value="{$lang_link[s].link}">{$lang_link[s].name}</option>
				{/section}
			</select>
		</td>
		{*section name=s loop=$lang_link}
			<td align="center"><a href="#" onclick="javascript:window.open('{$lang_link[s].link}','lang_edit', 'height=750, width=1050, left=10, top=50, resizable=yes, scrollbars=yes, menubar=no,status=no'); return false;" class=privacy_link>{$lang_link[s].name}</a></td>
			{if !$smarty.section.s.last}
			<td align="center" valign="middle" class="main_content_text">&nbsp;|&nbsp;</td>
			{/if}
		{/section*}
		</tr></table>
	{/if}

	<form action="{$form.save_link}" name="edit_form" id="edit_form" method="POST" style="margin:0px" onSubmit="return CheckChanges()" ENCTYPE="multipart/form-data">
	<table border="0" cellspacing="1" cellpadding="5">
		<tr>
			<td align="left" width="150">{$lang.advices.category}</td>
			<td >{$form.category}<input type="hidden" name="category" value="{$form.category_id}"></td>
		</tr>
		<tr>
			<td align="left" width="150">{$lang.advices.adv_name} <font class=main_error_text>*</font></td>
			<td><input type="text" name="title" value="{$form.title}" size="40"></td>
		</tr>
		<tr>
			<td width="150">{$lang.advices.adv_descr} <font class=main_error_text>*</font></td>
			<td align="left" width="700" height="350">
				{$redactor}
                                <textarea name="code" id="description" class="redactor_normal">{*$data.description*}</textarea>
                                <div id="bad_div_description" class="bad_div_left"></div>				
			</td>
		</tr>
	</table>
	</form>
	</div>
</div>
<div style="float:left;width:100%;">
	<table border="0" width="100%">
		<tr height="40">
			<td>
				<a class="admin_button_major" onclick="SaveBlock('show_block','edit_form'); return false;">{$lang.button.save}<span>&nbsp;</span></a>
				<a class="admin_button_cancel" onclick="ShowBlock('show_block','{$form.back_link}')">{$lang.button.vip_cancel}<span>&nbsp;</span></a>
			</td>
		</tr>
	</table>
</div>
<script>
tab_link = '{$form.back_link}';
{literal}
	function CheckChanges(){
		bp = document.edit_form;
		if(bp.title.value == ""){
			alert({/literal}"{$lang.advices.empty_adv_name|escape:javascript}"{literal}); return false;
		}
		if(bp.body.value == ""){
			alert({/literal}"{$lang.advices.empty_adv_descr|escape:javascript}"{literal}); return false;
		}
//		document.edit_form.submit();
	}
{/literal}
</script>

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