{strip}
{if $ajax eq 0}
{include file="$admingentemplates/admin_top.tpl"}
<!--<script type="text/javascript">
    var GB_ROOT_DIR = "{$site_root}{$template_root}/js/greybox/";
</script>
<script type="text/javascript" src="{$site_root}{$template_root}/js/greybox/AJS.js"></script>
<script type="text/javascript" src="{$site_root}{$template_root}/js/greybox/AJS_fx.js"></script>
<script type="text/javascript" src="{$site_root}{$template_root}/js/greybox/gb_scripts.js"></script>
<link href="{$site_root}{$template_root}/js/greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />-->

<link href="{$site_root}{$template_root}/greybox/greybox.css" rel="stylesheet" type="text/css" media="all">
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/AmiJS.js"></script>
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/greybox.js"></script>
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/images.js"></script>

<script language="JavaScript" type="text/javascript">
	var GB_IMG_DIR = "{$site_root}{$template_root}/greybox/";
</script>

<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.cards.admin.cards_list}{$lang.cards.admin.in}{$form.subcategory_name}</div>
<div class="cr">&nbsp;</div>
<div class="cr">&nbsp;</div>
<div class="help_text" style="display:block;">
    <div class="close_help">
        <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
    </div>
    <div class="help_body">
        <span class="help_title">{$lang.help}:</span>{$lang.admin_help.cards_items_list}
    </div>
</div>

<ul class="tabs">
    <li>
        <a {if $info.active == "catalog"} class="current" {else} href="admin_cards.php"  {/if}>{$lang.admin_menu.ecards_catalog} </a>
    </li>
    <li>
        <a {if $info.active == "orders"} class="current" {else} href="admin_cards.php?sel=orders" {/if}>{$lang.admin_menu.ecards_orders}</a>
    </li>
    <li>
        <a {if $info.active == "song"} class="current" {else} href="admin_cards.php?sel=settings_songs" {/if}>{$lang.admin_menu.ecards_songs}</a>
    </li>     
</ul>
<div class="user_operation_line">
            <div class="uol_item" >
				<div class="uol_in_item" onclick="javascript: window.location.href='{$form.add_link}'">{$lang.cards.admin.add_card}</div>
            </div>            
              <div class="uol_item">
                    <div class="uol_in_item2" style="position:relative;width: 100%">
                        <div class="select_box_option" id="cat" style="text-align: center; border: 0;width:100%; position: relative;margin-left: -15px;">
                            {$lang.cards.admin.jump_to_category}
                            <div class="option_box" id="active_themes" style="position: absolute;width:100%; top:20px; left:0;">
        	                    {foreach from=$categories item=item}
        	                        <div class='option_box_item' style="width:100%;">
        	                            <div class='option_box_item_box' id='{$item.id}' onclick="document.location.href='admin_cards.php?sel=subcategories&id_category='+{$item.id}">
        	                                <div style='width:82%;float:left;'>{$item.name}</div>	 
                                             <div class='theme_list' id='active_{$item.name}' style='width:10%;float:left;{if $item.sel eq 1}display:block{else}display:none{/if};'>
                                                <img width="16" alt="" src="{$site_root}{$template_root}/images/success.png"> 
                                            </div>                              
        	                                <div class="cr"></div>
        	                            </div>
        	                        </div>
        	                    {/foreach}
        	                    <!--div id='bottom_corner' style='height:5px;'></div-->
        	                </div>
                        </div>
                        
                    </div>
                </div>   
                <div class="uol_item">
                    <div class="uol_in_item2" style="position:relative;width: 100%">
                        <div class="select_box_option" id="sub" style="text-align: center; border: 0;width:100%; position: relative;margin-left: -15px;">
                            {$lang.cards.admin.jump_to_subcategory}
                            <div class="option_box" id="active_themes_s" style="position: absolute;width:100%; top:20px; left:0;">
        	                    {foreach from=$subcategories item=item}
        	                        <div class='option_box_item' style="width:100%;">
        	                            <div class='option_box_item_box' id='{$item.id}' onclick="document.location.href='admin_cards.php?sel=items&id_category={$form.id_category}&id_subcategory='+{$item.id};">
        	                                <div style='width:82%;float:left;'>{$item.name}</div>
                                            <div class='theme_list' id='active_{$item.name}' style='width:10%;float:left;{if $item.sel eq 1}display:block{else}display:none{/if};'>
                                                <img width="16" alt="" src="{$site_root}{$template_root}/images/success.png"> 
                                            </div>   
        	                                <div class="cr"></div>
        	                            </div>
        	                        </div>
        	                    {/foreach}
        	                    <!--div id='bottom_corner' style='height:5px;'></div-->
        	                </div>
                        </div>
                        
                    </div>
                </div>                         
</div>
<div class="cr"></div>

<div>
{/if}
	<div id="items" style="padding-top: 10px;">
<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}
	<table border=0 cellspacing=0 cellpadding=0 width="100%">
	{if $cards}		
		<tr class="table_header">
			<td >{$lang.cards.admin.cards_list}</td>
			<td width="80"align="center">{$lang.cards.admin.card_price}</td>
			<td width="50"align="center">{$lang.cards.admin.card_status}</td>
			<td width="120" align="center">{$lang.ecards.picture}</td>
			<td width="240" align="right">{$lang.users.actions}</td>
		</tr>
		{foreach name=t item=item from=$cards}
		<tr {if $smarty.foreach.t.iteration mod 2 eq 0}class="even"{else}class="odd"{/if}>
			<td class="main_content_text"  valign="top">{$item.name}</td>
			<td class="main_content_text" align="center"  valign="top">{$item.card_price}</td>
			<td class="main_content_text" align="center"  valign="top">{if $item.card_status eq 1}+{else}-{/if}</td>
			<td class="main_content_text"  valign="top" style="padding-top:5px;padding-bottom:5px;">
				<a href="#" onclick="return GB_showImage('{$item.name_unslashed}', '{$item.card_image_big}')">
					<img src="{$item.card_image}" height="100" width="100" style="border: 1px solid #cccccc;">
				</a>
			</td>
			<td class="main_content_text"  valign="top">
{*				<a href="{$item.editlink}">{$lang.button.edit}</a>
				&nbsp;&nbsp;|&nbsp;&nbsp;
				<a href="#" onclick="if(confirm('{$lang.cards.admin.confirm_card|escape:javascript}')){literal}{{/literal}document.location.href='{$item.deletelink}'{literal}}{/literal} else return false;">{$lang.button.delete}</a>*}
					<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: if(confirm('{$lang.cards.admin.confirm_card|escape:javascript}')){literal}{{/literal}document.location.href='{$item.deletelink}'{literal}}{/literal} else return false;">
						</div>
					</div>			
					<div style="width:10px;float:right;" class="fl">&nbsp;</div>
					<div class="block_action fr" style="display: none;cursor:pointer;">
						<div class="action_edit" style="display: block;">
							<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="document.location.href='{$item.editlink}'">
						</div>
					</div>			
			</td>
		</tr>
		{foreachelse}
			<tr height="40">
				<td class="main_error_text" align="left" colspan="11">{$lang.interests_spr.empty}</td>
			</tr>
		{/foreach}
		<tr class="table_header">
            <td colspan="11">
                &nbsp;&nbsp;
                {if $links}
                {foreach item=item from=$links.pages}
                    &nbsp;<a onclick="PageList('bad_words', '{$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('bad_words', '{$links.previous}');">< {$lang.content.previous} {$per_page}</a>
                {/if}
                {if $links.next}
                    <a onclick="PageList('bad_words', '{$links.next}');">{$lang.content.next} {$per_page} ></a>
                {/if}
                </div>
            </td>
        </tr>
	{else}
		<tr height="40">
			<td class="main_error_text" align="left" colspan="5" bgcolor="#FFFFFF">{$lang.cards.admin.empty_cards}</td>
		</tr>
	{/if}
	</table>
<script type="text/javascript">
{literal}
		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>
	</div>
</div>
{/strip}
{if $ajax eq 0}
{*<a href="{$form.back}" class="admin_button btn_upload" >{$lang.button.back}<span>&nbsp;</span></a>&nbsp;&nbsp;&nbsp;*}
{include file="$admingentemplates/admin_bottom.tpl"}
{/if}
<script type="text/javascript">
{literal}
$(document).ready(function(){
            $('#bottom_corner').corner("bottom 3px");
            $('#cat').live('click',function(){
                $("#active_themes_s").hide();
                $("#active_themes").toggle();
            });
            $(".option_box_item_box").hover(
                function(){
                    $(this).addClass('option_box_item_box_hover');
                },
                function () {
                    $(this).removeClass('option_box_item_box_hover');
                }
            ); 	
            
            $('#bottom_corner_s').corner("bottom 3px");
            $('#sub').live('click',function(){
                $("#active_themes").hide();
                $("#active_themes_s").toggle();
            });
            $(".option_box_item_box").hover(
                function(){
                    $(this).addClass('option_box_item_box_hover');
                },
                function () {
                    $(this).removeClass('option_box_item_box_hover');
                }
            ); 	
})

function PageList(id_div, par) {
        ajaxLoadingImage(1, 'items');
        $.post("admin_cards.php", par, function(data){
            ajaxLoadingImage(0, 'items');
            $('#items').html(data);
        });
    }
{/literal}
</script>