{include file="$admingentemplates/admin_top.tpl"}
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/classifieds.js"></script>
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_modules.php">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.forms.razdel_name}</div>
<div class="cr">&nbsp;</div>
<div class="cr">&nbsp;</div>
<div class="help_text" style="display:block;-moz-border-radius: 10px 10px 10px 10px;">
    <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.forms_hint}
    </div>
</div>
<div class="cr">&nbsp;</div>
<ul class="tabs">
    <li>
        <a href="admin_classified.php">{$lang.admin_menu.cat_manager}</a>
    </li>
    <li>
        <a class="current">{$lang.admin_menu.form_blocks}</a>
    </li>
    <li>
        <a href="admin_patterns.php">{$lang.admin_menu.patterns}</a>
    </li>
    <li>
        <a href="admin_datasources.php">{$lang.admin_menu.ref_datasources}</a>
    </li>
</ul>
<div class="user_operation_line">
	<div style="padding-left: 12px;">
		<table cellSpacing="3" cellPadding="0">
			<tr>
				<td><span style="color:white;">{$lang.settings.translate_into}:</span>
					<select onchange="javascript:window.open(this.value+'&id_sec='+id_section,'lang_edit', 'height=600, resizable=yes, scrollbars=yes,width=800, 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>
				{if $count!=0}<td>
					<div class="uol_item">
						<div class="uol_in_item" onclick="javascript:LoadAtributeForm(id_section, null, 'cur_section_div', 'attr_props_div');">{$lang.button.add_attribute}</div>
					</div>
					<div class="uol_item">
						<div class="uol_in_item" id="del_button" onclick="javascript: if(window.confirm('{$lang.forms.del_sec_sure|escape:javascript}')) location.href='{$del_section_link}'+id_section;">{$lang.button.del_section}</div>
					</div>
				</td>{/if}
			</tr>
		</table>
	</div>
</div>
<div class="cr"></div>
<!--ADD SECTION FORM-->
<div style="float:left;padding-bottom:10px;"><form name='add_new_sec' action="{$new_section_link}" method="POST">
<table cellpadding="2" cellspacing="0" width="100%" style="float:left;">
	<tr class="table_row">
		<td class="main_header_text" width="120px" align="left" style="padding-left:10px;">
			{$lang.forms.add_section}
		</td>
		<td width="205px" align="center">
			<input type="text" name="new_sec_name" style="width:200px">
		</td>
		<td class="table_row" align="left">
			<a class="admin_button_major" onclick="document.add_new_sec.submit();">{$lang.button.add}<span>&nbsp;</span></a>
		</td>
	</tr>
</table>
</form></div>
<!--/ADD SECTION FORM-->
<br>

<!--SECTIONS LINKS-->
<table cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<td class="main_content_text" align="left">
			{section name=s loop=$sections}
				<span id="sec_{$sections[s].id}" class="inactive_section" onclick="GetSectionAttrs({$sections[s].id}, 'sec_attrs_div', 'cur_section_div', 'attr_props_div')" style="cursor: pointer;">{$sections[s].name}</span>
				{if $smarty.section.s.last==false}&nbsp;&nbsp;|&nbsp;{/if}
			{sectionelse}
				<div class="main_error_text" align="center">
					{$lang.forms.no_sections}
				</div>
			{/section}
		</td>
	</tr>
</table>
<!--/SECTIONS LINKS-->
<br>

<table border=0 cellspacing=1 cellpadding=5 width="100%">
{*	{if $count!=0}
		<tr class="table_row">
			<td colspan="2">
				<a class="admin_button_major" onclick="javascript:LoadAtributeForm(id_section, null, 'cur_section_div', 'attr_props_div');">{$lang.button.add_attribute}<span>&nbsp;</span></a>&nbsp;
				<a id="del_button" class="admin_button" onclick="javascript: if(window.confirm('{$lang.forms.del_sec_sure|escape:javascript}')) location.href='{$del_section_link}'+id_section;">{$lang.button.del_section}<span>&nbsp;</span></a>
			</td>
		</tr>
	{/if}*}
<!--FIELDS LANG LINKS-->
{*	<tr class="table_row">
		<td colspan="2">
			<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}&id_sec='+id_section,'lang_edit', 'height=600, resizable=yes, scrollbars=yes,width=800, 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>
		</td>
	</tr>*}
<!--/FIELDS LANG LINKS-->

	<tr class="table_row" style="height:auto;">
		<td class="main_content_text" valign="top" colspan="2" style="padding-left: 0px;padding-right: 0px;">
			<div id="cur_section_div">

			</div>
		</td>
	</tr>

<!--ATTRIBUTES TABLE-->
	<tr>
		<td colspan="2" style="padding-left: 0px;padding-right: 0px;">
			<div id="sec_attrs_div">
			</div>
		</td>
	</tr>
<!--/ATTRIBUTES TABLE-->
</table>

<script type="text/javascript" src="{$site_root}{$template_root}/js/common.js"></script>

{*<script type="text/javascript" src="{$site_root}{$template_root}/js/scriptaculous/prototype.js"></script>
<script type="text/javascript" src="{$site_root}{$template_root}/js/scriptaculous/scriptaculous.js"></script>
<script type="text/javascript" src="{$site_root}{$template_root}/js/scriptaculous/builder.js"></script>
<script type="text/javascript" src="{$site_root}{$template_root}/js/scriptaculous/effects.js"></script>
<script type="text/javascript" src="{$site_root}{$template_root}/js/scriptaculous/dragdrop.js"></script>
<script type="text/javascript" src="{$site_root}{$template_root}/js/scriptaculous/controls.js"></script>
<script type="text/javascript" src="{$site_root}{$template_root}/js/scriptaculous/slider.js"></script>*}

<script type="text/javascript" src="{$site_root}{$template_root}/js/forms.js"></script>
{literal}
<script language="javascript" type="text/javascript">
var s_const=new Array(1);
{/literal}{section name=s loop=$sections}
	{if $sections[s].is_const=='Y'}s_const['{$sections[s].id}']='1';{/if}
{/section}
{literal}
	id_section={/literal}{if $id_section!=''}{$id_section}{else}0{/if}{literal};
	if (id_section!=0) GetSectionAttrs(id_section, 'sec_attrs_div', 'cur_section_div', 'attr_props_div');
</script>
{/literal}
<script type="text/javascript">
{literal}
		function showToolTip(e,text){
			if(document.all)e = event;
			var obj = document.getElementById('tooltip');
			obj.innerHTML = text;
			obj.style.display = 'block';
			var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
			var leftPos = e.clientX - $('#tooltip').width()-10;
			if(leftPos<0)leftPos = 0;
			obj.style.left = leftPos + 'px';
			obj.style.top = e.clientY - obj.offsetHeight -10 + st + 'px';
		}
		function hideToolTip(){
			document.getElementById('tooltip').style.display = 'none';
		}
{/literal}		
</script>
{include file="$admingentemplates/admin_bottom.tpl"}