<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>

<link rel="stylesheet" type="text/css" href="<?php echo BT_MSKIN_URL?>/layout/basic/css/style.css" />



<script type="text/javascript">
<!--
    $(function(){
		$('#hd_nav_open').click(function(){
			$('#hd_nav').slideToggle('slow');
		});
    });
//-->
</script>


<header id="hd">
    <h1 id="hd_h1"><?php echo $g5['title'] ?></h1>

    <div class="to_content"><a href="#container">본문 바로가기</a></div>
    <div class="to_content"><a href="#gnb">메인메뉴 바로가기</a></div>

    <div id="hd_wrapper">

        <div id="logo">
            <!--<a href="<?php echo G5_URL ?>"><img src="<?php echo G5_IMG_URL ?>/logo.jpg" alt="<?php echo $config['cf_title']; ?>"></a>-->
            <!--<a href="<?php echo G5_URL ?>"><img src="<?php echo G5_DATA_URL.'/file/logo/'.$btcfg['bc_logo']?>" alt="<?php echo $config['cf_title']; ?>" width="<?php echo $btcfg['bc_logo_width']?>" height="<?php echo $btcfg['bc_logo_height']?>"></a>-->
            <a href="<?php echo G5_URL ?>"><?php echo $config['cf_title']; ?></a>
        </div>

        <button type="button" id="hd_nav_open">메뉴<span class="sound_only"> 메뉴열기</span></button>
        <!--<button type="button" id="hd_sch_open">검색<span class="sound_only"> 검색열기</span></button>-->
        <!--<button type="button" id="hd_login_open">로그인<span class="sound_only"> 로그인</span></button>-->

        <aside id="hd_sch">
            <div class="sch_inner">
                <h2>사이트 내 전체검색</h2>
                <form name="fsearchbox" action="<?php echo G5_BBS_URL ?>/search.php" onsubmit="return fsearchbox_submit(this);" method="get">
                <input type="hidden" name="sfl" value="wr_subject||wr_content">
                <input type="hidden" name="sop" value="and">
                <input type="text" name="stx" id="sch_stx" placeholder="검색어(필수)" required class="frm_input required" maxlength="20">
                <input type="submit" value="검색" class="btn_submit">
                <button type="button" class="pop_close"><span class="sound_only">검색 </span>닫기</button>
                </form>

                <script>
                function fsearchbox_submit(f)
                {
                    if (f.stx.value.length < 2) {
                        alert("검색어는 두글자 이상 입력하십시오.");
                        f.stx.select();
                        f.stx.focus();
                        return false;
                    }

                    // 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
                    var cnt = 0;
                    for (var i=0; i<f.stx.value.length; i++) {
                        if (f.stx.value.charAt(i) == ' ')
                            cnt++;
                    }

                    if (cnt > 1) {
                        alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.");
                        f.stx.select();
                        f.stx.focus();
                        return false;
                    }

                    return true;
                }
                </script>
            </div>
        </aside>
        <script>
            $(function (){
                var $hd_sch = $("#hd_sch");
                $("#hd_sch_open").click(function(){
                    $hd_sch.css("display","block");
                });
                $("#hd_sch .pop_close").click(function(){
                    $hd_sch.css("display","none");
                });
            });
        </script>

    </div>
</header>

<div id="hd_nav">
	<nav id="snb">
		<h2>시스템</h2>
		<ul>
			<li><a href="<?php echo G5_BBS_URL ?>/qalist.php" id="snb_new">1:1문의</a></li>
		    <li><a href="<?php echo G5_BBS_URL ?>/current_connect.php" id="snb_cnt">접속자 <?php echo connect(); // 현재 접속자수 ?></a></li>
		    <li><a href="<?php echo G5_BBS_URL ?>/new.php" id="snb_new">새글</a></li>
	<?php if ($is_member) { ?>
		<?php if ($is_admin) { ?>
		    <li><a href="<?php echo G5_ADMIN_URL ?>" id="snb_adm"><b>관리자</b></a></li>
		<?php } ?>
		    <li><a href="<?php echo G5_BBS_URL ?>/member_confirm.php?url=<?php echo G5_BBS_URL ?>/register_form.php" id="snb_modify">정보수정</a></li>
		    <li><a href="<?php echo G5_BBS_URL ?>/logout.php" id="snb_logout">로그아웃</a></li>
		<?php } else { ?>
		    <li><a href="<?php echo G5_BBS_URL ?>/register.php" id="snb_join">회원가입</a></li>
		    <li><a href="<?php echo G5_BBS_URL ?>/login.php" id="snb_login">로그인</a></li>
	<?php } ?>
		</ul>
	</nav>
	
	<nav id="gnb">
		<h2>사이트맵</h2>
		<ul>
		    <?php echo Menu::getInstance()->printMenu($list);?>
		</ul>
	</nav>
</div>

<hr>

<div id="wrapper">
    <div id="container">
        <?php if ((!$bo_table || $w == 's' ) && !defined("_INDEX_")) { ?><div id="container_title"><?php echo $g5['title'] ?></div><?php } ?>
        <!--
        폰에서는 더블 터치가 있으므로 필요없을듯...
        <div id="text_size">
            // font_resize('엘리먼트id', '제거할 class', '추가할 class');
            <button id="size_down" onclick="font_resize('container', 'ts_up ts_up2', '');"><img src="<?php echo G5_URL; ?>/img/ts01.gif" alt="기본"></button>
            <button id="size_def" onclick="font_resize('container', 'ts_up ts_up2', 'ts_up');"><img src="<?php echo G5_URL; ?>/img/ts02.gif" alt="크게"></button>
            <button id="size_up" onclick="font_resize('container', 'ts_up ts_up2', 'ts_up2');"><img src="<?php echo G5_URL; ?>/img/ts03.gif" alt="더크게"></button>
        </div>
        //-->