{assign var="site_name" value=$GLOBALS.settings.site_title}
{description}[[jobs from $site_name]]{/description}

{if $ERRORS}
	{include file="error.tpl"}
{else}
	{if $smarty.request.not_found}
		<div class="alert alert-info search-results__404">
			[[Sorry, that job is no longer available. Here are some results that may be similar to the job you were looking for.]]
		</div>
	{/if}
	<div class="count-listings">
		{assign var="jobs_number" value=$listing_search.listings_number}
		<strong>[[$jobs_number jobs found]]</strong>
	</div>

	<div class="paggination">
		{if $listing_search.current_page-1 > 0}
			<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page-1}'"><img src="{image}paggination-arrow-left.png" border="0" alt="" title="" /> &nbsp; [[Previous]]</span>
		{else}
			<span class="arrow-link-na link"><img src="{image}paggination-arrow-left.png" border="0" alt="" title="" /> &nbsp; [[Previous]]</span>
		{/if}
		{if $listing_search.current_page-3 > 0}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page=1'">1</span>{/if}
		{if $listing_search.current_page-3 > 1}<span class="paggination-dots">...</span>{/if}
		{if $listing_search.current_page-2 > 0}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page-2}'">{$listing_search.current_page-2}</span>{/if}
		{if $listing_search.current_page-1 > 0}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page-1}'">{$listing_search.current_page-1}</span>{/if}
		<span class="paggination-link-na link">{$listing_search.current_page}</span>
		{if $listing_search.current_page+1 <= $listing_search.pages_number}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page+1}'">{$listing_search.current_page+1}</span>{/if}
		{if $listing_search.current_page+2 <= $listing_search.pages_number}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page+2}'">{$listing_search.current_page+2}</span>{/if}
		{if $listing_search.current_page+3 < $listing_search.pages_number}<span class="paggination-dots">...</span>{/if}
		{if $listing_search.current_page+3 < $listing_search.pages_number + 1}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.pages_number}'">{$listing_search.pages_number}</span>{/if}
		{if $listing_search.current_page+1 <= $listing_search.pages_number}
			<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page+1}'">[[Next]] &nbsp; <img src="{image}paggination-arrow-right.png" border="0" alt="" title="" /></span>
		{else}
			<span class="arrow-link-na link">[[Next]] &nbsp; <img src="{image}paggination-arrow-right.png" border="0" alt="" title="" /></span>
		{/if}
	</div>
	<div class="clr"><br/></div>

	{if $listings}
		{include file="search_results_jobs_listings.tpl"}
	{else}
		<p class="information">[[Sorry, we don't currently have any jobs for this search. Please try another search.]]</p>
	{/if}
	<div class="clr"><br/></div>

	<div class="paggination">
		{if $listing_search.current_page-1 > 0}
			<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page-1}'"><img src="{image}paggination-arrow-left.png" border="0" alt="" title="" /> &nbsp; [[Previous]]</span>
		{else}
			<span class="arrow-link-na link"><img src="{image}paggination-arrow-left.png" border="0" alt="" title="" /> &nbsp; [[Previous]]</span>
		{/if}
		{if $listing_search.current_page-3 > 0}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page=1'">1</span>{/if}
		{if $listing_search.current_page-3 > 1}<span class="paggination-dots">...</span>{/if}
		{if $listing_search.current_page-2 > 0}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page-2}'">{$listing_search.current_page-2}</span>{/if}
		{if $listing_search.current_page-1 > 0}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page-1}'">{$listing_search.current_page-1}</span>{/if}
		<span class="paggination-link-na link">{$listing_search.current_page}</span>
		{if $listing_search.current_page+1 <= $listing_search.pages_number}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page+1}'">{$listing_search.current_page+1}</span>{/if}
		{if $listing_search.current_page+2 <= $listing_search.pages_number}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page+2}'">{$listing_search.current_page+2}</span>{/if}
		{if $listing_search.current_page+3 < $listing_search.pages_number}<span class="paggination-dots">...</span>{/if}
		{if $listing_search.current_page+3 < $listing_search.pages_number + 1}<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.pages_number}'">{$listing_search.pages_number}</span>{/if}
		{if $listing_search.current_page+1 <= $listing_search.pages_number}
			<span class="link" onclick="javascript: window.location.href='?searchId={$searchId}&amp;action=search&amp;page={$listing_search.current_page+1}'">[[Next]] &nbsp; <img src="{image}paggination-arrow-right.png" border="0" alt="" title="" /></span>
		{else}
			<span class="arrow-link-na link">[[Next]] &nbsp; <img src="{image}paggination-arrow-right.png" border="0" alt="" title="" /></span>
		{/if}
	</div>
{/if}
{javascript}
	<script type="text/javascript" language="JavaScript">
		function submitForm(id) {
			lpp = document.getElementById("listings_per_page" + id);
			location.href = '?searchId={$searchId|escape:'url'}&action=search&page=1&listings_per_page=' + lpp.value;
		}
		function SaveAd(noteId, url){
			$.get(url, function(data){
				$("#"+noteId).html(data);
			});
		}
	</script>
{/javascript}