{* 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 $additional_categs}
      	{html_options options=$categs selected=$categ_id name="ADD_CATEGORY_ID[]" id="0"|rand:"100"}
	{else}
      	{html_options options=$categs selected=$CATEGORY_ID name="CATEGORY_ID" id="CATEGORY_ID"}
	{/if}
{/if}
{/strip}