{include file="$gentemplates/$header_tpl"}
<div class="adv_search_table">
	<h2>{$lang.section.a_search}: {$lang.subsection.search_result}</h2>
	<p>{$link_adv_search}</p>
	
        {*if $form.err}
		<font class="error_msg">*&nbsp;{$form.err}</font><br />
	{/if*}
        
	{if $empty eq 1}
		<font class="error_msg">*&nbsp;{$header_s.empty_result}</font><br />
	{/if}

	{if $search_res}
		<div>&nbsp;</div>
		{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.search.view_all} ({math equation='x+y' x=$form.online_count y=$form.offline_count})
				</a>
			</div>
			<div class="tab_block {if $form.filter eq 'online'} active{/if}">
				<a href="{$form.view_online_link}">
					{$lang.search.view_online} ({$form.online_count})
				</a>
			</div>
			<div class="tab_block {if $form.filter eq 'photo'} active{/if}">
				<a href="{$form.view_photo_link}">
					{$lang.search.view_photo} ({$form.with_count})
				</a>
			</div>			
			<div class="view">
				{if $form.view eq 'gallery'}
					<a href="{$form.view_list_link}" title="{$lang.search.view_list}" class="view-list-icon">&nbsp;</a>
				{else}
					<a href="{$form.view_gallery_link}" title="{$lang.search.view_gallery}" class="view-gal-icon">&nbsp;</a>
				{/if}					
			</div>
		</div>
		<!-- end main tabs -->		
		{/strip} 
	
		<!-- begin top link -->
		{if $links_top}
		<div  class="pagination_top">
			{include file="$gentemplates/pagination_top.tpl"}
		</div>
		{/if}
		<!-- end top link -->
		
		<!-- begin results list -->
		{strip}
		<div class="search_result_list" id="search_result_list">
			{counter start=0 assign=iterations}
			{foreach key=key item=item from=$search_res name=s}
				{if !$item.couple}
					{counter}
					{if $item.couple_id}
						{assign var=item2 value=$search_res[$item.couple_id]}
					{/if}
					
					{if $form.view eq 'gallery'}
						{if ($iterations-1)%6 == 0}<div class="overflowhidden">{/if}
						<div class="search_result_gallery_high" {if $iterations is div by 6}style="margin-{$default_right}:0px;"{/if}>
							<a class="imgcanvas_container" href="{$item.profile_link}">
								<img src="{$item.icon_path}" class="icon imgcanvas" alt="" onmouseover="javascript: CreateBigImage(this, event{if $iterations is div by 6}, true{else}, false{/if}, false);" />
								{if $item.couple_id}
									<img src="{$item2.icon_path}" class="icon imgcanvas icon_couple" alt="" onmouseover="javascript: CreateBigImage(this, event{if $iterations is div by 6}, true{else}, false{/if}, 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}
							</a>
							<p>
								{if $item.is_me ne 1}<a href="{$item.profile_link}">{/if}
								{$item.name|truncate:18:"...":true}{if $item.is_me ne 1}</a>{/if}
								{assign var=status value=$item.status}
								{if $item.couple_id}
									{if $item2.status eq $lang.status.on}{assign var=status value=$lang.status.on}{/if}
									<span>&nbsp;+&nbsp;</span><a href="{$item2.profile_link}"><span>{$item2.name|truncate:18:"...":true}</span></a>
								{/if}
								<br />
								{if $item.couple_id && ($item.location || $item2.location) && $item.location != $item2.location}
									{$item.location|truncate:17:"...":true}{if $item2.location}<br/>+{$item2.location|truncate:16:"...":true}{/if}<br />
								{else}
									{if $item.location}{$item.location|truncate:17:"...":true}<br />{/if}
								{/if}
								{$item.age}{if $item.couple_id}&nbsp;+&nbsp{$item2.age}{/if} {$lang.home_page.ans}<br />
								<span class="text_hidden">{$item.photo_count} {$lang.users.upload_1}</span>
							</p>
						</div>
						{if $iterations % 6 == 0}</div>{/if}
					{else}
						<div class="table_result_list {if $item.is_me eq 1} home_menu {/if}">				
							<div class="image_col" style="position: relative;">
								<a class="imgcanvas_container" href="{$item.profile_link}">
									<img src="{$item.icon_path}" class="icon imgcanvas" alt="" onmouseover="javascript: CreateBigImage(this, event, false{if $iterations >= 8 && $smarty.foreach.s.last eq 1}, true{else}, false{/if});">
									{if $item.couple_id}
										<img src="{$item2.icon_path}" class="icon imgcanvas icon_couple" alt="" onmouseover="javascript: CreateBigImage(this, event{if $iterations is div by 6}, true{else}, false{/if}, 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}
								</a>
							</div>
							<div class="info_col">	
								{if $item.is_me ne 1}
									<a href="{$item.profile_link}">
								{/if}
								<span class="float_left">{$item.name|truncate:20:"...":true}</span>
								{if $item.is_me ne 1}</a>{/if}
								{assign var=status value=$item.status}
								{if $item.couple_id}
									{if $item2.status eq $lang.status.on}{assign var=status value=$lang.status.on}{/if}
									<span class="float_left">&nbsp;+&nbsp;</span><a href="{$item2.profile_link}"><span class="float_left">{$item2.name|truncate:20:"...":true}</span></a>
								{/if}
								<span class="float_left">&nbsp;&nbsp;</span>
								<span class="float_left status{if $status eq $lang.status.on}_link{else}_text{/if}">{$status}</span><br /><br />
								{if $item.couple_id && ($item.location || $item2.location) && $item.location != $item2.location}
									{if $item.location && $item2.location}
										{$item.location|truncate:23:"...":true}{if $item2.location}&nbsp;+&nbsp{$item2.location|truncate:23:"...":true}{/if}
									{else}
										{if $item.location}
											{$item.location|truncate:46:"...":true}
										{elseif $item2.location}
											{$item2.location|truncate:46:"...":true}
										{/if}
									{/if}
									<br />
								{elseif $item.location}
									{$item.location|truncate:46:"...":true}<br />
								{/if}
								{$item.age}{if $item.couple_id}&nbsp;+&nbsp{$item2.age}{/if} {$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">
									{$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}
								</p>					
							</div>
							<div class="annonce text_hidden">
								{if $form.show_users_comments eq '1'}
									{$item.annonce}
								{/if}
							</div>	
						</div>
					{/if}
				{/if}
				{if $smarty.foreach.s.last && $form.view eq 'gallery' && $iterations % 6 != 0}</div>{/if}
			{/foreach}
			<div style="clear:both"></div>
		</div>
		<div>&nbsp;</div>
		
		{include file="$gentemplates/pagination_bottom.tpl"}
	
		{/strip}<!-- end results list -->
	{/if}
	
</div>

{literal}
	<script>
		$(document).ready(function(){
			fadeimg = setInterval(function(){$('#search_result_list').find('.icon_couple').fadeToggle()}, 3000);
		});
	</script>
{/literal}

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