<inp2:adm_SetPopupSize width="550" height="400"/>

<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:item_filters"  prefix="item-filter" title_preset="item_filter_edit"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
	<tr>
		<td>
			<script type="text/javascript">
				a_toolbar = new ToolBar();

				<inp2:m_RenderElement design="toolbar_button" icon="select" title="la_ToolTip_Save">
					submit_event('item-filter', '<inp2:item-filter_SaveEvent/>');
				</inp2:m_RenderElement>

				<inp2:m_RenderElement design="toolbar_button" icon="cancel" title="la_ToolTip_Cancel">
					cancel_edit('item-filter', 'OnCancelEdit', '<inp2:item-filter_SaveEvent/>', '<inp2:m_Phrase label="la_FormCancelConfirmation" js_escape="1"/>');
				</inp2:m_RenderElement>

				<inp2:m_RenderElement design="toolbar_button" icon="reset_edit" title="la_ToolTip_Reset">
					reset_form('item-filter', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
				</inp2:m_RenderElement>

				a_toolbar.AddButton( new ToolBarSeparator('sep1') );

				<inp2:m_RenderElement design="toolbar_button" icon="prev" title="la_ToolTip_Prev">
					go_to_id('item-filter', '<inp2:item-filter_PrevId/>');
				</inp2:m_RenderElement>

				<inp2:m_RenderElement design="toolbar_button" icon="next" title="la_ToolTip_Next">
					go_to_id('item-filter', '<inp2:item-filter_NextId/>');
				</inp2:m_RenderElement>

				a_toolbar.Render();

				<inp2:m_if check="item-filter_IsSingle">
					a_toolbar.HideButton('prev');
					a_toolbar.HideButton('next');
					a_toolbar.HideButton('sep1');
				<inp2:m_else/>
					<inp2:m_if check="item-filter_IsLast">a_toolbar.DisableButton('next');</inp2:m_if>
					<inp2:m_if check="item-filter_IsFirst">a_toolbar.DisableButton('prev');</inp2:m_if>
				</inp2:m_if>
			</script>
		</td>
	</tr>
</tbody>
</table>

<inp2:item-filter_SaveWarning name="grid_save_warning"/>
<inp2:item-filter_ErrorWarning name="form_error_warning"/>

<div id="scroll_container">
	<table class="edit-form">
		<inp2:m_RenderElement name="inp_id_label" prefix="item-filter" field="FilterId" title="la_fld_Id"/>
		<inp2:m_RenderElement name="inp_edit_box" prefix="item-filter" field="ItemPrefix"/>
		<inp2:m_RenderElement name="inp_edit_box" prefix="item-filter" field="FilterField"/>
		<inp2:m_RenderElement name="inp_edit_options" prefix="item-filter" field="FilterType" has_empty="1"/>
		<inp2:m_RenderElement name="inp_edit_radio" prefix="item-filter" field="Enabled"/>
		<inp2:m_RenderElement name="inp_edit_box" prefix="item-filter" field="RangeCount" style="width: 50px;"/>
		<inp2:m_RenderElement name="inp_edit_filler"/>
	</table>
</div>

<script type="text/javascript">
	$(document).ready(
		function () {
			var $field_mask = '<inp2:item-filter_InputName name="#FIELD_NAME#" js_escape="1"/>';

			$( get_control($field_mask, 'FilterType') ).change(
				function ($e) {
					$( get_control($field_mask, 'RangeCount', 'row') ).toggle( $(this).val() == 'range' );
				}
			).change();
		}
	)
</script>

<inp2:m_include t="incs/footer"/>