<?php
 get_header();
$currentlang = pll_current_language();
?>
	<div class="slider con">
		<ul class="resp">
			<li style="background-image:url(img/slide2.jpg)">
				<span class="txt1">
					Leaders for What's Next
				</span>
				<span class="txt2">
					<?=($currentlang=='eng'?'Clients and Candidates have placed their trust in us for more than 35 years. As part of Amrop we function as a gateway to 16 countries in CEE and support them with local know-how and regional expertise.':'Amrop on konteksti arvestav globaalne sihtotsingu võrgustik. Toetame oma kliente nende äri arendamisel, aidates neil leida „Leader’s For What’s Next”.')?>
					<a href="<?=get_permalink(($currentlang=='eng'?'102':'104'))?>"><?=($currentlang=='eng'?'learn more':'Loe edasi')?></a>
				</span>
				<div class="clear"></div>
				<a href="<?=get_permalink(($currentlang=='eng'?'25':'78'))?>" class="bttn2 blue-bg"><?=($currentlang=='eng'?'Executive search':'Sihtotsing')?></a>
				<a href="<?=get_permalink(($currentlang=='eng'?'27':'77'))?>" class="bttn2 vio-bg"><?=($currentlang=='eng'?'Leadership assessment':'Juhtimisaudit')?></a>
				<a href="<?=get_permalink(($currentlang=='eng'?'376':'378'))?>" class="bttn2 orange-bg"><?=($currentlang=='eng'?'Board<br>Services':'Nõukogu moodustamine')?></a>
			</li>
		</ul>
		<ul class="bjqs no-resp">
			<li style="background-image:url(img/slide2.jpg)">
				<span class="txt1">
					Leaders for What's Next
				</span>
				<span class="txt2">
					<?=($currentlang=='eng'?'Clients and Candidates have placed their trust in us for more than 35 years. As part of Amrop we function as a gateway to 16 countries in CEE and support them with local know-how and regional expertise.':'Amrop on konteksti arvestav globaalne sihtotsingu võrgustik. Toetame oma kliente nende äri arendamisel, aidates neil leida „Leader’s For What’s Next”.')?>
					<a href="<?=get_permalink(($currentlang=='eng'?'102':'104'))?>"><?=($currentlang=='eng'?'learn more':'Loe edasi')?></a>
				</span>
				<div class="clear"></div>
				<a href="<?=get_permalink(($currentlang=='eng'?'25':'78'))?>" class="bttn2 blue-bg"><?=($currentlang=='eng'?'Executive search':'Sihtotsing')?></a>
				<a href="<?=get_permalink(($currentlang=='eng'?'27':'77'))?>" class="bttn2 vio-bg <?=($currentlang=='eng'?'':'oneline')?>"><?=($currentlang=='eng'?'Leadership assessment':'Juhtimisaudit')?></a>
				<a href="<?=get_permalink(($currentlang=='eng'?'376':'378'))?>" class="bttn2 orange-bg"><?=($currentlang=='eng'?'Board<br>Services':'Nõukogu moodustamine')?></a>
			</li>
			<li style="background-image:url(img/slide5a.jpg)"></li>
		</ul>
	</div>
	<script src="js/vendors/bjqs-1.3.min.js"></script>
	<script>
		jQuery(document).ready(function($) {
			$('.slider').bjqs({
				animtype      : 'slide',
				height        : 450,
				width         : 1200,
				randomstart   : false,
				autostart: true,
				showcontrols : false,
				showmarkers: false,
				responsive : true,
				animduration : 650,
				animspeed : 7000,
			});
		});
	</script>
	<div class="con">
		<a href="<?=get_permalink(($currentlang=='eng'?'14':'81'))?>#SendCV" style="background-image:url(img/sendcv.jpg)" class="info-block">
			<span class="orange-bg"><?=($currentlang=='eng'?'Send your CV':'Saada oma CV')?></span>
		</a>
		<a href="http://amrop.com/offices" target="_blank" style="background-image:url(img/info2.png)" class="info-block">
			<span><?=($currentlang=='eng'?'Amrop global offices':'AMROP ÜLE MAAILMA')?></span>
		</a>

		<ul class="articles">
			<h2 class="bg-blue"><?=($currentlang=='eng'?'Latest news':'Viimased uudised')?></h2>
			<?
			$args = array(
				'posts_per_page'   => 2,
				'offset'           => 0,
				'category'         => 10,
				'orderby'          => 'post_date',
				'order'            => 'DESC',
				'include'          => '',
				'exclude'          => '',
				'meta_key'         => '',
				'meta_value'       => '',
				'post_type'        => 'post',
				'post_mime_type'   => '',
				'post_parent'      => '',
				'post_status'      => 'publish',
				'suppress_filters' => true
			); 
			$posts_array = get_posts( $args );
				
			foreach($posts_array AS $post){
			?>
				<li class="news-item" >
					<? if(get_field("links", $post->ID)){?>
					<a href="<?=the_field('links', $post->ID)?>" target="_blank">
					<? } else {?>
					<a href="<?=get_permalink($post->ID)?>">
					<? } ?>
						<h3><?=wp_trim_words($post->post_title, 50)?></h3>
						<span class="date"><?=date('j.m.Y', strtotime($post->post_date))?></span>
						<p><?=wp_trim_words($post->post_content, 25)?></p>
					</a>
				</li>
			<?}?>
			<a href="<?=get_permalink(($currentlang=='eng'?'46':'53'))?>" class="bttn1 f-right"><?=($currentlang=='eng'?'Read more':'Loe edasi')?></a>
		</ul>
		<ul class="articles newsthumbs2">
			<h2 class="bg-green"><?=($currentlang=='eng'?'Amrop articles':'Amropi artiklid')?></h2>
			<?
			$args = array(
				'posts_per_page'   => 2,
				'offset'           => 0,
				'category'         => 15,
				'orderby'          => 'post_date',
				'order'            => 'DESC',
				'include'          => '',
				'exclude'          => '',
				'meta_key'         => '',
				'meta_value'       => '',
				'post_type'        => 'post',
				'post_mime_type'   => '',
				'post_parent'      => '',
				'post_status'      => 'publish',
				'lang' => 'eng',
				//^^^^^^^^^^^^^^-------------------------------
				'suppress_filters' => true
			); 
			$posts_array = get_posts( $args );
				
			foreach($posts_array AS $post){
			?>
				<li>
					<a href="<?=the_field('links', $post->ID)?>" target="_BLANK">
						<img src="<?=the_field('image_', $post->ID)?>" />
						<?/*
						<h3><?=wp_trim_words($post->post_title, 50)?></h3>
						<span class="date"><?=date('j.m.Y', strtotime($post->post_date))?></span>
						*/?>
					</a>
				</li>
			<?}?>
			<a href="<?=get_permalink(($currentlang=='eng'?'401':'403'))?>" class="bttn1 f-right"><?=($currentlang=='eng'?'Read more':'Loe edasi')?></a>
		</ul>
	</div>
	<script>
	$(document).ready(function(){		
		$(".articles").eq(0).addClass("first");
		$(".articles").eq(1).clone(true, true).insertBefore(".first");
		$(".articles").eq(2).addClass("last");
		$(".articles").eq(0).addClass("break");
	});
	</script>
<? get_footer(); ?>