{include file="../head.tpl"}

{if count($errorMessages)}

	<ul>
	{foreach from=$errorMessages item=errorMessage}
		<li>{$errorMessage}</li>
	{/foreach}
	</ul>
{/if}

{*
{if $navi->id != ""}
<table width="100%"  border="0" cellpadding="4" cellspacing="1" class="tableborder">
	<form action="navigation.php?action=move" method="post">
		<input type="hidden" name="id" value="{$navi->id}" />
		<tr>
			<td class="header" colspan="2">{$langadmin.move}</td>
		</tr>
		<tr>
			<td>{$langadmin.destination}
				<select name="destination">
					<option value="0"></option>
				{foreach from=$navis item=dest}
					{if $dest->id != $navi->id}
					<option value="{$dest->id}">{$dest->title}</option>
						{if count($dest->sub_navi)}
							{foreach from=$dest->sub_navi item=sub_dest}
								{if $sub_dest->id != $navi->id}
					<option value="{$sub_dest->id}">- {$sub_dest->title}</option>
									{if count($sub_dest->sub_navi)}
										{foreach from=$sub_dest->sub_navi item=sub_sub_dest}
											{if $sub_sub_dest->id != $navi->id}
					<option value="{$sub_sub_dest->id}">- - {$sub_sub_dest->title}</option>
											{/if}
										{/foreach}
									{/if}
								{/if}
							{/foreach}
						{/if}
					{/if}
				{/foreach}
				</select>
			</td>
			<td>
				<input type="submit" value="{$langadmin.move}" />
			</td>
		</tr>
	</form>
</table>
{/if}
*}
<table width="100%"  border="0" cellpadding="4" cellspacing="1" class="tableborder">
	<form action="navigation.php?action=apply" method="post">
		<input type="hidden" name="id" value="{$navi->id}" />
		<tr>
			<td class="firstrow">{$langadmin.title}</td>
			{if $navi->id == ""}
			<td class="firstrow">{$langadmin.parent_navi}</td>
			{/if}
			<td class="firstrow">{$langadmin.document}</td>
			<td class="firstrow">{$langadmin.openonclick}</td>
			<td class="firstrow">{$langadmin.group}</td>
			<td class="firstrow">{$langadmin.position}</td>
			<td class="firstrow" />
		</tr>
		<tr>
			<td><input type="text" name="title" value="{$navi->title}" /></td>
			{if $navi->id == ""}
			<td>
				<select name="parent">
					<option value="0"></option>
				{foreach from=$navis item=dest}
					{if $dest->id != $navi->id}
					<option value="{$dest->id}">{$dest->title}</option>
					{/if}
					{if count($dest->sub_navi)}
						{foreach from=$dest->sub_navi item=sub_dest}
							{if $sub_dest->id != $navi->id}
					<option value="{$sub_dest->id}">- {$sub_dest->title}</option>
							{/if}
						{/foreach}
					{/if}
				{/foreach}
				</select>
			</td>
			{/if}
			<td><input type="text" name="document" value="{$navi->document}" /></td>
			{if $navi->id == ""}
				<input type="hidden" name="area" value="{$smarty.post.area_id}" />
			{/if}
			<td>
				<select name="openonclick">
					<option value="1" {if $navi->openonclick}selected{/if}>{$langadmin.yes}</option>
					<option value="0" {if !$navi->openonclick}selected{/if}>{$langadmin.no}</option>
				</select>
			</td>
			<td>
				<select name="group[]" multiple size="3">
				{foreach from=$groups item=group}
					<option value="{$group->ugroup}" {if $navi->group_id}{if in_array($group->ugroup, $navi->group_id)}selected{/if}{/if}>{$group->groupname}</option>
				{/foreach}
				</select>
			</td>
			<td>
				<input type="text" name="position" value="{$navi->posi|default:"1"}" size="4" maxlength="4" />
			</td>
			<td>
				<input type="submit" value="{$langadmin.edit}" />
			</td>
		</tr>
	</form>
</table>