<style type="text/css">

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	padding: 0;
}

ul, dl, dd, dt {
	margin: 0;
	padding: 0;
}
ul, ol { list-style: none;}


}


/*left*/
div.cp-malllnb{
	float:left;
	width:230px;
	margin:0 0 0px 0;
	position:relative;
}
*+html div.cp-malllnb{
	margin:0 0 6px 0;
	position:relative;
}
/*lnb*/
div.cp-lnbmenu{
	width:230px;
	margin-top:10px;
	background:url(<?=$g4[path]?>/left_menu/img/lnbbox_mid.gif) repeat-y 0 0;
	position:relative;
	z-index:100;
}
	div.cp-lnbmenu div.cp-lnbmenu-btm{
		width:230px;
		background:url(<?=$g4[path]?>/left_menu/img/lnbbox_btm.gif) no-repeat 0 bottom;
	}
	div.cp-lnbmenu-btm div.cp-lnbmenu-top{
		width:208px;
		padding:18px 12px 20px 10px;
		background:url(<?=$g4[path]?>/left_menu/img/lnbbox_top.gif) no-repeat 0 top;
	}
div.cp-lnbmenu-top h2{
	margin:0;
	padding:0;
	font-weight:bold;
	font-family:verdana,맑은 고딕, 굴림, 돋움;
	font-size:13px;
	color:#252525;
	text-align:center;
	font-weight:bold;
	
}
	div.cp-lnbmenu-top div.sub{
		text-align:center;
		padding-top:5px;
	}
div.cp-lnbmenu-top ul.scate{
	padding-top:15px;
	width:100%;
	color:#8A8989;
}
	ul.scate li{
		background:url(<?=$g4[path]?>/left_menu/img/bl_lnb.gif) no-repeat 14px 6px;
		border-bottom:1px solid #E7E7E7;
		text-align:left;
		padding:2px 0 0 29px;
		height:19px;
		position:relative;
		cursor:pointer;
		white-space:nowrap;
		letter-spacing:-1px;
	}
		ul.scate li.last{
			border-bottom:none;
			text-align:left;
			padding:5px 0 1px 29px;
		}
		ul.scate li:hover,
		ul.scate li.hover{
			width:179px;
			_width:179px;
			text-align:left;
			height:19px;
			font-weight:bold;
			padding-bottom:1px;
			color:#fff;
			letter-spacing:-1px;
			padding:2px 0 1px 29px;
			border-bottom:none;
			background:url(<?=$g4[path]?>/left_menu/img/lnb_bgon.gif) no-repeat 0 0;
		}
		ul.scate li a:link,
		ul.scate li a:visited,
		ul.scate li a:hover,
		ul.scate li a:active{
			color:#8A8989;
			text-decoration:none;
		}
div.inbox{
	width:293px;
	position:absolute;
	top:-17px;
	left:135px;
	z-index:100;
	display:none;
	overflow:hidden;
}
	div.inbox-top{
		width:293px;
		height:19px;
		background:url(<?=$g4[path]?>/left_menu/img/lnb_box_top.png) no-repeat 0 top;
	}
	div.inbox-mid{
		width:287px;
		background:url(<?=$g4[path]?>/left_menu/img/lnb_box_mid.png) repeat-y 0 0;
		
		padding:0 0 0 6px;
	}
	div.inbox-btm{
		width:293px;
		height:22px;
		background:url(<?=$g4[path]?>/left_menu/img/lnb_box_btm.png) no-repeat 0 bottom;
	}
ul.cate-sub{
	width:280px;
	overflow:hidden;
	font-size:12px;
}
	ul.cate-sub li{
		border-bottom:none;
		color:#656565;
		text-align:left;
		float:left;
		font-weight:normal;
		width:122px;
		height:5px;
		padding:7px 0 15px 18px;
		_padding:7px 0 5px 18px;
		margin:0;
		background:url(<?=$g4[path]?>/left_menu/img/bl05.gif) no-repeat 10px 9px;
	}
	ul.cate-sub li:hover,
	ul.cate-sub li.hover{
		border-bottom:none;
		text-align:left;
		color:#fff;
		float:left;
		font-weight:bold;
		width:122px;
		padding:7px 0 15px 18px;
		_padding:7px 0 5px 18px;
		margin:0;
		height:5px;
		background:#FF6600 url(<?=$g4[path]?>/left_menu/img/bl04.gif) no-repeat 10px 9px;
	}
ul.scate li:hover div.inbox,
ul.scate li.hover div.inbox {
	display:block;
	position:absolute;
}

</style>

<div class="cp-lnbmenu" id="storeCategory">
<div class="cp-lnbmenu-btm">
<div class="cp-lnbmenu-top">
<?
if($gr_id){
$sql2 = " select gr_id, gr_subject from $g4[group_table] where gr_id = '$gr_id'";
$result = sql_query($sql2);
while ($row2=mysql_fetch_array($result)) {
?>
<h2><?=$row2[gr_subject]?></h2>
<div class="sub">&nbsp;</div>
	<ul class="scate">
<? 


$hover = "width:179px;
			_width:179px;
			text-align:left;
			height:19px;
			font-weight:bold;
			padding-bottom:1px;
			color:#fff;
			letter-spacing:-1px;
			padding:2px 0 1px 29px;
			border-bottom:none;
			background:url($g4[path]/left_menu/img/lnb_bgon.gif) no-repeat 0 0;"; 

$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24)); 
			$sql = " select bo_table, bo_subject, bo_category_list from $g4[board_table] where (bo_list_level <= $member[mb_level]) and gr_id = '$gr_id' order by bo_order_search"; // 검색순서대로 정렬
			//$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24)); 
			//$sql = " select bo_table, bo_subject from $g4[board_table] where (bo_list_level <= $member[mb_level]) and gr_id = '$gr_id' order by bo_1"; //bo_1 여분필드 입력값 순서로 정렬
			$result = sql_query($sql); 
			for ($i=0; $row=sql_fetch_array($result); $i++) { 
			$tmp_write_table = $g4[write_prefix] . $row[bo_table]; 
			$tmp_write_table_category = $g4[write_prefix] . $row[bo_table] . $row[bo_category_list]; 
			$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime'"; 
			
			$result2 = sql_query($sql2); 
			 
			

			


if ($row[bo_table] == $bo_table){
 echo "<li  style='$hover'  onclick=\"location.href='$g4[path]/bbs/board.php?bo_table=$row[bo_table]';\">$row[bo_subject]";
} else {
echo "<li  class=''  onclick=\"location.href='$g4[path]/bbs/board.php?bo_table=$row[bo_table]';\">$row[bo_subject]";
}
 //카테고리 메뉴 시작
 $ca_menu = explode("|",$row[bo_category_list]);
 
					if ($row[bo_category_list] ) {
							
  echo "<div class=\"inbox\"><div class=\"inbox-top\"></div><div class=\"inbox-mid\"><ul class=\"cate-sub\">";

			
					for ($i=0; $i<count($ca_menu); $i++) 
					{ 
						if ($sca==$ca_menu[$i]) {
						echo "<li onclick=\"location.href='{$g4[bbs_path]}/board.php?bo_table=$row[bo_table]&sca=".urlencode($ca_menu[$i])."'; event.cancelBubble=true; return false;\">$ca_menu[$i]</li>";

		        } else { echo "<li onclick=\"location.href='{$g4[bbs_path]}/board.php?bo_table=$row[bo_table]&sca=".urlencode($ca_menu[$i])."'; event.cancelBubble=true; return false;\">$ca_menu[$i]</li>"; 
				}


}
echo "</ul></div><div class=\"inbox-btm\"></div></div></li>";
  } else { echo "</li>";
  }
			}
			
?>
</ul>
	</div>
	</div>
</div>
</div>
<? 
	} 
}
?>