<inp2:m_DefineElement name="top_catalog_tab">
	<input type="radio" name="top_catalog_tab" id="<inp2:m_Param name='id'/>"<inp2:m_if check="m_IsActive" template="$template"> checked="checked"</inp2:m_if>/> <label for="<inp2:m_Param name='id'/>"><a href="<inp2:m_Link template='$template' pass='all'/>"><inp2:m_Phrase name="$label"/></a></label>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="top_catalog_tab2" is_last="0">
	<inp2:m_if check="m_IsActive" template="$template">
		<td class="button-active" style="padding-right: 5px;">

		</td>
		<td class="button-active">
			<img src="<inp2:m_TemplatesBase/>/img/top_frame/icons/<inp2:m_Param name='image'/>.png" alt="" border="0"/>&nbsp;
		</td>
		<td class="button-active" style="padding-right: 5px;<inp2:m_ifnot check='m_Param' name='is_last'> border-right: 1px solid #BBBBBB;</inp2:m_ifnot>">
			<strong><inp2:m_Phrase name="$label"/></strong>
		</td>
	<inp2:m_else/>
		<inp2:c_HomeCategory result_to_var="home_category"/>
		<td style="padding-right: 5px; height: 22px;">

		</td>
		<td>
			<a class="kx-header-link" href="<inp2:m_Link template='$template' m_cat_id='$home_category'/>" onclick="getFrame('main').location.href = this.href; return false;">
				<img src="<inp2:m_TemplatesBase/>/img/top_frame/icons/<inp2:m_Param name='image'/>.png" alt="" border="0"/>
			</a>&nbsp;
		</td>
		<td style="padding-right: 5px;<inp2:m_ifnot check='m_Param' name='is_last'> border-right: 1px solid #BBBBBB;</inp2:m_ifnot>">
			<a class="kx-header-link" href="<inp2:m_Link template='$template' m_cat_id='$home_category'/>" onclick="getFrame('main').location.href = this.href; return false;"><inp2:m_Phrase name="$label"/></a>
		</td>
	</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="mode_selector_radio">
	<td>
		<img src="img/spacer.gif" height="8" width="1" alt=""/>
		<div style="background-color: #F6F6F6; border: 1px solid #999999; padding: 5px; float: left;">
			<inp2:m_RenderElement name="top_catalog_tab" id="tab2" label="la_tab_ShowAll" template="catalog/item_selector/item_selector_advanced_view"/>
			<inp2:m_RenderElement name="top_catalog_tab" id="tab1" label="la_tab_ShowStructure" template="catalog/item_selector/item_selector_catalog"/>
		</div>
		<br clear="all"/>
		<img src="img/spacer.gif" height="8" width="1" alt=""/>
	</td>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="mode_selector">
	<td align="right">
		<div style="background-color: #F6F6F6; border: 1px solid #999999; padding: 5px; float: right;">
			<inp2:m_RenderElement name="top_catalog_tab" id="tab2" label="la_tab_ShowAll" template="catalog/advanced_view"/>
			<inp2:m_RenderElement name="top_catalog_tab" id="tab1" label="la_tab_ShowStructure" template="catalog/catalog"/>
		</div>
	</td>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="catalog_search_box">
	<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="search_keyword"
							class="filter"
							name="search_keyword"
							value=""
							PrefixSpecial=""
							Grid=""
							ajax="1"
							onkeydown="searchKeydown(event);" style="width:150px;"/>
						<input type="text" style="display: none;"/>
					</td>
					<td style="white-space: nowrap;">
						<script type="text/javascript">
							function searchKeydown(event) {
								$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
								set_hidden_field($Catalog.ActivePrefix + '_search_keyword', document.getElementById('search_keyword').value);
								search_keydown(event, $Catalog.ActivePrefix, $Catalog.searchInfo[$Catalog.ActivePrefix].grid, 1);
							}

							b_toolbar = new ToolBar();

							b_toolbar.AddButton( new ToolBarButton('search', '<inp2:m_phrase label="la_ToolTip_Search" escape="1"/>',
									function() {
										$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';
										set_hidden_field($Catalog.ActivePrefix + '_search_keyword', document.getElementById('search_keyword').value);
										search($Catalog.ActivePrefix, $Catalog.searchInfo[$Catalog.ActivePrefix].grid, 1);
									} ) );

							b_toolbar.AddButton( new ToolBarButton('search_reset_alt', '<inp2:m_phrase label="la_ToolTip_SearchReset" escape="1"/>',
									function() {
										$form_name = $Catalog.queryTabRegistry('prefix', $Catalog.ActivePrefix, 'tab_id') + '_form';

										set_hidden_field($Catalog.ActivePrefix + '_search_keyword', document.getElementById('search_keyword').value);
										search_reset($Catalog.ActivePrefix, $Catalog.searchInfo[$Catalog.ActivePrefix].grid, 1);
									} ) );

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

<inp2:m_DefineElement name="extra_toolbar">
	<table cellpadding="0" cellspacing="0">
		<tr>
			<inp2:m_RenderElement name="top_catalog_tab2" image="show_all" label="la_tab_ShowAll" template="catalog/advanced_view" strip_nl="2"/>
			<inp2:m_RenderElement name="top_catalog_tab2" image="show_structure" label="la_tab_ShowStructure" template="catalog/catalog" strip_nl="2" is_last="1"/>
		</tr>
	</table>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="theme_selector">
	<inp2:m_ifnot check="theme.enabled_TotalRecords" equals_to="0|1">
		<inp2:m_Phrase label="lu_CurrentTheme"/>:
		<select name="theme" id="theme" onchange="onChangeTheme();">
			<inp2:m_DefineElement name="theme_elem">
				<option value="<inp2:Field name="ThemeId"/>" <inp2:m_if check="SelectedTheme">selected="selected"</inp2:m_if> ><inp2:Field name="Name"/></option>
			</inp2:m_DefineElement>

			<inp2:theme.enabled_PrintList render_as="theme_elem"/>
		</select>

		<script type="text/javascript">
			function onChangeTheme() {
				set_hidden_field('theme', $('#theme').val());
				submit_event('theme', 'OnChangeTheme');
			}
		</script>
	</inp2:m_ifnot>
</inp2:m_DefineElement>