<?
if (!defined("_GNUBOARD_")) exit;
?>
<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;
    }

    f.action = "<?=$g4['bbs_path']?>/search.php";
    return true;
}
</script>

<link rel="stylesheet" href="<?=$zms[topmenu_path]?>/style.css" type="text/css">

<header>
<? include_once("$zms[topmenu_path]/ie.check.php"); ?>
<div id="special_link">
	<span id="special_link_left"><span><a href="#" onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http://<?=$_SERVER[SERVER_NAME]?>'); this.blur();">시작페이지로</a></span>
		<span class="vline"></span>
		<span><a href="javascript:window.external.addfavorite('http://<?=$_SERVER[SERVER_NAME]?>', '<?=$g4[title]?>'); this.blur();">즐겨찾기 추가</a></span>
	</span>
	<span id="special_link_center">
		<a href="<?=ZM_BUILDER_URL?>"><img src="<?=$zms[topmenu_path]?>/img/icon_home.gif"></a>
	</span>
	<span id="special_link_right">
<?	if (!$member['mb_id']) { ?>
		<? //-- 로그인 이전 -- ?>
	    <span><a href="<?=$g4['bbs_path']?>/login.php?url=<?=$urlencode?>">로그인</a></span>
		<span class="vline"></span>
		<span><a href="<?=$g4['bbs_path']?>/register.php">회원가입</a></span>
<?	} else { ?>
	    <? //-- 로그인 이후 -- ?>
		<span class="member"><?=$member[mb_nick]?>님</span><span style="padding:4px"><span class="vline"></span>
		<a href="<?=$g4['bbs_path']?>/logout.php">로그아웃</a></span>
<?	} ?>
	</span>
</div> <? //-- end special_link -- ?>
</header>

<div id="top">
	<div id="top_left"><a href="<?=ZM_BUILDER_URL?>/" target="_top" onclick="this.blur()"><img src="<?=$zms[topmenu_path]?>/img/site_logo2.gif"></a></div>
	<!-- 검색 시작 -->
	<div id="top_center">
		<div id="search_area">
			<form name="fsearchbox" method="get" onsubmit="return fsearchbox_submit(this);" style="margin:0px;">
	        <input type="hidden" name="sfl" value="wr_subject||wr_content">
		    <input type="hidden" name="sop" value="and">
			<INPUT name="stx" type="text" class="search" value="<?=$_REQUEST[stx]?>">
			<input type="image" src="<?=$zms[topmenu_path]?>/img/icon_search.png" class="btn_search">
		    </form>
		</div>
		<div id="search_area_row"><a href="http://sir.co.kr" target="_blank">그누보드</a><span class="vline"></span><a href="http://ziumsoft.com" target="_blank">지음소프트</a><span class="vline"></span><a href="http://ziumb.tistory.com" target="_blank">지음빌더</a><span class="vline"></span><a href="<?=$g4[bbs_path]?>/board.php?bo_table=notice">공지사항</a><span class="vline"></span><a href="http://daum.net" target="_blank">다음</a></div>
	</div>
	<div id="top_right"><!-- 검색 창 오른쪽 영역 --></div>
</div>

<nav>
<div id='topmenugroup'>
<ul id='mgroup'>
<?	for($i = 0; $i < count($zm_menu); $i++) :
		if(!$zm_menu[$i][more] && $zm_menu[$i][recno]) :		//-- 메뉴 그룹. 더보기 아닌 것만
		if($zm_menu[$i][current]) {
			$crrtbg	= "currentmenu";
			$crrtclr = "currentmenuc";
		}else{
			$crrtbg = $crrtclr = "";
		}
?>
	<li class='has-sub <?=$crrtbg?>'><a href="<?=$zm_menu["$i"][href]?>" target="<?=$zm_menu["$i"][target]?>"><span class="<?=$crrtclr?>"><?=$zm_menu["$i"][group_name]?></span></a>
<?	if($zm_menu[$i][0][group_name]) : ?>
	<ul>
<?		for($j = 0; $j < count($zm_menu[$i]) && $zm_menu[$i][$j][recno]; $j++) :		//-- 서브 메뉴 ?>
		<li><a href="<?=$zm_menu[$i][$j][href]?>" target="<?=$zm_menu[$i][$j][target]?>"><?=$zm_menu[$i][$j][group_name]?></a></li>
<?		endfor; ?>
	</ul>
<?	endif; ?>
	</li>
<?		endif;
	endfor; ?>
	<li onclick="zm_more_menu()"><a>더보기 <span class="more_updown">▼</span></a></li>
</ul>
</div>
</nav>
<!-- More & All menu -->
<div id="zmb_menu_all_box"><? include_once("$zms[topmenu_path]/menu_all.skin.php"); ?></div>

<script>
function zm_more_menu(){
	if($("#zmb_menu_all_box").css("display") == "none"){
		$("#zmb_menu_all_box").css("display", "block");
		$(".more_updown").html("▲");
	}else{
		$("#zmb_menu_all_box").css("display", "none");
		$(".more_updown").html("▼");
	}
}

function view_sub(no) {
	$("nav #submenu_box ul").css("display", "none");
	//$("#menu_group span a"). css("color", "#565656");
	$("#submenu_list_"+no).css("display", "block");
	//$("#menugroup_list_"+no+" a").css("color", "#638FFA");
}
</script>