{if $filterDet.data=='officesAndUsers' or $filterDet.data=='offices' or $filterDet.data=='users'}
	<div>
		<select name="filters[{$filter}][d][type]" size="1" class="selectFilter"
			onchange="
				if (this.value!='custom') $('officesUsersFilterDiv_{$filter}').hide();
				else $('officesUsersFilterDiv_{$filter}').show();
			"
		>

			<option value="" {if !$filterDet.default.type}selected="1"{/if}>{$_LANG.reportsManagement.admin.filters.autocomplete.noDefaultValue}</option>

			{if $filterDet.data=='officesAndUsers' or $filterDet.data=='users'}
				<option value="currentUser" {if $filterDet.default.type=='currentUser'}selected="1"{/if}>{$_LANG.reportsManagement.admin.filters.autocomplete.currentUser}</option>
			{/if}

			{if $filterDet.data=='officesAndUsers' or $filterDet.data=='offices'}
				<option value="currentOffice" {if $filterDet.default.type=='currentOffice'}selected="1"{/if}>{$_LANG.reportsManagement.admin.filters.autocomplete.currentOffice}</option>
			{/if}

			<option value="custom" {if $filterDet.default.type=='custom'}selected="1"{/if}>{$_LANG.reportsManagement.admin.filters.autocomplete.predefined}</option>

		</select>
	</div>
{/if}

<div id="officesUsersFilterDiv_{$filter}"
	{* -- hide the autocomplete field if data=users/offices -- *}
	{if $filterDet.data=='officesAndUsers' or $filterDet.data=='offices' or $filterDet.data=='users'}
		{if $filterDet.default.type!='custom'}style="display:none"{/if}
	{/if}
>

	<input type="text" id="filterDet_{$filter}_value"
		name="filters[{$filter}][d][value]" value="{$filterDet.default.value}"
		class="autocompleteFilter"
	/>
	<input type="hidden" id="filterDet_{$filter}_id"
		name="filters[{$filter}][d][id]" value="{$filterDet.default.id}"
	/>

	<script>
		new DCsAutocomplete({ldelim}
			autocompleteField:"filterDet_{$filter}_value",
			autocompleteFieldValue:"filterDet_{$filter}_value",
			autocompleteFieldCode:"filterDet_{$filter}_id",
			clearOnCancel:true,
			clearOnSelect:false,
			noResultsText:'{$_LANG.autocompleteNoResults}',
			width:'320px',

			{if $filterDet.data=='users'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=User"
			{/if}
			{if $filterDet.data=='officesAndUsers'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=OfficeAndUser"
			{/if}
			{if $filterDet.data=='offices'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=Office"
			{/if}
			{if $filterDet.data=='departments'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=Department"
			{/if}
			{if $filterDet.data=='country'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=Country"
			{/if}
			{if $filterDet.data=='location'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=CountryCity"
			{/if}
			{if $filterDet.data=='corporate'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=Corporate"
			{/if}
			{if $filterDet.data=='supplier'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=Supplier"
			{/if}
			{if $filterDet.data=='supplierAndService'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=SupplierAndProduct"
			{/if}
			{if $filterDet.data=='supplierProduct'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=SupplierProduct"
			{/if}
			{if $filterDet.data=='customer'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=Customer"
			{/if}
			{if $filterDet.data=='iataAirport'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=Station"
			{/if}
			{if $filterDet.data=='corporateTrust'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=Trust&type=corporate"
			{/if}
			{if $filterDet.data=='supplierTrust'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=Trust&type=supplier"
			{/if}
			{if $filterDet.data=='corpContactPerson'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=ContactPersonCorporate"
			{/if}
			{if $filterDet.data=='miceProject'}
				url:"{$APP_URL}disp.php?module=RemoteData/AutocompleteFieldData&class=MiceProject"
			{/if}
		{rdelim});
	</script>

</div>
