{if empty($VALUE)}
	{assign var=filenames value=[]}
{else}
	{assign var=filenames value=":"|explode:$VALUE}
{/if} 
{assign var=num_files value=$filenames|@count}

<div class="cf_file {if $num_files > 0}cf_file_has_items{/if} {if $num_files > 1}cf_file_has_multiple_items{/if} {if $multiple_files == 'yes'}cf_file_multiple{/if}"
	id="cf_file_{$FIELD_ID}">
    <input type="hidden" class="cf_file_field_id" value="{$FIELD_ID}" />

	<ul class="cf_file_list">
		<li class="cf_file_top_row">
			<input type="checkbox" class="cf_file_toggle_all" />
			<span class="cf_file_col">{$LANG.word_file}</span>
		</li>
		{foreach from=$filenames item=filename}
		<li>
			<input type="checkbox" name="cf_files[]" class="cf_file_row_cb" value="{$filename}" />
			<a href="{$folder_url}/{$filename}" 
				{if $use_fancybox == "yes"}class="fancybox"{/if}>{$filename}</a>
			{if $num_files == 1 && $multiple_files == "no"}
				<input type="button" class="cf_delete_file" value="{$LANG.word_delete}" />
			{/if}
		</li>
		{/foreach}
	</ul>

	<input type="button" value="{$LANG.word_delete}" class="cf_file_delete_selected"
		disabled="disabled" {if empty($VALUE) || ($multiple_files == 'no' && $num_files < 2)}style="display: none"{/if} />

	<input type="file" class="cf_file_upload_btn" name="{$NAME}{if $multiple_files == "yes"}[]{/if}"
		{if $multiple_files == "yes"}multiple="multiple"{/if}
		{if $multiple_files == "no" && $num_files > 0}style="display:none"{/if} /> 

    <div id="file_field_{$FIELD_ID}_message_id" class="cf_file_message"></div>
</div>

{if $comments}
    <div class="cf_field_comments">{$comments}</div>
{/if}