<div class="search_result_top search_result_top_fixed">
	<a href="/m">
		<span class="logo_srch"><img src="/img/mobile/logo_srch.gif" alt="logo"></span>
	</a>
	<span class="s_srch">
		<form>
			<span><input type="text" placeholder="" id="srch_input" name="search_keyword"
						 value="<?= $_GET['search_keyword'] ?>">
				<!--a href="#"><img src="/img/mobile/mypage_serch_menu.gif" alt="검색하기" style="float:right;"></a-->
				<a><img src="/img/mobile/mypage_serch_icon.gif" alt="검색하기" style="float:right"
						onclick="window.location='/m/search/?search_keyword='+$('#srch_input').val()"></a>
			</span>
		</form>
		</span>
</div>
<?

$ci = &get_instance();

@$tmp = $_SERVER['REQUEST_URI'];
@$tmp = (explode("?", $tmp));
@$query_string = $tmp[1];

?>
<div class="search_result search_result_fixed">
	<div class="search_result_menu">
		<nav class="topmn" id="basic1">
			<ul class="nav_u" id="timeline_tab">
				<li <?= $ci->uri->segment(3) == '' ? "class='active'" : ""; ?> id="root"><a
						href="/m/search/?<?= $query_string ?>" id="timeline_tab01">통합검색</a></li>
				<li <?= $ci->uri->segment(3) == 'image' ? "class='active'" : ""; ?>><a
						href="/m/search/image?<?= $query_string ?>" id="timeline_tab02">이미지</a></li>
				<li <?= ($ci->uri->segment(3) == 'list' && $_GET['content_type'] == 3)  ? "class='active'" : ""; ?>><a
						href="/m/search/list?<?= $query_string ?>&content_type=3" id="timeline_tab03">라이프</a></li>
				<li <?= $ci->uri->segment(3) == 'news' ? "class='active'" : ""; ?>><a
						href="/m/search/news?<?= $query_string ?>" id="timeline_tab04">뉴스</a></li>
				<li <?= $ci->uri->segment(3) == 'video' ? "class='active'" : ""; ?>><a
						href="/m/search/video?<?= $query_string ?>" id="timeline_tab05">동영상</a></li>
				<li <?= ($ci->uri->segment(3) == 'list' && $_GET['content_type'] == 2) ? "class='active'" : ""; ?>><a
						href="/m/search/list?<?= $query_string ?>&content_type=2" id="timeline_tab03">칼럼</a></li>
			</ul>
		</nav>
	</div>
</div>
<div class="s_result" style="display:none;">

	<span class="beachblue"><img src="/img/mobile/img_search.gif">‘<a id="keyword"><?= $search_keyword ?></a>’</span>
	검색어를 찾으셨습니까?
	<div class="search_view"><a href="" id="keyword_link">‘꽃처럼 살아가는 인생’ 검색결과 보기</a></div>
</div>
<script src="/js/m/jquery-1.11.3.min.js"></script>
<script src="/js/m/swipers.js"></script>
<script src="/js/m/jquery.row-grid.js"></script>
<script src="/js/m/vendor_plugins.js"></script>
<script src="/js/m/sly.min.js"></script>
<script src="/js/m/smartphoto.js"></script>

<script>
	var s = '<?=$search_keyword?>';
	var t = e2k(s);
	console.log(s, t);

	if (s !== t) {
		$(".s_result").show();

		$("#keyword").text(t);
		$("#keyword_link").text("'" + t + "' 검색결과 보기");
		$("#keyword_link").attr("href", "/m/search/?search_keyword=" + encodeURI(t));
	}




	var swiper = new Swiper('.swiper-01', {
		spaceBetween: 5,
		slidesPerView: 'auto',
		scrollbar: {
			el: '.swiper-scrollbar',
			hide: true,
		},
	});
	var swiper = new Swiper('.swiper-02', {
		spaceBetween: 5,
		slidesPerView: 'auto',
		scrollbar: {
			el: '.swiper-scrollbar',
			hide: true,
		},
	});
</script>


<script>
	$(document).ready(function () {
		var options = {minMargin: 5, maxMargin: 15, itemSelector: ".item", firstItemClass: "first-item"};
		$(".container").rowGrid(options);
	});

	jQuery(function ($) {
		'use strict';

		setTimeout(function () {
			var $frame = $('#basic1');
			// var $slidee = $frame.children('ul').eq(0);
			// Call Sly on frame

			<?    if ($ci->uri->segment(3) == '')
			$a = 0;
		else if ($ci->uri->segment(3) == 'image')
			$a = 1;
		else if ($ci->uri->segment(3) == 'list'){

			if($_GET['content_type'] == 2)
				$a = 5;
			else
				$a = 2;
		}


		else if ($ci->uri->segment(3) == 'news')
			$a = 3;
		else if ($ci->uri->segment(3) == 'video')
			$a = 4;
			?>


			$frame.sly({
				horizontal: 1,
				itemNav: 'basic',
				smart: 1,
				activateOn: 'click',
				mouseDragging: 1,
				touchDragging: 1,
				releaseSwing: 1,
				startAt: <?=$a;?>, // 탭설정
				scrollBy: 4,
				activatePageOn: 'click',
				speed: 300,
				elasticBounds: 1,
				easing: 'easeOutExpo',
				dragHandle: 1,
				dynamicHandle: 1,
				clickBar: 1
			});
		}(), 0);

		$("#timeline_tab > li.active").insertAfter("#root");

	});
</script>
