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

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

<!--[if lte IE 7]>
<style type="text/css">
html .jqueryslidemenu{height: 1%;} /*Holly Hack for IE7 and below*/
</style>
<![endif]-->

<script type="text/javascript" src="<?=BT_SKIN_URL?>/layout/basic/js/jqueryslidemenu.js"></script>
<script type="text/javascript">
<!--
//메뉴
var arrowimages = {
		/*down:['downarrowclass', '<?php echo BT_SKIN_URL?>/layout/basic/img/down.gif', 23],*/
		down:['downarrowclass', '', 23],
		right:['rightarrowclass', '<?php echo BT_SKIN_URL?>/layout/basic/img/right.gif']
};
jqueryslidemenu.buildmenu("myslidemenu", arrowimages);

//검색
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 id="top">
	<div class="wrapper">
		<ul id="tnb">
	        <?php if ($is_member) {  ?>
	        <?php if ($is_admin) {  ?>
	        <li><a href="<?php echo G5_ADMIN_URL ?>"><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">정보수정</a></li>
	        <li><a href="<?php echo G5_BBS_URL ?>/logout.php">로그아웃</a></li>
	        <?php } else {  ?>
	        <li><a href="<?php echo G5_BBS_URL ?>/register.php">회원가입</a></li>
	        <li><a href="<?php echo G5_BBS_URL ?>/login.php"><b>로그인</b></a></li>
	        <?php }  ?>
	        <li><a href="<?php echo G5_BBS_URL ?>/qalist.php">1:1문의</a></li>
	        <li><a href="<?php echo G5_BBS_URL ?>/current_connect.php">접속자 <?php echo connect(); // 현재 접속자수  ?></a></li>
	        <li><a href="<?php echo G5_BBS_URL ?>/new.php">새글</a></li>
	    </ul>

	    <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>
	</div>
</div>

<div id="hd">

	<div id="logoarea" class="wrapper">
	
	    <h1 id="hd_h1"><?php echo $g5['title'] ?></h1>

	    <div id="skip_to_container"><a href="#container">본문 바로가기</a></div>
	    
		<div id="hd_wrapper">
	        <div id="logo">
			<?php if(Str::isValue($btcfg['bc_logo'])){?>
	            <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>
			<?php }else{?>
				<a href="<?php echo G5_URL ?>"><img src="<?php echo G5_URL?>/img/logo.gif" alt="<?php echo $config['cf_title']; ?>" width="192" height="47"></a>
			<?php }?>
	        </div>

	        <fieldset id="hd_sch">
	            <legend>사이트 내 전체검색</legend>
	            <form name="fsearchbox" method="get" action="<?php echo G5_BBS_URL ?>/search.php" onsubmit="return fsearchbox_submit(this);">
	            <input type="hidden" name="sfl" value="wr_subject||wr_content">
	            <input type="hidden" name="sop" value="and">
	            <label for="sch_stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
	            <input type="text" name="stx" id="sch_stx" maxlength="20">
	            <input type="submit" id="sch_submit" value="검색">
	            </form>
	        </fieldset>

	        
	    </div>
	</div>

</div>

<nav id="gnb">
	<h2>메인메뉴</h2>
	<div class="wrapper">
    	<div id="myslidemenu" class="jqueryslidemenu">
    		<ul class="wrapper">
    			<?php echo Menu::getInstance()->printMenu($list, $bt['curmenu']['bm_idx']);?>
    		</ul>
    		<br style="clear: left" />
    	</div>
	</div>
</nav>  


<hr>

<!-- 콘텐츠 시작 { -->

<div class="wrapper">
    <div id="aside">
    	<div id="outlogin">
        	<?php echo outlogin('basic'); // 외부 로그인  ?>
        </div>
        <div id="sidemenu">
        	<?php include(BT_SKIN_PATH.'/layout/basic/sidemenu.skin.php')?>
        </div>
        <div id="poll">
        	<?php echo poll('basic'); // 설문조사  ?>
        </div>
    </div>
    <div id="container">
        <!-- 현재 위치 -->
        <?php if ($bt['curpath']) { ?>
			<div id="container_head">
    			<h2><?php echo $cur_title?></h2>
    			<p><a href="<?php echo G5_URL?>">홈</a> &gt; <?php echo $cur_path?></p>
			</div>
		<?php }?>
		<!-- //현재 위치 -->