<?
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">
<style>
.gmenu_on		{ color:#638FFA; background:url("<?=$zms[topmenu_path]?>/img/bg_menu_group_on.gif") no-repeat left; }
.gmenu_off		{ color:#2C2C2C; }

.menu_point		{ background:url("<?=$zms[topmenu_path]?>/img/point.gif") no-repeat 0 -511px; padding:0px; }				/* ▼ */
.menu_point1	{ background:url("<?=$zms[topmenu_path]?>/img/point.gif") no-repeat 0 -287px; padding:0px; }				/* ▲ */
.menu_point2	{ background:url("<?=$zms[topmenu_path]?>/img/point.gif") no-repeat -12px -130px; padding:0 10px 0 0; }			/* ▶ */
.menu_vline		{ border-left:1px solid #E3E3E3; }

/* 현재 선택 된 메뉴 그룹 */
.currentmenu	{ background:#38A2D0; }
.currentmenuc	{ color:#ffffff; }
</style>

<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.co.kr" 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><a href="javascript:zm_more_menu()">더보기 &nbsp;<span id="mg_more_icon" class="menu_point">&nbsp;&nbsp;&nbsp;</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($("#mg_more_icon").hasClass("menu_point")) {
		$("#mg_more_icon").removeClass("menu_point");
		$("#mg_more_icon").addClass("menu_point1");
		$("#zmb_menu_all_box").css("display", "block");
	}else{
		$("#zmb_menu_all_box").css("display", "none");
		$("#mg_more_icon").removeClass("menu_point1");
		$("#mg_more_icon").addClass("menu_point");
	}
}

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>