<?php

# session
$SES_MEMBER_ID              = $this->session->userdata('C_Member_Id');
$SES_MEMBER_NAME            = $this->session->userdata('C_Member_Name');
$SES_MEMBER_NICNAME         = $this->session->userdata('C_Member_Nicname');
$SES_MEMBER_PROFILE         = $this->session->userdata('C_Member_Profile');
$SES_MEMBER_GROUPNAME       = $this->session->userdata('C_Member_Group_Name');
$SES_MEMBER_INTRO           = $this->session->userdata('C_Member_Intro');
$SES_MEMBER_EMAIL           = $this->session->userdata('C_Member_Email');
if($SES_MEMBER_NICNAME == '')   $SES_MEMBER_NICNAME = $SES_MEMBER_NAME;
if($SES_MEMBER_PROFILE==''){
	$SES_MEMBER_PROFILE = '/img/web/life_profile.png';
}
$method =  $this->uri->segment(3);


?>


    <div class="channel_header bgb3">
		<div class="wrap">
			<h1 class="channel_logo2"><a href="/"><img src="/img/web/logo_mypage.png"></a></h1>
			<? if($method == 'channel_recommend') { ?>
            <a href="/web/life/channel_recommend"><span class="channel_title2">추천채널</span></a>
			<? } else if($method == 'tag') { ?>
            <a href="<?=CROSSMAP_URL?>"><span class="channel_title2">#태그모음</span></a>
            <? } else { ?>
            <a href="/web/life/category"><span class="channel_title2">추천카테고리</span></a>
            <? }?>

			<form name="search_form" id="search_form" action="/web/search/" method="get" onsubmit="return submit_check(); return false;">
			<div class="channel_search2" id="life_search1" style="z-index:8887;"><a href="javascript:search_show()"><img src="/img/web/img_search2.gif"></a></div>
			<div class="srch3" id="life_search2" style="display:none">
				<span>
					<input type="text" id="search_keyword" name="search_keyword">
					<a href="javascript:search();"><img src="/img/web/img_search2.gif" alt="검색하기"></a>
				</span>
			</div>
			</form>
			<span class="channel_menu2"><a href="javascript:;"><img src="/img/web/search_menu2.png" class="side_menu_btn"></a></span>
		</div>
	</div>



<script>
	

$('.side_menu_btn').click(function(e) {
	var element = $(".channel_header");
	var doc_width = element.width();

	$("#side_menu_layer").toggle();
    var popH = $(this).offset().top;
    $("#side_menu_layer").css('top','0px');
	$("#side_menu_layer").css('left',doc_width+'px');

});

function search_show(){
	$("#life_search1").hide();
	$("#life_search2").show();
	$("#search_keyword").focus();
}

function submit_check() {
    if(!$("#search_keyword").val()) {
        alert('검색어를 입력하세요.');
        return false;
    } else {
        return true;
    }
}

function search(){
    $('#search_form').submit();
}

</script>
