{* Build the category selection *}

{* Error and confirmation messages *}
{include file="messages.tpl"}

{strip}
{if $smarty.const.AJAX_CAT_SELECTION_METHOD eq 1}
   <div id="catTitle">
      {if !empty ($CategoryTitle)}{$CategoryTitle}{else}{l}Please select a category!{/l}{/if}
   </div>
   <span id="toggleCategTree">{l}Change category{/l}</span>
   {if isset ($parent) and $parent eq 1}
      <input type="hidden" id="PARENT_ID" name="PARENT_ID" value="{$PARENT_ID}" class="hidden" />
   {else}
      <input type="hidden" id="CATEGORY_ID" name="CATEGORY_ID" value="{$CATEGORY_ID}" class="hidden" />
   {/if}
   <div id="categtreebox"></div>

{else}
   {if isset ($parent) and $parent eq 1}
      {html_options options=$categs selected=$PARENT_ID name="PARENT_ID" id="PARENT_ID"}
   {else}
      {html_options options=$categs selected=$CATEGORY_ID name="CATEGORY_ID" id="CATEGORY_ID"}
   {/if}
{/if}
{/strip}