<inp2:m_DefineElement name="current_page">
 <span class="current_page"><inp2:m_param name="page"/></span>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="page">
	<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url"><inp2:m_param name="page"/></a>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="next_page">
	<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&gt;</a>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="prev_page">
	<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&lt;</a>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="next_page_split">
	<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&gt;&gt;</a>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="prev_page_split">
	<a href="javascript:go_to_page('<inp2:m_param name="PrefixSpecial"/>', <inp2:m_param name="page"/>, <inp2:m_param name="ajax"/>)" class="nav_url">&lt;&lt;</a>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_pagination_elem" main_special="" ajax="0">
	<inp2:m_if check="GridInfo" type="needs_pagination" pass_params="1">
		&nbsp;<inp2:m_phrase name="la_Page"/>:
		<inp2:PrintPages active_block="current_page" split="10" inactive_block="page" prev_page_block="prev_page" next_page_block="next_page" prev_page_split_block="prev_page_split" next_page_split_block="next_page_split" main_special="$main_special" ajax="$ajax" grid="$grid"/>
	</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_pagination" SearchPrefixSpecial="" ajax="0">
<!--## Maybe not in use ##-->
<table cellspacing="0" cellpadding="2" width="100%" border="0" class="pagination_bar">
	<tbody>
		<tr>
	  	<td width="100%">
		  	 <inp2:m_RenderElement name="grid_pagination_elem" pass_params="1"/>
			</td>
			<td>
				<inp2:m_if check="m_ParamEquals" param="search" value="on">
					<inp2:m_if check="m_ParamEquals" name="SearchPrefixSpecial" value="">
						<inp2:m_RenderElement name="grid_search" grid="$grid" PrefixSpecial="$PrefixSpecial" ajax="$ajax"/>
					<inp2:m_else />
						<inp2:m_RenderElement name="grid_search" grid="$grid" PrefixSpecial="$SearchPrefixSpecial" ajax="$ajax"/>
					</inp2:m_if>
				</inp2:m_if>
			</td>
		</tr>
	</tbody>
</table>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="search_main_toolbar">
	<td style="white-space: nowrap; text-align: right; width: 310px;" align="right">
		<div style="float: right">
			<table cellpadding="0" cellspacing="0">
				<tr>
					<td>
						<input 	type="text"
							id="<inp2:m_param name='prefix'/>_search_keyword"
							class="filter <inp2:m_ifnot check='m_Recall' var='{$prefix}_search_keyword' equals_to=''>filter-active</inp2:m_ifnot>"
							name="<inp2:m_param name='prefix'/>_search_keyword"
							value="<inp2:m_recall var='{$prefix}_search_keyword' no_null='no_null' special='1'/>"
							PrefixSpecial="<inp2:m_param name='prefix'/>"
							Grid="<inp2:m_param name='grid'/>"
							ajax="0" style="width:150px"/>
					</td>
					<td style="white-space: nowrap;">
						<script type="text/javascript">
							b_toolbar = new ToolBar();

							b_toolbar.AddButton( new ToolBarButton('search', '<inp2:m_phrase label="la_ToolTip_Search" escape="1"/>',
									function() {
										search('<inp2:m_Param name="prefix"/>', '<inp2:m_Param name="grid"/>', 0);
									} ) );

							b_toolbar.AddButton( new ToolBarButton('search_reset_alt', '<inp2:m_phrase label="la_ToolTip_SearchReset" escape="1"/>',
									function() {
										search_reset('<inp2:m_Param name="prefix"/>', '<inp2:m_Param name="grid"/>', 0);
									} ) );

							b_toolbar.Render();
						</script>
					</td>
				</tr>
			</table>
		</div>
	</td>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_search" ajax="0">
				<td align="right" class="search-cell">
					<img src="<inp2:m_TemplatesBase/>/img/spacer.gif" width="250" height="1" alt=""/><br />
					<table cellspacing="0" cellpadding="0">
						<tr>
							<td><inp2:m_phrase name="la_Search"/>:&nbsp;</td>
							<td>
								<input 	type="text"
										id="<inp2:m_param name='PrefixSpecial'/>_search_keyword"
										class="filter <inp2:m_ifnot check='m_Recall' var='{$PrefixSpecial}_search_keyword' equals_to=''>filter-active</inp2:m_ifnot>"
										name="<inp2:m_param name='PrefixSpecial'/>_search_keyword"
										value="<inp2:m_recall var='{$PrefixSpecial}_search_keyword' no_null='no_null' special='1'/>"
										PrefixSpecial="<inp2:m_param name='PrefixSpecial'/>"
										Grid="<inp2:m_param name='grid'/>"
										ajax="<inp2:m_param name='ajax'/>"/>
								<input type="text" style="display: none;"/>
							</td>
							<td style="white-space: nowrap;" id="search_buttons[<inp2:m_param name="PrefixSpecial"/>]">
							</td>
						</tr>
					</table>

					<inp2:m_if check="m_Param" name="ajax" equals_to="0">
						<script type="text/javascript">
							addLoadEvent(
								function () {
									<inp2:m_RenderElement name="grid_search_buttons" pass_params="true"/>
								}
							)
						</script>
					</inp2:m_if>
				</td>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_search_buttons" PrefixSpecial="" grid="" ajax="1">
	var $search_box = document.getElementById('<inp2:m_param name="PrefixSpecial"/>_search_keyword');
	if ($search_box) {
		//$search_box.onkeydown = search_keydown;
		$( jq('#<inp2:m_param name="PrefixSpecial"/>_search_keyword') ).keydown(search_keydown);
	}

	var $search_buttons = document.getElementById('search_buttons[<inp2:m_param name="PrefixSpecial"/>]');
	if ($search_buttons) {
		Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'] = new ToolBar('icon16_');
		Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].IconSize = {w:22,h:22};
		Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].UseLabels = false;
		Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].AddButton(
			new ToolBarButton(
				'search',
				'<inp2:m_phrase name="la_ToolTip_Search" escape="1"/>',
				function() {
					search('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>)
				},
				null,
				'<inp2:m_param name="PrefixSpecial"/>'
			)
		);

		Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].AddButton(
			new ToolBarButton(
				'search_reset',
				'<inp2:m_phrase name="la_ToolTip_SearchReset" escape="1"/>',
				function() {
					search_reset('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="grid"/>', <inp2:m_param name="ajax"/>)
				},
				null,
				'<inp2:m_param name="PrefixSpecial"/>'
			)
		);

		Toolbars['<inp2:m_param name="PrefixSpecial"/>_search'].Render($search_buttons);
	}
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_checkbox_td" format="">
	<inp2:m_RenderElement name="grid_data_td" pass_params="1"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_checkbox_td_no_icon" format="">
	<inp2:m_RenderElement name="grid_data_td" pass_params="1"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="label_grid_checkbox_td" format="">
	<inp2:m_RenderElement name="grid_data_label_td" pass_params="1"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_icon_td" format="">
	<inp2:m_RenderElement name="grid_data_td" pass_params="1"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_radio_td" format="">
	<inp2:m_RenderElement name="grid_data_td" pass_params="1"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_data_td" format="" no_special="1" nl2br="" first_chars="" td_style="">
	<inp2:Field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_total_td">
	<inp2:m_if check="FieldTotal" field="$field" function_only="1">
		<inp2:FieldTotal field="$field"/>
	<inp2:m_else/>
		&nbsp;
	</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_priority_td" format="" no_special="" nl2br="" first_chars="" td_style="" currency="">
	<inp2:Field field="$field" first_chars="$first_chars" currency="$currency" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/>
	<inp2:m_ifnot check="Field" field="Priority" equals_to="0" db="db"><span class="priority"><sup><inp2:Field field="Priority"/></sup></span></inp2:m_ifnot>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_edit_td" format="" style="">
	<input type="text" id="<inp2:{$PrefixSpecial}_InputName field="$field"/>" name="<inp2:{$PrefixSpecial}_InputName field="$field"/>" value="<inp2:{$PrefixSpecial}_field field="$field" grid="$grid" format="$format"/>" style="<inp2:m_Param name='style'/>"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_picker_td" nl2br="0" no_special="1" separator="&nbsp;">
	<inp2:Field name="$field" format="$separator" nl2br="$nl2br" no_special="$no_special"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_options_td" format="">
		<select name="<inp2:InputName field="$field"/>" id="<inp2:InputName field="$field"/>">
			<inp2:m_if check="FieldOption" field="$field" option="use_phrases">
				<inp2:PredefinedOptions field="$field" block="inp_option_phrase" selected="selected" has_empty="1" empty_value="0"/>
			<inp2:m_else/>
				<inp2:PredefinedOptions field="$field" block="inp_option_item" selected="selected" has_empty="1" empty_value="0"/>
			</inp2:m_if>
		</select>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_date_td" format="">
		<input type="text" name="<inp2:InputName field="{$field}_date"/>" id="<inp2:InputName field="{$field}_date"/>" value="<inp2:Field field="{$field}_date" format="_regional_InputDateFormat"/>" size="<inp2:Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" datepickerIcon="<inp2:m_ProjectBase/>core/admin_templates/img/calendar_icon.gif">&nbsp;
		<img src="<inp2:m_TemplatesBase/>/img/calendar_icon.gif" id="cal_img_<inp2:InputName field="{$field}"/>" width="13" height="12"
				     style="cursor: pointer; margin-right: 5px"
				     title="Date selector"
				/>
		<span class="small">(<inp2:Format field="{$field}_date" input_format="1" human="true"/>)</span>
		<script type="text/javascript">
			Calendar.setup({
		        inputField		:	"<inp2:InputName field="{$field}_date"/>",
		        ifFormat		:	Calendar.phpDateFormat("<inp2:Format field="{$field}_date" input_format="1"/>"),
		        button			:	"cal_img_<inp2:InputName field="{$field}"/>",
		        align			:	"br",
		        singleClick		:	true,
		        showsTime		:	true,
		        weekNumbers		:	false,
		        firstDay		:	<inp2:m_GetConfig var="FirstDayOfWeek"/>,
		        onUpdate	:	function(cal) {
		        	runOnChange('<inp2:InputName field="{$field}_date"/>');
		       	}
			});
		</script>
		<input type="hidden" name="<inp2:InputName field="{$field}_time"/>" id="<inp2:InputName field="{$field}_time" input_format="1"/>" value="">
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_data_label_td">
	<inp2:Field field="$field" grid="$grid" plus_or_as_label="1" no_special="no_special" format="$format"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_data_label_ml_td" format="">
	<span class="<inp2:m_if check="{$SourcePrefix}_HasError" field="$virtual_field">error-cell</inp2:m_if>">
		<inp2:{$PrefixSpecial}_Field field="$field" grid="$grid" as_label="1" no_special="no_special" format="$format"/>
	</span><inp2:m_if check="{$SourcePrefix}_IsRequired" field="$virtual_field"><span class="field-required"> *</span></inp2:m_if>:<br />

	<inp2:m_if check="FieldEquals" field="$ElementTypeField" value="textarea">
		<inp2:m_if check="Field" name="MultiLingual" equals_to="1" db="db">
			<a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>, 1);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.png" style="cursor:hand;" width="24" height="24" border="0"></a>
		<inp2:m_else/>
			<inp2:Field name="FieldName" result_to_var="custom_field"/>
			<a href="javascript:OpenEditor('&section=in-link:editlink_general', 'kernel_form', '<inp2:{$SourcePrefix}_InputName field="cust_{$custom_field}"/>');"><img src="img/icons/icon24_link_editor.gif" style="cursor: hand;" width="24" height="24" border="0"></a>
		</inp2:m_if>
	<inp2:m_else/>
		<inp2:m_if check="Field" name="MultiLingual" equals_to="1" db="db">
			<a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.png" style="cursor:hand;" width="24" height="24" border="0"></a>
		</inp2:m_if>
	</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_empty_filter">

</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_column_filter">
	<!--## this cheat makes sure, that columns without a filter are using like filter ##-->
	<inp2:m_RenderElement name="grid_like_filter" pass_params="1"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_options_filter" use_phrases="0" filter_width="90%">
		<select
			class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='options' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
			name="<inp2:SearchInputName field="$filter_field" filter_type="options" grid="$grid"/>"
			style="width: <inp2:m_Param name="filter_width"/>">

			<inp2:m_if check="m_ParamEquals" name="use_phrases" value="1">
				<inp2:PredefinedSearchOptions field="$filter_field" block="inp_option_phrase" selected="selected" has_empty="1" empty_value="" filter_type="options" grid="$grid"/>
			<inp2:m_else/>
				<inp2:PredefinedSearchOptions field="$filter_field" block="inp_option_item" selected="selected" has_empty="1" empty_value="" filter_type="options" grid="$grid"/>
			</inp2:m_if>
		</select>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_like_filter" filter_width="95%">
		<input type="text"
			class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='like' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
		  style="width: <inp2:m_Param name="filter_width"/>"
			name="<inp2:SearchInputName field="$filter_field" filter_type="like" grid="$grid"/>"
			value="<inp2:SearchField field="$filter_field" filter_type="like" grid="$grid"/>"
			onkeypress="search_keydown(event, '<inp2:m_Param name="PrefixSpecial"/>', '<inp2:m_Param name="grid"/>', '<inp2:m_Param name="ajax"/>')"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_user_like_filter" selector_template="user_selector" filter_width="95%">
	<table class="range-filter">
		<tr>
			<td style="width: 100%">
				<input type="text"
					class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='like' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
	 				 style="width: <inp2:m_Param name="filter_width"/>"
		name="<inp2:SearchInputName field="$filter_field" filter_type="like" grid="$grid"/>"
		id="<inp2:SearchInputName field="$filter_field" filter_type="like" grid="$grid"/>"
		value="<inp2:SearchField field="$filter_field" filter_type="like" grid="$grid"/>"
		onkeypress="search_keydown(event, '<inp2:m_Param name="PrefixSpecial"/>', '<inp2:m_Param name="grid"/>', '<inp2:m_Param name="ajax"/>')"/>
			</td>
			<td valign="middle">
				<a href="javascript:openSelector('<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_t t="$selector_template" pass="all,$PrefixSpecial" escape="1"/>', '<inp2:m_param name="filter_field"/>');">
					<img src="img/icons/icon24_link_user.gif" style="cursor:hand;" width="24" height="24" border="0">
				</a>
			</td>
		</tr>
	</table>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_picker_filter" use_phrases="0" filter_width="90%">
		<select
			class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='picker' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
			name="<inp2:SearchInputName field="$filter_field" filter_type="picker" grid="$grid"/>"
			style="width: <inp2:m_Param name="filter_width"/>">

			<inp2:m_if check="m_ParamEquals" name="use_phrases" value="1">
				<inp2:PredefinedSearchOptions field="$filter_field" block="inp_option_phrase" selected="selected" has_empty="1" empty_value="" filter_type="picker" grid="$grid"/>
			<inp2:m_else/>
				<inp2:PredefinedSearchOptions field="$filter_field" block="inp_option_item" selected="selected" has_empty="1" empty_value="" filter_type="picker" grid="$grid"/>
			</inp2:m_if>
		</select>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_like_combo_filter" filter_width="95%">
		<input type="text"
			autocomplete="off"
			class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='like' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
		  style="width: <inp2:m_Param name="filter_width"/>"
			name="<inp2:SearchInputName field="$filter_field" filter_type="like" grid="$grid"/>"
			id="<inp2:SearchInputName field="$filter_field" filter_type="like" grid="$grid"/>"
			value="<inp2:SearchField field="$filter_field" filter_type="like" grid="$grid"/>"
			onkeypress="search_keydown(event, '<inp2:m_Param name="PrefixSpecial"/>', '<inp2:m_Param name="grid"/>', '<inp2:m_Param name="ajax"/>')"/>
		<script type="text/javascript">
			new AJAXDropDown('<inp2:SearchInputName field="$filter_field" filter_type="like" grid="$grid"/>',
				function(cur_value) {
					return '<inp2:m_t no_amp="1" pass="m,{$PrefixSpecial}" field="$filter_field" {$PrefixSpecial}_event="OnSuggestValues" cur_value="#VALUE#"/>'.replace('#VALUE#', cur_value);
				}
			);
		</script>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_equals_filter" filter_width="95%">
		<input type="text"
			 class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='equals' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
			 style="width: <inp2:m_Param name="filter_width"/>"
			 name="<inp2:SearchInputName field="$filter_field" filter_type="equals" grid="$grid"/>"
			 value="<inp2:SearchField field="$filter_field" filter_type="equals" grid="$grid"/>"
			 onkeypress="search_keydown(event, '<inp2:m_Param name="PrefixSpecial"/>', '<inp2:m_Param name="grid"/>', '<inp2:m_Param name="ajax"/>')"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_range_filter" filter_width="90%">
		<table class="range-filter">
			<tr>
				<td style="width: 100%">
					<input type="text"
						class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='range' type='from' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
						name="<inp2:SearchInputName field="$filter_field" filter_type="range" type="from" grid="$grid"/>"
						value="<inp2:SearchField field="$filter_field" filter_type="range" type="from" grid="$grid"/>"
						style="width: <inp2:m_Param name="filter_width"/>;"
						onkeypress="search_keydown(event, '<inp2:m_Param name="PrefixSpecial"/>', '<inp2:m_Param name="grid"/>', '<inp2:m_Param name="ajax"/>')"/>
				</td>
				<td rowspan="2" valign="middle">
					<img src="<inp2:m_TemplatesBase/>/img/expand_filter.gif" width="7" height="9" alt="" onclick="filter_toggle('<inp2:SearchInputName field='$filter_field' filter_type='range' type='to' grid='$grid'/>_row', '<inp2:m_Param name='PrefixSpecial'/>');"/>
				</td>
			</tr>
			<tr class="to-range-filter<inp2:m_ifnot check='RangeFiltersUsed' grid='$grid'> hidden-filter</inp2:m_ifnot>" id="<inp2:SearchInputName field='$filter_field' filter_type='range' type='to' grid='$grid'/>_row">
				<td style="width: 100%;<inp2:m_ifnot check='RangeFiltersUsed' grid='$grid'> display: none;</inp2:m_ifnot>">
					<input type="text"
						class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='range' type='to' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
						name="<inp2:SearchInputName field="$filter_field" filter_type="range" type="to" grid="$grid"/>"
						value="<inp2:SearchField field="$filter_field" filter_type="range" type="to" grid="$grid"/>"
						style="width: <inp2:m_Param name="filter_width"/>;"
						onkeypress="search_keydown(event, '<inp2:m_Param name="PrefixSpecial"/>', '<inp2:m_Param name="grid"/>', '<inp2:m_Param name="ajax"/>')"/>
				</td>
			</tr>
		</table>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_float_range_filter" filter_width="90%">
		<table class="range-filter">
			<tr>
				<td style="width: 100%">
					<input type="text"
						class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='float_range' type='from' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
						name="<inp2:SearchInputName field="$filter_field" filter_type="float_range" type="from" grid="$grid"/>"
						value="<inp2:SearchField field="$filter_field" filter_type="float_range" type="from" grid="$grid"/>"
						style="width: <inp2:m_Param name="filter_width"/>"
						onkeypress="search_keydown(event, '<inp2:m_Param name="PrefixSpecial"/>', '<inp2:m_Param name="grid"/>', '<inp2:m_Param name="ajax"/>')"/>
				</td>
				<td rowspan="2" valign="middle">
					<img src="<inp2:m_TemplatesBase/>/img/expand_filter.gif" width="7" height="9" alt="" onclick="filter_toggle('<inp2:SearchInputName field='$filter_field' filter_type='range' type='to' grid='$grid'/>_row', '<inp2:m_Param name='PrefixSpecial'/>');"/>
				</td>
			</tr>
			<tr class="to-range-filter<inp2:m_ifnot check='RangeFiltersUsed' grid='$grid'> hidden-filter</inp2:m_ifnot>" id="<inp2:SearchInputName field='$filter_field' filter_type='float_range' type='to' grid='$grid'/>_row">
				<td style="width: 100%;<inp2:m_ifnot check='RangeFiltersUsed' grid='$grid'> display: none;</inp2:m_ifnot>">
					<input type="text"
						class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='float_range' type='to' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
						name="<inp2:SearchInputName field="$filter_field" filter_type="float_range" type="to" grid="$grid"/>"
						value="<inp2:SearchField field="$filter_field" filter_type="float_range" type="to" grid="$grid"/>"
						style="width: <inp2:m_Param name="filter_width"/>"
						onkeypress="search_keydown(event, '<inp2:m_Param name="PrefixSpecial"/>', '<inp2:m_Param name="grid"/>', '<inp2:m_Param name="ajax"/>')"/>
				</td>
			</tr>
		</table>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_date_range_filter" calendar_format="" filter_width="80%">
		<table class="range-filter">
			<tr>
				<td style="width: 100%">
					<input type="text"
						class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='date_range' type='from' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
						style="width: <inp2:m_Param name="filter_width"/>"
						name="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>"
						id="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>"
						value="<inp2:SearchField field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>"
						onkeypress="search_keydown(event, '<inp2:m_Param name="PrefixSpecial"/>', '<inp2:m_Param name="grid"/>', '<inp2:m_Param name="ajax"/>')"/>
				</td>
				<td>
					<img src="<inp2:m_TemplatesBase/>/img/calendar_icon.gif" width="13" height="12" id="cal_img_<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="from" grid="$grid"/>"
					     style="cursor: pointer; margin-right: 5px"
					     title="Date selector"
					 />
				</td>
				<td rowspan="2" valign="middle">
					<img src="<inp2:m_TemplatesBase/>/img/expand_filter.gif" width="7" height="9" alt="" onclick="filter_toggle('<inp2:SearchInputName field='$filter_field' filter_type='date_range' type='to' grid='$grid'/>_row', '<inp2:m_Param name='PrefixSpecial'/>');"/>
				</td>
			</tr>
			<tr class="to-range-filter<inp2:m_ifnot check='RangeFiltersUsed' grid='$grid'> hidden-filter</inp2:m_ifnot>" id="<inp2:SearchInputName field='$filter_field' filter_type='date_range' type='to' grid='$grid'/>_row">
				<td style="width: 100%;<inp2:m_ifnot check='RangeFiltersUsed' grid='$grid'> display: none;</inp2:m_ifnot>">
					<input type="text"
						class="filter <inp2:m_ifnot check='SearchField' field='$filter_field' filter_type='date_range' type='to' grid='$grid' equals_to=''>filter-active</inp2:m_ifnot>"
						style="width: <inp2:m_Param name="filter_width"/>"
						name="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>"
						id="<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>"
						value="<inp2:SearchField field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>"
						onkeypress="search_keydown(event, '<inp2:m_Param name="PrefixSpecial"/>', '<inp2:m_Param name="grid"/>', '<inp2:m_Param name="ajax"/>')"/>
				</td>
				<td<inp2:m_ifnot check='RangeFiltersUsed' grid='$grid'> style="display: none;"</inp2:m_ifnot>>
					<img src="<inp2:m_TemplatesBase/>/img/calendar_icon.gif" width="13" height="12" id="cal_img_<inp2:SearchInputName field="$filter_field" filter_type="date_range" type="to" grid="$grid"/>"
					     style="cursor: pointer; margin-right: 5px"
					     title="Date selector"
					/>
				</td>
			</tr>
		</table>
		<script type="text/javascript">
			var $format = "<inp2:m_if check='m_Param' name='calendar_format'><inp2:m_Param name='calendar_format'/><inp2:m_else/><inp2:Format field='{$sort_field}' input_format='1'/></inp2:m_if>";

			Calendar.setup({
		        inputField  : "<inp2:SearchInputName field='$filter_field' filter_type='date_range' type='from' grid='$grid'/>",
		        ifFormat    : Calendar.phpDateFormat($format),
		        button      : "cal_img_<inp2:SearchInputName field='$filter_field' filter_type='date_range' type='from' grid='$grid'/>",
		        align       : 'br',
		        singleClick : true,
		        showsTime   : true,
		        weekNumbers : false,
		        firstDay    : <inp2:m_GetConfig var="FirstDayOfWeek"/>
			});

			Calendar.setup({
		        inputField  : "<inp2:SearchInputName field='$filter_field' filter_type='date_range' type='to' grid='$grid'/>",
		        ifFormat    : Calendar.phpDateFormat($format),
		        button      : "cal_img_<inp2:SearchInputName field='$filter_field' filter_type='date_range' type='to' grid='$grid'/>",
		        align       : 'br',
		        singleClick : true,
		        showsTime   : true,
		        weekNumbers : false,
		        firstDay    : <inp2:m_GetConfig var="FirstDayOfWeek"/>
			});
		</script>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="viewmenu_sort_block">
	$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addMenuItem('<inp2:m_phrase name="$title" js_escape="1"/>','direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:m_param name="sort_field"/>","<inp2:{$PrefixSpecial}_OrderInfo type="direction" pos="1"/>", null, <inp2:m_param name="ajax"/>);','<inp2:m_if check="{$PrefixSpecial}_IsOrder" field="$sort_field" pos="1" >2</inp2:m_if>');
</inp2:m_DefineElement>

<inp2:m_DefineElement name="viewmenu_filter_block">
	$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuItem('<inp2:m_param name="label" js_escape="1"/>','<inp2:m_param name="filter_action"/>','<inp2:m_param name="filter_status"/>');
</inp2:m_DefineElement>

<inp2:m_DefineElement name="viewmenu_filter_separator">
	$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addMenuSeparator();
</inp2:m_DefineElement>

<inp2:m_include template="incs/menu_blocks"/>

<inp2:m_DefineElement name="grid_save_warning">
	<inp2:m_RenderElement design="form_message" pass_params="1">
		<inp2:m_phrase name="la_Warning_Save_Item"/>
    </inp2:m_RenderElement>

	<script type="text/javascript">
		$edit_mode = <inp2:m_if check="m_ParamEquals" name="edit_mode" value="1">true<inp2:m_else />false</inp2:m_if>;
		if (Form) Form.Changed();
//		window.parent.document.title += ' - MODE: ' + ($edit_mode ? 'EDIT' : 'LIVE');
	</script>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_status" pagination="1">
	<table class="grid-status-bar">
		<tr>
			<td nowrap="nowrap" style="vertical-align: middle;">
				<inp2:m_Phrase label="la_Records"/>: <inp2:GridInfo type="filtered"/> (<inp2:GridInfo type="from"/> - <inp2:GridInfo type="to"/>) <inp2:m_Phrase label="la_OutOf"/> <inp2:GridInfo type="total"/>
			</td>
			<td align="right" class="tablenav" valign="middle">
				<inp2:m_if check="m_Param" name="pagination">
					<inp2:m_RenderElement name="grid_pagination_elem" pass_params="1"/>
				</inp2:m_if>
			</td>
		</tr>
	</table>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_column_title" use_phrases="1">
	<table style="width: auto" class="layout-only-table"><tr>
		<td style="vertical-align: middle; padding: 0px">
			<a
				href="javascript:resort_grid('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="sort_field"/>', <inp2:m_param name="ajax"/>);"
				class="columntitle_small"
				title="<inp2:m_Phrase name='la_col_SortBy' no_editing='1' html_escape='1'/> <inp2:m_if check='m_Param' name='use_phrases'><inp2:m_Phrase name='$title' no_editing='1' html_escape='1'/><inp2:m_else/><inp2:m_Param name='title'/></inp2:m_if>">
					<img
						alt="<inp2:m_Phrase name='la_col_SortBy' no_editing='1' html_escape='1'/> <inp2:m_if check='m_Param' name='use_phrases'><inp2:m_Phrase name='$title' no_editing='1' html_escape='1'/><inp2:m_else/><inp2:m_Param name='title'/></inp2:m_if>"
						src="<inp2:m_TemplatesBase/>/img/list_arrow_<inp2:Order field='$sort_field'/>.gif" width="15" height="15" border="0" align="absmiddle"
					/>
			</a>
		</td>
		<td style="vertical-align: middle; text-align: left; padding: 1px; white-space: normal">
			<a
				href="javascript:resort_grid('<inp2:m_param name="PrefixSpecial"/>','<inp2:m_param name="sort_field"/>', <inp2:m_param name="ajax"/>);"
				class="columntitle_small"
				title="<inp2:m_Phrase name='la_col_SortBy' no_editing='1' html_escape='1'/> <inp2:m_if check='m_Param' name='use_phrases'><inp2:m_Phrase name='$title' no_editing='1' html_escape='1'/><inp2:m_else/><inp2:m_Param name='title'/></inp2:m_if>">
				<inp2:m_if check="m_Param" name="use_phrases"><inp2:m_Phrase name="$title"/><inp2:m_else/><inp2:m_Param name="title"/></inp2:m_if>
			</a>
		</td>
	</tr></table>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_selector_icon_html" selector="checkbox">
	<div style="white-space: nowrap;">
		<inp2:m_if check="m_Param" name="selector">
			<input type="<inp2:m_Param name='selector'/>" name="<inp2:InputName field='$IdField' IdField='$IdField'/>" id="<inp2:InputName field='$IdField' IdField='$IdField'/>">
		</inp2:m_if>
		<inp2:ItemIcon name="module" grid="$grid" result_to_var="icon_module"/>
		<img src="<inp2:ModulePath module='$icon_module'/>img/itemicons/<inp2:ItemIcon grid='$grid'/>" width="16" height="16" alt=""/>
	</div>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_selector_html" selector="checkbox">
	<inp2:m_if check="m_Param" name="selector">
		<input type="<inp2:m_Param name='selector'/>" name="<inp2:InputName field='$IdField' IdField='$IdField'/>" id="<inp2:InputName field='$IdField' IdField='$IdField'/>">
	</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_select_all_checkbox_html">
	<input type="checkbox" onclick="Grids['<inp2:m_param name="PrefixSpecial"/>'].InvertSelection(); this.checked=false;" ondblclick="Grids['<inp2:m_param name="PrefixSpecial"/>'].ClearSelection(); this.checked=false;" />
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_column_title_no_sorting" use_phrases="1">
	<inp2:m_if check="m_ParamEquals" name="use_phrases" value="1"><inp2:m_phrase name="$title"/><inp2:m_else/><inp2:m_param name="title"/></inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_js_block" format="" no_special="1" nl2br="" first_chars="" td_style="">
	'<inp2:m_RenderElement name="$block_name" pass_params="1" js_escape="1"/>'<inp2:m_if check="m_Param" name="is_last" inverse="1">,</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_js_empty_filter_block" use_phrases="0">
	'<inp2:m_RenderElement name="grid_empty_filter" pass_params="1" js_escape="1"/>'<inp2:m_if check="m_Param" name="is_last" inverse="1">,</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_js_filter_block" use_phrases="0">
	'<inp2:m_RenderElement name="$filter_block" pass_params="1" js_escape="1"/>'<inp2:m_if check="m_Param" name="is_last" inverse="1">,</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_js_width_td" format="" width="" no_special="1" nl2br="" first_chars="" td_style="">
	<inp2:m_Param name="width" js_escape="1"/><inp2:m_if check="m_Param" name="is_last" inverse="1">,</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid" main_prefix="" per_page="" main_special="" grid_filters="1"
	 search="on"
	 header_block="grid_column_title"
	 filter_block="grid_column_filter"
	 data_block="grid_data_td"
	 total_block="grid_total_td"
	 row_block="_row"
	 ajax="0"
	 totals="0"
	 limited_heights="false"
	 max_row_height="45"
	 grid_height="auto"
	 selector="checkbox"
	 grid_status="1"
	 totals_render_as=""
	 >
<!--##
	grid_filters - show individual filters for each column
	has_filters  - draw filter section in "View" menu in toolbar
##-->

	<inp2:InitList pass_params="1"/> <!--## this is to avoid recalling prefix as an item in first iterate grid, by col-picker for instance ##-->

	<inp2:{$PrefixSpecial}_SaveWarning name="grid_save_warning" pass_params="1"/>
	<inp2:m_if check="{$PrefixSpecial}_SearchActive" grid="$grid">
		<inp2:m_RenderElement design="form_message" pass_params="1">
			<inp2:m_phrase name="la_Warning_Filter"/>
		</inp2:m_RenderElement>
	</inp2:m_if>

	<div id="grid_<inp2:m_Param name='PrefixSpecial'/>_container"></div>

	<inp2:m_if check="m_Param" name="grid_status">
		<inp2:m_RenderElement name="grid_status" grid="$grid" PrefixSpecial="$PrefixSpecial" main_special="$main_special" search="$search" ajax="$ajax"/>
	</inp2:m_if>

	<inp2:m_if check="m_ParamEquals" name="ajax" value="0">
		<inp2:m_if check="m_GetEquals" name="fw_menu_included" value="">
			<link rel="stylesheet" rev="stylesheet" href="<inp2:m_Compress files='incs/nlsmenu.css'/>" type="text/css" />
			<script type="text/javascript" src="<inp2:m_Compress files='js/nlsmenu.js|js/nlsmenueffect_1_2_1.js'/>"></script>

			<script type="text/javascript">
				var menuMgr = new NlsMenuManager("mgr");
				menuMgr.timeout = 500;
				menuMgr.flowOverFormElement = true;
			</script>

			<inp2:m_set fw_menu_included="1"/>
		</inp2:m_if>

		<script type="text/javascript">
			<inp2:m_RenderElement name="grid_js" mouseover_class="grid-data-row-mouseover" selected_class="grid-data-row-selected:grid-data-row-even-selected" tag_name="tr" pass_params="true"/>
		</script>
	</inp2:m_if>

	<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1" name="<inp2:m_param name="PrefixSpecial"/>_Sort1" value="">
	<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" name="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" value="asc">
</inp2:m_DefineElement>

<inp2:m_DefineElement name="default_sorting_element" ajax="0">
	<div style="text-align: center;">
		<a href="#" onclick="reset_sorting('<inp2:m_Param name="prefix"/>', <inp2:m_param name="ajax"/>); return false;" title="<inp2:m_phrase name="la_col_ResetToDefaultSorting" html_escape="1"/>">
			<img src="<inp2:m_TemplatesBase/>/img/list_arrow_<inp2:m_if check='{$prefix}_OrderChanged'>no<inp2:m_else/>desc</inp2:m_if>_big.gif" width="16" height="16" alt="<inp2:m_phrase name="la_col_ResetToDefaultSorting" html_escape="1"/>"/>
		</a>
	</div>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_total_row">
	GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].SetFooter(
		[
			['&nbsp;', <inp2:IterateGridFields grid="$grid" mode="total" force_block="grid_js_block" ajax="$ajax" pass_params="1"/>]
		]
	);
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_js"
	main_prefix="" per_page="" main_special="" grid_filters="1"
	header_block="grid_column_title"
	filter_block="grid_column_filter"
	data_block="grid_data_td"
	total_block="grid_total_td"
	row_block="_row"
	ajax="0"
	totals="0"
	limited_heights="false"
	max_row_height="45"
	grid_height="auto"
	grid_status="1" ajax="1"
	totals_render_as=""
	selector="checkbox"
	mouseover_class="grid-data-row-mouseover" selected_class="grid-data-row-selected:grid-data-row-even-selected" tag_name="tr"
>
		<inp2:GridSelector grid="$grid" default="$selector" result_to_var="selector"/>

		// 1. create grid
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'] = new GridScroller('grid_<inp2:m_Param name="PrefixSpecial" />', 'auto', <inp2:m_if check="m_Param" name="grid_height" equals_to="auto">'<inp2:m_Param name="grid_height"/>'<inp2:m_else/><inp2:m_Param name="grid_height"/></inp2:m_if>);
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].Spacer = 'img/spacer.gif';
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].LeftCells = <inp2:FreezerPosition grid="$grid"/>;
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].BottomOffset = <inp2:m_if check="m_Param" name="grid_status">30<inp2:m_else/>0</inp2:m_if>;
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].MinWidths = [<inp2:GridSelectorColumnWidth selector="$selector" icon_width="20" selector_width="30" grid="$grid"/>, <inp2:IterateGridFields grid="$grid" mode="width" block="grid_js_width_td" ajax="$ajax"/>];
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].PickerCRC = '<inp2:PickerCRC grid="$grid"/>';
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].LimitedHeights = <inp2:m_param name="limited_heights"/>;
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].MaxRowHeight = <inp2:m_param name="max_row_height"/>;
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].SetHeader(
			[
				[' <inp2:m_RenderElement name="default_sorting_element" prefix="$PrefixSpecial" ajax="$ajax" js_escape="1" strip_nl="2"/>', <inp2:IterateGridFields grid="$grid" mode="header" force_block="grid_js_block" ajax="$ajax" pass_params="1"/>],
				['<inp2:m_if check="m_Param" name="selector" equals_to="checkbox"><inp2:m_RenderElement name="grid_select_all_checkbox_html" pass_params="1" js_escape="1"/><inp2:m_else/>&nbsp;</inp2:m_if>',
					<inp2:m_if check="m_Param" name="grid_filters">
						<inp2:IterateGridFields grid="$grid" mode="filter" force_block="grid_js_filter_block" ajax="$ajax" pass_params="1"/>
					<inp2:m_else/>
						<inp2:IterateGridFields grid="$grid" mode="filter" force_block="grid_js_empty_filter_block" ajax="$ajax" pass_params="1"/>
					</inp2:m_if>
				]
			]
		)
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].FieldNames = ['_CheckboxColumn', <inp2:IterateGridFields grid="$grid" mode="fields"/>];
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].SetData(
			[
				<inp2:m_DefineElement name="js_row" td_style="" row_class_render_as="" selector_render_as="grid_selector_html" row_class="">
					{ 'row_class': '<inp2:m_if check="m_Param" name="row_class_render_as"><inp2:m_RenderElement name="$row_class_render_as" PrefixSpecial="$PrefixSpecial" trim="1"/><inp2:m_else/><inp2:m_Param name="row_class"/></inp2:m_if>',
						'data': ['<inp2:m_RenderElement name="$selector_render_as" pass_params="1" js_escape="1"/>',<inp2:IterateGridFields grid="$grid" mode="data" force_block="grid_js_block" pass_params="1"/>]
					}<inp2:m_if check="m_Param" name="is_last" inverse="1">,</inp2:m_if>
				</inp2:m_DefineElement>
				<inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table-color1"/>

				<inp2:m_if check="UseItemIcons" grid="$grid">
					<inp2:PrintList block="js_row" selector_render_as="grid_selector_icon_html" per_page="$per_page" main_special="$main_special" selector="$selector" id_field="$IdField" grid="$grid"/>
				<inp2:m_else/>
					<inp2:PrintList block="js_row" selector_render_as="grid_selector_html" per_page="$per_page" main_special="$main_special" selector="$selector" id_field="$IdField" grid="$grid"/>
				</inp2:m_if>
			]
		)
		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].IDs = [
			<inp2:m_DefineElement name="js_id">
				'<inp2:m_param name="PrefixSpecial"/>_<inp2:Field field="$IdField"/>'<inp2:m_if check="m_Param" name="is_last" inverse="1">,</inp2:m_if>
			</inp2:m_DefineElement>
			<inp2:PrintList block="js_id" per_page="$per_page" id_field="$IdField" main_special="$main_special"/>
		]

		<inp2:m_if check="m_Param" name="totals_render_as">
			<inp2:m_RenderElement name="$totals_render_as" pass_params="1"/>
		</inp2:m_if>

		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].Render('grid_<inp2:m_Param name="PrefixSpecial" />_container');

		<inp2:m_ifnot check="m_Param" name="ajax">
			<inp2:m_RenderElement name="grid_search_buttons" pass_params="1"/>
		</inp2:m_ifnot>

		GridScrollers['<inp2:m_param name="PrefixSpecial"/>'].SaveURL = '<inp2:m_t pass="m,$PrefixSpecial" {$PrefixSpecial}_event="OnSaveWidths" widths="#WIDTHS#" no_amp="1" grid_name="$grid"/>';

		<inp2:m_if check="m_Param" name="selector">
			// 2. scan grid (only when using selector)
			Grids['<inp2:m_param name="PrefixSpecial"/>'] = new Grid('<inp2:m_param name="PrefixSpecial"/>', '<inp2:m_param name="selected_class"/>', ':original', ($allow_dbl_click === undefined || $allow_dbl_click ? edit : function() {}) , a_toolbar);

			Grids['<inp2:m_param name="PrefixSpecial"/>'].MouseOverClass = '<inp2:m_param name="mouseover_class"/>';
			Grids['<inp2:m_param name="PrefixSpecial"/>'].StickySelection = true;
			Grids['<inp2:m_param name="PrefixSpecial"/>'].AddItemsByIdMask('<inp2:m_param name="tag_name"/>', /^<inp2:m_param name="PrefixSpecial"/>_([\d\w-=]+)/, '<inp2:m_param name="PrefixSpecial"/>[$$ID$$][<inp2:m_param name="IdField"/>]');
	  		Grids['<inp2:m_param name="PrefixSpecial"/>'].InitItems();

	  		<inp2:m_if check="m_Param" name="selector" equals_to="radio">
		  		Grids['<inp2:m_param name="PrefixSpecial"/>'].EnableRadioMode();
			</inp2:m_if>

	  		<inp2:m_if check="{$PrefixSpecial}_UseAutoRefresh">
	  			function refresh_grid() {
	  				// window.location.reload();
	  				var $window_url = window.location.href;
	  				if ($window_url.indexOf('skip_session_refresh=1') == -1) {
	  					$window_url += '&skip_session_refresh=1';
	  				}

	  				window.location.href = $window_url;
	  			}

	  			setTimeout('refresh_grid()', <inp2:{$PrefixSpecial}_AutoRefreshInterval/> * 60000);
	  		</inp2:m_if>
  		</inp2:m_if>

  		<inp2:m_RenderElement name="nlsmenu_declaration" pass_params="true"/>

  		$ViewMenus = new Array('<inp2:m_param name="PrefixSpecial"/>');
</inp2:m_DefineElement>

<inp2:m_DefineElement name="old_grid" main_prefix="" per_page="" main_special="" grid_filters="" search="on" header_block="grid_column_title" filter_block="grid_column_filter" data_block="grid_data_td" total_block="grid_total_td" row_block="_row" ajax="0" totals="0" selector="checkbox">
<!--##
	DEPRICATED. LEFT FOR EDUCATION PURPOSES.

	grid_filters - show individual filters for each column
	has_filters  - draw filter section in "View" menu in toolbar
##-->

	<inp2:InitList pass_params="1"/> <!--## this is to avoid recalling prefix as an item in first iterate grid, by col-picker for instance ##-->

	<inp2:GridSelector grid="$grid" default="$selector" result_to_var="selector"/>

	<inp2:{$PrefixSpecial}_SaveWarning name="grid_save_warning" main_prefix="$main_prefix"/>
	<inp2:m_if check="{$PrefixSpecial}_SearchActive" grid="$grid">
		<inp2:m_RenderElement design="form_message" pass_params="1">
	    	<inp2:m_phrase name="la_Warning_Filter"/>
		</inp2:m_RenderElement>
	</inp2:m_if>

	<inp2:m_if check="m_ParamEquals" name="per_page" value="-1" inverse="1">
		<inp2:m_RenderElement name="grid_pagination" grid="$grid" PrefixSpecial="$PrefixSpecial" main_special="$main_special" search="$search" ajax="$ajax"/>
	</inp2:m_if>
	<table width="100%" cellspacing="0" cellpadding="4" class="bordered">

		<inp2:m_if check="m_ParamEquals" name="grid_filters" value="1">
			<tr class="pagination_bar">
				<inp2:{$PrefixSpecial}_IterateGridFields grid="$grid" mode="filter" block="$filter_block" ajax="$ajax" pass_params="1"/>
			</tr>
		</inp2:m_if>

		<tr class="grid-header-row grid-header-row-1">
			<inp2:{$PrefixSpecial}_IterateGridFields grid="$grid" mode="header" block="$header_block" ajax="$ajax" pass_params="1"/>
		</tr>

		<inp2:m_DefineElement name="_row" td_style="">
			<tr class="<inp2:m_odd_even odd="grid-data-row grid-data-row-even" even="grid-data-row"/>" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:Field field="$IdField"/>" sequence="<inp2:m_get param="{$PrefixSpecial}_sequence"/>"><inp2:m_inc param="{$PrefixSpecial}_sequence" by="1"/>
				<inp2:IterateGridFields grid="$grid" mode="data" block="$data_block" pass_params="1"/>
			</tr>
		</inp2:m_DefineElement>
		<inp2:m_set {$PrefixSpecial}_sequence="1" odd_even="table-color1"/>
		<inp2:{$PrefixSpecial}_PrintList block="$row_block" per_page="$per_page" main_special="$main_special" />

		<inp2:m_DefineElement name="grid_total_td">
			<inp2:m_if check="m_Param" name="total">
				<td style="<inp2:m_param name="td_style"/>">
					<inp2:FieldTotal name="$field" function="$total"/>
				</td>
			<inp2:m_else/>
				<td style="<inp2:m_param name="td_style"/>">&nbsp;</td>
			</inp2:m_if>
		</inp2:m_DefineElement>

		<inp2:m_if check="m_ParamEquals" name="totals" value="1">
			<tr class="totals-row"/>
				<inp2:IterateGridFields grid="$grid" mode="data" block="$total_block" pass_params="1"/>
			</tr>
		</inp2:m_if>
	</table>

	<inp2:m_if check="m_ParamEquals" name="ajax" value="0">
		<inp2:m_if check="m_GetEquals" name="fw_menu_included" value="">
			<link rel="stylesheet" rev="stylesheet" href="<inp2:m_Compress files='incs/nlsmenu.css'/>" type="text/css" />
			<script type="text/javascript" src="<inp2:m_Compress files='js/nlsmenu.js|js/nlsmenueffect_1_2_1.js'/>"></script>

			<script type="text/javascript">
				var menuMgr = new NlsMenuManager("mgr");
				menuMgr.timeout = 500;
				menuMgr.flowOverFormElement = true;
			</script>

			<inp2:m_set fw_menu_included="1"/>
		</inp2:m_if>

		<script type="text/javascript">
			<inp2:m_RenderElement name="old_grid_js" mouseover_class="grid-data-row-mouseover" selected_class="grid-data-row-selected:grid-data-row-even-selected" tag_name="tr" pass_params="true"/>
		</script>
	</inp2:m_if>

	<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1" name="<inp2:m_param name="PrefixSpecial"/>_Sort1" value="">
	<input type="hidden" id="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" name="<inp2:m_param name="PrefixSpecial"/>_Sort1_Dir" value="asc">
</inp2:m_DefineElement>

<inp2:m_DefineElement name="old_grid_js" selector="checkbox" ajax="1">
	<!--## DEPRICATED. LEFT FOR EDUCATION PURPOSES. ##-->
	<inp2:GridSelector grid="$grid" default="$selector" result_to_var="selector"/>

	<inp2:m_if check="m_Param" name="selector">
		Grids['<inp2:m_param name="PrefixSpecial"/>'] = new Grid('<inp2:m_param name="PrefixSpecial"/>', 'grid-data-row-selected:grid-data-row-even-selected', ':original', edit, a_toolbar);

		Grids['<inp2:m_param name="PrefixSpecial"/>'].MouseOverClass = 'grid-data-row-mouseover';
		Grids['<inp2:m_param name="PrefixSpecial"/>'].StickySelection = true;
		Grids['<inp2:m_param name="PrefixSpecial"/>'].AddItemsByIdMask('<inp2:m_param name="tag_name"/>', /^<inp2:m_param name="PrefixSpecial"/>_([\d\w-]+)/, '<inp2:m_param name="PrefixSpecial"/>[$$ID$$][<inp2:m_param name="IdField"/>]');
  		Grids['<inp2:m_param name="PrefixSpecial"/>'].InitItems();

  		<inp2:m_if check="m_Param" name="selector" equals_to="radio">
	  		Grids['<inp2:m_param name="PrefixSpecial"/>'].EnableRadioMode();
		</inp2:m_if>
	</inp2:m_if>

	<inp2:m_RenderElement name="nlsmenu_declaration" pass_params="true"/>

	$ViewMenus = new Array('<inp2:m_param name="PrefixSpecial"/>');
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_ml_selector">
	<inp2:m_if check="lang_IsMultiLanguage">
		<inp2:m_phrase name="la_fld_Language"/>:
		<select name="language" onchange="submit_event('<inp2:m_param name='prefix'/>', 'OnPreSaveAndChangeLanguage');">
			<inp2:m_DefineElement name="lang_elem">
				<option value="<inp2:Field name='LanguageId'/>" <inp2:m_if check="SelectedLanguage" type="data">selected="selected"</inp2:m_if> ><inp2:Field name="LocalName" no_special='no_special' /></option>
			</inp2:m_DefineElement>
			<inp2:lang_PrintList render_as="lang_elem"/>
		</select>
	<inp2:m_else/>
		<inp2:m_if check="m_Param" name="pagination">
			<inp2:$prefix_SelectParam possible_names="pagination_prefix,prefix" result_to_var="pagination_prefix"/>
			<inp2:m_RenderElement name="grid_pagination_elem" PrefixSpecial="$pagination_prefix" pass_params="1"/>
		</inp2:m_if>
	</inp2:m_if>
</inp2:m_DefineElement>