<{if $viewType eq 'input'}>
	<input type="hidden" id="<{$dirname}>SearchRelatedItem" name="<{$fieldName}>" value="<{$value}>">
	<div id="<{$divName}>"><table>
	<{if !empty($value)}>
		<{foreach item=item from=$itemInfo}>
			<tr>
				<td><{$item.listInfo}></td>
				<td><a href="#" onclick="<{$dirname}>Edit.deleteRelatedItem('<{$fieldName}>', '<{$item.id}>');"><img src="images/icon_delete.png"/></a></td>
			</tr>
		<{/foreach}>
	<{/if}>
	</table></div><br>
	<input class="formButton" type="button" href="itemselectsub.php?callbackid=<{$fieldName}>" rel="relatedItemPrettyPopin" value="<{$smarty.const._MD_XOONIPS_ITEM_SEARCH_BUTTON_LABEL}>">
<{elseif $viewType eq 'confirm'}>
	<div id="<{$divName}>"><table>
	<{if !empty($value)}>
		<{foreach item=item from=$itemInfo}>
			<tr>
				<td><{$item}></td>
				<td></td>
			</tr>
		<{/foreach}>
	<{/if}>
	</table></div>
	<input type="hidden" id="<{$dirname}>SearchRelatedItem" name="<{$fieldName}>" value="<{$value}>">
<{elseif $viewType eq 'detail'}>
	<{if !empty($value)}>
		<table>
		<{foreach item=item from=$itemInfo}>
			<tr>
				<td><{$item}></td>
			</tr>
		<{/foreach}>
		</table>
	<{/if}>
<{elseif $viewType eq 'search'}>
	<input type="text" name="<{$fieldName}>" size="50" value="">
<{elseif $viewType eq 'default'}>
	<input type="hidden" name="default_value" value="<{$value}>" />
<{/if}>