
<script type="text/javascript">
{include file="$incpath/other/validate_js.tpl"}
{literal}
$.validator.setDefaults({
	submitHandler: function() 
	{ 
		document.forms['editForm'].submit();
	}
});

$().ready(function() {
	$("#editForm").validate(
	{ 
	rules: { // rules
				Titel_1: {required: true,minLength: 2},
				Dokument: {required: true,minLength: 5},
				Position: {required: true,number: true}
			} // end rules
			, // messages
			messages: 
			{
				/* MESSAGES */	
			}
	} // end validate
	);
}
)
{/literal}
</script>

<div class="popbox">
  <form id="editForm" name="editForm" action="" method="post">
    <input type="hidden" name="save" value="1" />
    <input name="id" type="hidden" value="{$smarty.request.id}" />
    <input name="categ" type="hidden" value="{$res->NaviCat}" />
    <table width="100%" border="0" cellpadding="5" cellspacing="0" class="tableborder">
      <tr>
        <td colspan="2" class="header"> {if $smarty.request.sub=="newnaviitem"}{#Navigation_newdoc#}{else}{#Navigation_docedit#}{/if} </td>
      </tr>
     
      <tr>
        <td width="200" class="row_left">{#Global_Name#} ({$language_long_1})</td>
        <td class="row_right"><input class="input" type="text" name="Titel_1" value="{$res->Titel_1|koobispecialchars}" style="width:150px" maxlength="200" />        </td>
      </tr>
      <tr>
        <td width="200" class="row_left">{#Global_Name#} ({$language_long_2})</td>
        <td class="row_right"><input class="input" type="text" name="Titel_2" value="{$res->Titel_2|koobispecialchars}" style="width:150px"  maxlength="200" /></td>
      </tr>
      <tr>
        <td width="200" class="row_left">{#Global_Name#} ({$language_long_3})</td>
        <td class="row_right"><input class="input" type="text" name="Titel_3" value="{$res->Titel_3|koobispecialchars}" style="width:150px"  maxlength="200" /></td>
      </tr>
      <tr>
        <td class="row_left">{#Navigation_doc#}</td>
        <td class="row_right"><input class="input" type="text" name="Dokument" value="{$res->Dokument|koobispecialchars}" style="width:150px"  maxlength="200" /></td>
      </tr>
      <tr>
        <td class="row_left">{#Global_Target#}</td>
        <td class="row_right">
        <select class="input" name="Ziel" style="width:150px">
      <option value="_self" {if $res->Ziel=='_self'}selected="selected"{/if}>{#Navigation_self#}</option>
      <option value="_new" {if $res->Ziel=='_new'}selected="selected"{/if}>{#Navigation_new#}</option>
      </select>        </td>
      </tr>
      <tr>
        <td class="row_left">{#Navigation_expand#}</td>
        <td class="row_right">
        <label><input type="radio" name="openonclick" id="radio" value="1" {if $res->openonclick=='1' || $smarty.request.sub=='newnaviitem'}checked="checked"{/if} /> {#Yes#}</label>
        <label><input type="radio" name="openonclick" id="radio" value="0" {if $res->openonclick=='0'}checked="checked"{/if} /> {#No#}</label>        </td>
      </tr>
      <tr>
        <td width="200" class="row_left">{#Global_Position#}</td>
        <td class="row_right"><input class="input"  type="text" name="Position" value="{if $smarty.request.sub=='newnaviitem'}1{else}{$smarty.post.position|default:$res->Position}{/if}" size="3" maxlength="3" /> </td>
      </tr>
      
      <tr>
        <td width="200" valign="top" class="row_left">{#Forums_PGroups#}</td>
        <td class="row_right"><select name="group_id[]" size="8" multiple="multiple" class="input" style="width:155px" >
            
		{foreach from=$groups item=group}
		
            <option value="{$group->ugroup}" {if @in_array($group->ugroup, $res->Gruppen) || $smarty.request.sub=="newnaviitem"}selected="selected"{/if}>{$group->groupname}</option>
            
		{/foreach}
		
          </select>        
          </td>
      </tr>
      {if $smarty.request.sub=="newnaviitem"}
      <tr>
      <td class="row_left">{#Navigation_parentdoc#}</td>
      <td class="row_right">
      <select name="ParentId" id="ParentId" class="input" style="width:155px">
      <option value="0">{#Navigation_newdoc_blanc#}</option>
      {foreach from=$items item=n}
        <option value="{$n->Id}" style="font-weight:bold">{$n->Titel_1|koobispecialchars}</option>
        	{foreach from=$n->sub1 item=s1 name=second}
            <option value="{$s1->Id}">&nbsp;-&nbsp;{$s1->Titel_1|koobispecialchars}</option>
        	{/foreach}
       {/foreach}
      </select>
      </td>
      </tr>
      {/if}
      
      {if $smarty.request.sub!="newnaviitem"}
      <tr>
        <td valign="top" class="row_left">{#Navigation_setpermsall#}</td>
        <td class="row_right"><input name="perms_to_section" type="checkbox" id="perms_to_section" value="1" /></td>
      </tr>
      {/if}
      <tr>
        <td colspan="2" class="thirdrow"><input class="button" type="submit" value="{#Save#}" />
          <input class="button" type="button" onClick="window.close()" value="{#Close#}" />        </td>
      </tr>
    </table>
  </form>
</div>
