<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 레이어 메뉴와 관련해서 그누보드 sideview.js 파일이 필요한 경우 연결합니다.
if (!function_exists("selectBoxHidden(layer_id)")) {
	echo "<script type='text/javascript' src='$g4[path]/js/sideview.js'></script>";
}
?>
<style>
#header h1.logo {width:155px; height:70px; margin:0; padding:0;}
#header h1.logo a {display:block; padding:20px;}
#header .menu {margin:0; width:1000px; height:75px; margin:0; padding:0;}
#header .menu .menu_left {float:left; width:2px; height:75px; background:url('<?=$sitemap_skin_path?>/img/bg_menu.gif') no-repeat 0 0;}
#header .menu .menu_center {float:left; width:996px; height:75px; background:url('<?=$sitemap_skin_path?>/img/bg_menu.gif') repeat-x 0 -75px;}
#header .menu .menu_right {float:left; width:2px; height:75px; background:url('<?=$sitemap_skin_path?>/img/bg_menu.gif') no-repeat 0 -150px;}
#header .menu .gnb {height:39px; margin:0; padding:0;}
#header .menu .gnb li {position:relative; float:left; margin:0 2px 0 -2px; height:39px; list-style:none; background:url('<?=$sitemap_skin_path?>/img/sprites_ico.gif') no-repeat 0 -20px; z-index:1;}
#header .menu .gnb li.on {margin-right:0; padding-right:2px; background:url('<?=$sitemap_skin_path?>/img/bg_gnb.gif') no-repeat right 0; z-index:100;}
#header .menu .gnb li.home {margin:0; background:none;}
#header .menu .gnb li.fixed {float:right; margin:0; background:none;}
#header .menu .gnb li em {position:absolute; left:38px; top:-6px; display:block; width:35px; height:18px; text-indent:-9000px; background:url('<?=$sitemap_skin_path?>/img/hot.png');}
#header .menu .gnb li a {display:block; float:left; padding:0 18px 0 20px; height:39px; line-height:41px; overflow:hidden; font-weight:bold; color:#fff;}
#header .menu .gnb li.on a {background:url('<?=$sitemap_skin_path?>/img/bg_gnb.gif') no-repeat left top;}
#header .menu .gnb li.home a {padding:0; width:51px; text-indent:-9000px; background:url('<?=$sitemap_skin_path?>/img/sprites_ico.gif') no-repeat 18px 14px;}
#header .menu .gnb li.fixed a {padding:0; width:91px; text-indent:-9000px; background:url('<?=$sitemap_skin_path?>/img/sprites_btn.gif') no-repeat -95px 9px;}
#header .menu .gnb li a:hover {text-decoration:none; color:#ffff00;}
#header .menu .gnb li.home a:hover {color:#ffff00; background-position:18px -977px;}
#header .menu .lnb {height:36px; padding-left:10px; margin:0;}
#header .menu .lnb li {float:left; height:36px; list-style:none;}
#header .menu .lnb li a {display:block; *float:left; padding:0 10px 0 9px; height:36px; line-height:37px; font-size:11px; letter-spacing:-1px; overflow:hidden; color:#666; white-space:nowrap;}
#header .menu .lnb li.on a {font-weight:bold; text-decoration:underline;}
#header .menu .lnb_1 {padding-left:86px;}
#header .menu .lnb_2 {padding-left:86px;}
#header .menu .lnb_3 {padding-left:162px;}
#header .menu .lnb_4 {padding-left:161px;}
#header .menu .lnb_5 {padding-left:370px;}
#header .menu .lnb_6 {padding-left:353px; *width:810px; _width:auto;}
#header .menu .lnb_7 {}
</style>

<script type="text/javascript">
var save_layer = null;
function layer_view(menu_id, opt) {
	var menu = document.getElementById(menu_id);
	
	//for (i in link) { document.write(i + '<br/>'); } return;
	if (save_layer != null) {
		save_layer.style.display = "none";
		selectBoxVisible();
	}
	if (opt == 'hide') {
		menu.style.display = 'none';
		selectBoxVisible();
	} else {
		menu.style.display = 'block';
	}
	save_layer = menu;
}
</script>

<div id="header">
	<div class="menu">
		<div class="menu_left"></div>
		<div class="menu_center">
			<ul class="gnb">
				<li class="home"><a href="<?=$g4[path]?>/">홈</a></li>
				<?
					// 보드 구룹 만큼 루프를 돌린다. ( $i 는 보드구룹 넘버링 )
					for($i=0; $i<$menu['count']; $i++) {
						//if ($menu['id'][$i] == 'club') continue;
				?>
				<?
						if($gr_id == $menu['id'][$i]) {
				?>
				<li class='on'>
				<? if($menu['gr_3'][$i]) { ?><em>new</em><? } ?>
					<?
						if($menu['gr_4'][$i]) {
					?>
					<a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$menu['gr_4'][$i]?>" onmouseover="layer_view('menu_<?=$menu['id'][$i]?>', 'view', -30, -20);"><?=$menu['subject'][$i]?></a></li>
					<?
						} else {
					?>
					<a href="<?=$g4[bbs_path]?>/group.php?gr_id=<?=$menu['id'][$i]?>" onmouseover="layer_view('menu_<?=$menu['id'][$i]?>', 'view', -30, -20);"><?=$menu['subject'][$i]?></a></li>
					<? 
						}
					?>
				<?
						} else {
				?>
				<li>
				<? if($menu['gr_3'][$i]) { ?><em>new</em><? } ?>
					<?
						if($menu['gr_4'][$i]) {
					?>
					<a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$menu['gr_4'][$i]?>" onmouseover="layer_view('menu_<?=$menu['id'][$i]?>', 'view', -30, -20);"><?=$menu['subject'][$i]?></a></li>
					<?
						} else {
					?>
					<a href="<?=$g4[bbs_path]?>/group.php?gr_id=<?=$menu['id'][$i]?>" onmouseover="layer_view('menu_<?=$menu['id'][$i]?>', 'view', -30, -20);"><?=$menu['subject'][$i]?></a></li>
					<? 
						}
					?>
				<?
						}
					}
				?>
				<li class="fixed"><a href="<?=$g4[bbs_path]?>/current_connect.php">현재접속자</a></li>
			</ul>

			<ul class="lnb">
				<?
					// 보드 구룹 만큼 루프를 돌린다. ( $i 는 보드구룹 넘버링 )
					for($i=0; $i<$menu['count']; $i++) {
				?>
				<div id='menu_<?=$g4_group[$i][gr_id]?>' style="display:none;">
				<table border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="<?=$g4_group[$i][gr_2]?>"></td>
						<td style="padding-left:6px;padding-right:6px;">
						<li><a class="small"><b><font color="#2cadf2"><?=$g4_group[$i][gr_subject]?> > </b></a></li>
						<?
							// $gr_bo_c[$i] 는 각 보드 구룹에 속해 있는 보드의 개수 ( $j 는 보드구룹의 보드넘버링)
							for($j=0; $j<$sub['count'][$i]; $j++){

								if($j != $sub['count'][$i]-1){
									$class = "sub_subject";
								} else {
									$class = "sub_last_subject";
								}

								if($sub['table'][$i][$j] == $bo_table){
									$icon = "<span style='color:#000000;font-weight:bold;'>";
								} else {
									$icon = "";
								}
						?>
						<?
							if($sub['table'][$i][$j] == $bo_table) {
						?>
						<li class='on'><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$sub['table'][$i][$j]?>" class="small">
						<?=$sub['subject'][$i][$j]?></a></span></li>
						<?
							} else {
						?>
						<li><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$sub['table'][$i][$j]?>" class="small"><?=$sub['subject'][$i][$j]?></a></span></li>
						<?
							}
						?>
						<?
								if($gr_id == $menu['id'][$i]){
									echo "<script type=\"text/javascript\">";
									echo "layer_view('menu_{$gr_id}', 'view', 30, 20);";
									echo "</script>";
								}
							}
						?>
						</td>
					</tr>
				</table>
				</div>
				<?
					}
				?>
				<div id='menu_out' style="display:none;">아웃</div>
		</div>
		<div class="menu_right"></div>
	</div>
</div>