{include file="../head.tpl"}
{if $smarty.request.action=="addcateg"}
<script language="javascript">
{literal}
	<!--
	function check(){
		if(document.kform.title.value == "" )
		{
			alert("{/literal}{$langadmin.newcatnoname}{literal}");
			document.kform.title.focus();
			return false;
		}
	}
	-->
{/literal}
</script>
{/if}
<form action="" method="post" enctype="multipart/form-data" name="kform" {if $smarty.request.action=="addcateg"}onsubmit="return check();"{/if}>
  <table width="100%"  border="0" cellpadding="4" cellspacing="1" class="tableborder">
    <tr>
      <td colspan="2" class="header">{$langadmin.newcat}</td>
    </tr>
    <tr>
      <td class="firstrow">{$langadmin.catname}</td>
      <td class="secondrow"><input name="title" type="text" id="title" value="{$row->catname}" size="35">
      </td>
    </tr>
	{if $smarty.request.action=="addcateg"}
    <tr>
      <td class="firstrow">{$lang.choosecateg}</td>
      <td class="secondrow">
	  <select name="articlecat" id="articlecat">
	<option value="0"> {$langadmin.choosenewcat} </option>
	{foreach from=$article item=item} 
	{if $item->parent_id == 0}
	
	<option style="font-weight:bold;font-style:italic" value="{$item->catid}" {if $parent_id==$item->catid or $smarty.request.parent_id==$item->catid} selected="selectd" {/if}>{$item->visible_title}</option>
	
	{else}
	
	<option value="{$item->catid}" {if $parent_id == $item->catid or $smarty.request.parent_id==$item->catid} selected="selectd" {/if}>{$item->visible_title}</option>
	
	{/if} {/foreach}
	</select>
	  </td>
    </tr>
	{/if}
   {*
    <tr>
      <td class="firstrow">{$langadmin.catdesc}</td>
      <td class="secondrow"><textarea name="descr" cols="75" rows="8" id="descr">{$row->catdesc}</textarea></td>
    </tr>
    <tr>
      <td class="firstrow">{$langadmin.autobr}</td>
      <td class="secondrow"><input name="autobr" type="checkbox" id="autobr" value="1"></td>
    </tr>
	*}
    <tr>
      <td valign="top" class="firstrow">{$langadmin.caticon}</td>
      <td class="secondrow"> {if $icon} <img  src="{$icon}" alt="" />
        <input name="oldimage" type="hidden" id="oldimage" value="{$row->icon}">
        <br />
        {/if}
        <input name="file" type="file" size="40">
      </td>
    </tr>
    {if $icon} 
    <tr>
      <td class="firstrow">{$langadmin.deleteimage}</td>
      <td class="secondrow"><input name="imagedel" type="checkbox" id="imagedel" value="1"></td>
    </tr>
   {/if}
    <tr>
      <td colspan="2" class="firstrow"><input name="id" type="hidden" id="id" value="{$catid|default:$smarty.request.id}">
        {if $smarty.request.action=="editcateg"}
		<input name="action" type="hidden" id="action" value="editcateg">
		{else}
        <input name="action" type="hidden" id="action" value="addcateg">
		{/if}
        <input name="editsave" type="hidden"  value="1">        
        <input name="area" type="hidden" id="area" value="{$smarty.request.area}">
        <input type="submit" class="button" value="{$langadmin.edit}">
      </td>
    </tr>
  </table>
</form>
{include file="../foot.tpl"}