{if !$ajax}
	{include file="$admingentemplates/admin_top.tpl"}
	<div class="back">
		<a href="./{$form.file_name}?sel=subcat&id_category={$category[0].id_category}">{$lang.button.back}</a>
	</div>
	<font class=red_header>{$header.razdel_name}</font>
	<div style="height:50px;">&nbsp;</div>
	<div class="show_help" style="display: none;">&nbsp;</div>
	<div class="help_text" style="padding:5px;">
		<div class="close_help">
		  <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
		</div>
		<span class="help_title">{$lang.help}:</span>{$help.gs_item}
	</div>
	<div id="tooltip" onclick="hideToolTip()" style="text-align:center; background-color: #FFFFFF; border: 1px dotted; text-align: {$default_left}; position:absolute; display:none; padding:5px;"></div>
	{literal}
	<script type="text/javascript">
		$(function() {
			$('#tool_tip_4 *').tooltip();
		});
	</script>
	{/literal}
	<font class=red_sub_header style="color: #208B2F;">{$header.item_list}</font>
	<div class="cr">&nbsp;</div>
				<font class="main_header_text"><b>{$header.subcategory}:</b></font>&nbsp;
				<select name="id_category" onchange="javascript:location.href='./{$form.file_name}?sel=items&id_subcat='+this.value+'&id_category='+{$id_category};">
				{section name=s loop=$category}
					<option value="{$category[s].id}" {if $parent.id eq $category[s].id}selected{/if}>{$category[s].name}</option>
				{/section}
				</select>
				<br><br>
	<div class="cr">&nbsp;</div>
	<ul class="tabs">
		<li>
			<a class="current">{$lang.admin_menu.giftshop_catalog}</a>
		</li>
		<li>
			<a href="admin_giftshop.php?sel=orders">{$lang.admin_menu.giftshop_orders}</a>
		</li>
	</ul>
			<div class="user_operation_line">
				<div onclick="javascript: location.href='{$form.add_link}'" class="uol_item">
					<div class="uol_in_item">{$header.item_add}</div>
				</div>
			</div><br><br><br><br>
			<div id="giftshop_items_table_div">
{/if}
					<table border=0 class="" cellspacing=0 cellpadding=5 width="100%">
						<tr class="table_header" style="background:#29B43D;">
							<td class="main_header_text" align="left" width="20">{$header.number}</td>
							<td class="main_header_text" align="left">&nbsp;</td>
							<td class="main_header_text" align="left" width="150">{$header.name}</td>
							<td class="main_header_text" align="left">{$header.comment}</td>
							<td class="main_header_text" align="left">{$header.price}</td>
							<td class="main_header_text" align="left">{$header.status}</td>
							<td class="main_header_text" align="right" width="100">{$lang.button.action}</td>
						</tr>
						{if $items}
							{section name=spr loop=$items}
								<tr {if not $items[spr].number is div by 2}class="odd"{else}class="even"{/if}>
									<td style="padding:5px 10px;" valign="top" class="main_content_text" align="left">{$items[spr].number}</td>
									<td style="padding:5px 10px;" valign="top" class="main_content_text" align="left">{if $items[spr].thumb_icon_path}<img src="{$items[spr].thumb_icon_path}" border=1>{else}&nbsp;{/if}</td>
									<td style="padding:5px 10px;" valign="top" class="main_content_text" align="left"><a href="./{$form.file_name}?sel=itemsedit&id={$items[spr].id}&id_subcat={$parent.id}&id_category={$parent.id_category}&page={$form.page}">{$items[spr].name}</a></td>
									<td style="padding:5px 10px;" valign="top" class="main_content_text" align="left">{$items[spr].comment}</td>
									<td style="padding:5px 10px;" valign="top" class="main_content_text" align="left">{$items[spr].price}&nbsp;{$form.curency}</td>
									<td style="padding:5px 10px;" valign="top" class="main_content_text" align="left">{$items[spr].status}</td>
									<td style="padding:5px 10px;" valign="top" class="main_content_text" align="right">
										<div class="block_action fr" style="display: none;">
											<div class="action_del" style="display: block;cursor:pointer;">				
												<img width="16" alt="" src="{$site_root}{$template_root}/images/photo_delete.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false" onclick="javascript: document.location.href='./{$form.file_name}?sel=itemsdel&id={$items[spr].id}&id_subcat={$parent.id}&id_category={$id_category}&page={$form.page}'">
											</div>
										</div>
										<div style="width:10px;float:right;" class="fl">&nbsp;</div>
										<div class="block_action fr" style="display: none;">
											<div class="action_edit" style="display: block;cursor:pointer;">
												<img width="16" alt="" src="{$site_root}{$template_root}/images/edit.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.edit}');return false" onclick="javascript:location.href='./{$form.file_name}?sel=itemsedit&id={$items[spr].id}&id_subcat={$parent.id}&id_category={$parent.id_category}&page={$form.page}'">
											</div>
										</div>
									</td>
								</tr>
							{/section}
						{else}
							<tr height="40">
								<td class="main_error_text" align="left" colspan="7" bgcolor="#FFFFFF">{$header.category_empty}</td>
							</tr>
						{/if}
						<tr class="table_header">
							<td colspan="7">
								&nbsp;&nbsp;
								{if $links}
								{foreach item=item from=$links.pages}
									&nbsp;<a onclick="PageList('giftshop_items_table_div', '{$item.link}');" class="page_link" {if $item.selected} style=" font-weight: bold; text-decoration: none;" {/if}>{$item.name}</a>&nbsp;
								{/foreach}
								{/if}
								<div class="page_navigation">
								{if $links.previous}
									<a onclick="PageList('giftshop_items_table_div', '{$links.previous}');">< {$lang.content.previous} {$per_page}</a>
								{/if}
								{if $links.next}
									<a onclick="PageList('giftshop_items_table_div', '{$links.next}');">{$lang.content.next} {$per_page} ></a>
								{/if}
								</div>
							</td>
						</tr>					
						</table>
{if !$ajax}
			</div>
	<script type="text/javascript">
	{literal}
			function PageList(id_div, par) {
				ajaxLoadingImage(1, 'giftshop_items_table_div');
				$.post("admin_giftshop.php", par, function(data){
					ajaxLoadingImage(0, 'giftshop_items_table_div');
					$('#giftshop_items_table_div').html(data);
				});
			}

			function showToolTip(e,text){
				if(document.all)e = event;
				var obj = document.getElementById('tooltip');
				obj.innerHTML = text;
				obj.style.display = 'block';
				var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
				if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
				var leftPos = e.clientX - $('#tooltip').width()-10;
				if(leftPos<0)leftPos = 0;
				obj.style.left = leftPos + 'px';
				obj.style.top = e.clientY - obj.offsetHeight -10 + st + 'px';
			}
			function hideToolTip(){
				document.getElementById('tooltip').style.display = 'none';
			}
	{/literal}
	</script>
		<!-- /main spr row -->
	{include file="$admingentemplates/admin_bottom.tpl"}
{/if}