{if $ajax eq 0}
{include file="$gentemplates/$header_tpl"}
<div class="profile_general_table">
	<div class="quick_search_table">		
		<h2>{if $type == 1}{$lang.subsection.my_kiss}{else}{$lang.subsection.kiss}{/if}</h2>	
		<!--<div class="text">
			{if $type == 1}{$header_s.toptext_mykiss}{else}{$header_s.toptext_mekiss}{/if}
		</div>-->
		
                {*if $form.err}
		<div class="error">
			<font class="error_msg">*&nbsp;{$form.err}</font><br>&nbsp;
		</div>
		{/if*}
		
		{strip}
		<!-- main tabs -->	
		<div class="main_tabs">
			<div class="tab_block first {if $form.filter eq 'all'} active{/if}">
				<a href="{$form.view_all_link}">
					{$lang.matches.view_all} ({$form.count})
				</a>
			</div>
			<div class="tab_block {if $form.filter eq 'online'} active{/if}">
				<a href="{$form.view_online_link}">
					{$lang.matches.view_online} ({$form.online_count})
				</a>
			</div>
            {if $type eq 2}
    			<div class="tab_block {if $form.filter eq 'new'} active{/if}">
    				<a href="{$form.view_new_link}">
    					{$lang.matches.view_new} ({$form.new_count})
    				</a>
    			</div>			
            {/if}	
			<div class="view">
				{if $form.view eq 'gallery'}
					<a href="{$form.view_list_link}" class="view-list-icon" title="{$lang.button.view_as_list}">&nbsp;</a>
				{else}
					<a href="{$form.view_gallery_link}" class="view-gal-icon" title="{$lang.button.view_as_gal}">&nbsp;</a>
				{/if}					
			</div>		
		</div>
		<!-- end main tabs -->		
		{/strip}  	
		
        <div class="pagination_top">
			<div class="float_left">
				<span>{$lang.search.sent}:&nbsp;</span>
				<select name="select_menu" onchange="window.location=this.options[this.selectedIndex].value;">
					<option value="{$form.my_kiss_link}" {if $kiss eq "me"}selected{/if}>{$lang.subsection.kiss}</option>
					<option value="{$form.i_kiss_link}" {if $kiss eq "i"}selected{/if}>{$lang.subsection.my_kiss}</option>
				</select>					
			</div>
			{include file="$gentemplates/pagination_top.tpl"}
		</div>
		{if $empty eq 1}
		<div>&nbsp;</div>
		<div class="error">
			<font class="error_msg">*&nbsp;{$lang.matches.empty_result}</font><br>&nbsp;
		</div>
		{/if}
        <div id="result">
{/if}
		{if $search_res}
				<div class="search_result_list">
			{if $form.view eq 'gallery'}
					{foreach key=key item=item from=$search_res name=s}
						<div class="search_result_gallery">
						<div class="" {if $smarty.foreach.s.iteration is div by 6}style="margin-right:0px"{/if}>
							<a class="imgcanvas_container" href="{$item.profile_link}" style="padding:0px; position: relative;">
								<img src="{$item.icon_path}" class="icon imgcanvas" alt="" onmouseover="javascript: CreateBigImage(this, event{if $smarty.foreach.s.last is div by 6}, true{else}, false{/if}, false);">
								{if $item.hotlisted}
									<div style="position:relative;"><a class="small_heart_white" style="top:-38px; {$default_left}:5px; position:absolute;">&nbsp;</a></div>
								{elseif $item.blacklisted}
									<div style="position:relative;"><a class="small_block_white" style="top:-38px; {$default_left}:5px; position:absolute;">&nbsp;</a></div>
								{/if}
							</a>
							<p>
								<a href="{$item.profile_link}">{$item.name|truncate:18:"...":true}</a><br />
								{$item.location|truncate:18:"...":true}<br />
								{$item.age} {$lang.home_page.ans}<br />
								<span class="text_hidden">{$item.photo_count} {$lang.users.upload_1}</span>
							</p>
						</div>	
						</div>
					{/foreach}
				{else}
					{foreach key=key item=item from=$search_res name=s}
						<div class="table_result_list {if $item.is_me eq 1} home_menu {/if}" >					
						<div class="image_col" style="padding:0px; position: relative;">	
							<a class="imgcanvas_container" href="{if $item.is_me ne 1}{$item.profile_link}{else}#{/if}">
								<!-- onmouseover="javascript: CreateBigImage(this, event);"-->								
								<img src="{$item.icon_path}" class="icon imgcanvas" alt="" onmouseover="javascript: CreateBigImage(this, event, false{if $smarty.foreach.s.last eq 1}, true{else}, false{/if});">
								{if $item.hotlisted}
									<a class="small_heart_white" style="bottom:5px; {$default_left}:5px; position:absolute;">&nbsp;</a>
								{elseif $item.blacklisted}
									<a class="small_block_white" style="bottom:5px; {$default_left}:5px; position:absolute;">&nbsp;</a>
								{/if}
								{*if $item.hotlisted}<a class="small_heart_white" style="bottom:5px; {$default_left}:5px; position:absolute;" >&nbsp;</a>{/if*}
							</a>
						</div>
						<div class="info_col">							
							{if $item.is_me ne 1}
								<a class="float_left" href="{$item.profile_link}">
							{/if}
								{$item.name|truncate:20:"...":true}
							{if $item.is_me ne 1}</a>{/if}
							<span class="float_left">&nbsp;&nbsp;</span>
							<span class="float_left status{if $item.status eq $lang.status.on}_link{else}_text{/if}">{$item.status}</span><br /><br />
							{$item.location|truncate:30:"...":true}<br />
							{$item.age} {$lang.home_page.ans}<br />							
							<span class="text_hidden">{$item.photo_count} {$lang.users.upload_1}</span>
														
							{if $form.show_users_group_s eq '1'}					
								<p>{$item.group}</p>				
							{/if}							
							<p class="text_hidden">
								{strip}
									{$lang.users.gender_search}&nbsp;
									{if $item.user_subtypes}{$item.user_subtypes}&nbsp;({$item.user_type})
									{else}{$item.user_type}
									{/if} 
									{$lang.users.from} {$item.age_min} {$lang.users.to} {$item.age_max}
								{/strip}
							</p>							
						</div>				
						<div class="annonce text_hidden" style="text-align:right;">
							{section name=s loop=$item.kisses}						
								<p style="position: relative;">
									{if $item.kisses[s].kiss_date_type == 1}
										{$item.kisses[s].kiss_date_ago} {$lang.matches.minutes_ago}
									{/if}
									{if $item.kisses[s].kiss_date_type == 2}
										{$item.kisses[s].kiss_date_ago} {$lang.matches.hours_ago}
									{/if}
									{if $item.kisses[s].kiss_date_type == 3}
										{$item.kisses[s].kiss_date_ago} {$lang.matches.days_ago}
									{/if}&nbsp;
                                    {if $kiss eq "me"}
                                    	<ins onclick="Delete_kiss('{$item.kisses[s].delete}')" class="delete-icon sub_icon" title="{$lang.button.delete}">&nbsp;</ins>
                                    {/if}
								</p>	
								<p>{$item.kisses[s].date} {$item.kisses[s].kiss_date}</p>							
								<p>
									{if $item.kisses[s].image_path}
										<img src="{$item.kisses[s].image_path}" alt="" align="left">
									{/if}
									<span style="margin-left: 10px; line-height: 2.5">
										{if $item.kisses[s].name}
											{$item.kisses[s].name}
										{else}
											{$lang.matches.kiss_date}: {$item.kisses[s].date}
										{/if}
									</span>
								</p>
							{/section}
						</div>
					</div>				
				{/foreach}
			{/if}
		</div>
{/if}
{if $ajax eq 0}		
    </div>	
			<!-- end results list -->

		{include file="$gentemplates/pagination_bottom.tpl"}
		
	</div>	
 </div>

<script type="text/javascript">
{literal}
function Delete_kiss(par){
    $.post(par+"&ajax=1", function(data){
        $("#result").html(data);
        
    })
}
{/literal}
</script>	

{include file="$gentemplates/$footer_tpl"}
{/if}