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

// 이미지경로
//$sub_menu_skin_path = $sub_menu_skin_path;

$skin_width = $options;

//서브메뉴 타이틀
if($gr_id){
$s_mct     =  "  po_poll9 = 'gr_id'  ";  
$s_mct    .=  " and po_poll1 = '$gr_id' "; 
$s_row = sql_fetch("select po_poll12 from $site_bill where  $s_mct");

   if($s_row[po_poll12]){
    $menu_subject  = "<img src='{$g4[path]}/data/file/$gr_id/$s_row[po_poll12]''  border='0'>" ;
   }
   else{
    $menu_subject  = $gr_subject;
   }

}
else{//메인페이지 타이틀
$s_mct     =  "  po_poll1 = 'skin'  ";  
$s_mct    .=  " and po_poll2 = 'sub_menu' "; 
$s_row = sql_fetch("select po_poll19 from $site_bill where  $s_mct");

   if($s_row[po_poll19]){
    $menu_subject  = "<img src='{$g4[path]}/data/file/index/$s_row[po_poll19]''  border='0'>" ;
   }
   else{
    $menu_subject  = "<img src='{$sub_menu_skin_path}/img/title_basic.gif'  border='0'>" ;
   }

}




	 
			
?>

<style type="text/css">
<!--
.style1 {
	color: #FF6600;
	font-weight: bold;
}
-->
</style>

<script language="JavaScript">
<!--
function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length-1; i++) {
    document.preloadlist[top+i] = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function na_change_img_src(name, nsdoc, rpath,gr_id, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = "<?=$g4[path]?>/data/file/"+gr_id+"/"+rpath;
  } 
}

// -->
</script>


<table border="0" cellspacing="0" cellpadding="0" width="<?=$skin_width?>" align="center">
  <tr>
    <td width='10' height='35'><img src='<?=$sub_menu_skin_path?>/img/neto1.gif'  border='0'></td>
    <td background='<?=$sub_menu_skin_path?>/img/neto2.gif' height='35'>
      <!----메뉴상단제목------>
		<table width="<?=$skin_width?>"  border="0" cellspacing="0" cellpadding="0">
          <tr>
			<td>			
			<b><span style="font-size:10pt;"><font color="#3f3f3f"><?=$menu_subject?></font></span></b>
			</td>
          </tr>
        </table>
      <!---//메뉴상단제목------>
	</td>
    <td width='10'><img src='<?=$sub_menu_skin_path?>/img/neto3.gif'   border='0'></td>
  </tr>
  <tr>
    <td background='<?=$sub_menu_skin_path?>/img/neto4.gif' width="10"></td>
    <td align='center' valign='top' bgcolor='#FFFFFF' >
    <!-----내용출력------>
	<table border="0" cellspacing="0" cellpadding="0" width="100%">				
     <!-----------------db에서 해당 그릅메뉴를 불러옴---------------------->
     <?while ($left_row= sql_fetch_array($result)){
  
       $url_path   =  menu_url($left_row[po_poll9], $left_row[po_poll1]); // 메뉴경로         
       $color_r    =  menu_color($left_row[po_poll1],$gr_id,$bo_table, "#030303", "#848383"); // 메뉴색상

		  if($bo_table){
		      if($left_row[po_poll1] == $bo_table){
		        $v_gif  = "icl1.gif";  
		        }
		      else{
		        $v_gif  = "icl.gif";  
		        }
		    }
			else{
             $v_gif  = "icl.gif";  
			}


    $sca_sql = " select bo_category_list from $g4[board_table] where bo_table = '$left_row[po_poll1]' ";
    $sca_row = sql_fetch($sca_sql);

    $sca_result = explode("|", $sca_row[bo_category_list]); // 구분자가 , 로 되어 있음

       ?>
		<tr>
			<td height="24">&nbsp;<img src="<?=$sub_menu_skin_path?>/img/<?=$v_gif?>" border="0">&nbsp;<a href="<?=$url_path?>" target="_self" class=sub_menu>
			<b><font color="<?=$color_r?>"><span style="font-size:9pt;"><?=$left_row[po_subject]?></span></font></b></a></td></tr>


		<tr><td>
        <!--------db에서 해당 sub메뉴를 불러옴--------->
         <table border="0" cellspacing="0" cellpadding="0" width="100%">
				
		<?
          for ($i=0; $i<count($sca_result); $i++){
           if (trim($sca_result[$i])){
			   ?>
			<tr>
			   <td >&nbsp;&nbsp;<a href="<?=$g4[path]?>/bbs/board.php?bo_table=<?=$left_row[po_poll1]?>&sca=<?=$sca_result[$i]?>" target="_self" class=sub_menu>
                      <?=$sca_result[$i]?></a>
     			</td>
			</tr>
			<tr><td height="2"></td></tr>
				<?}
	        }
	    ?>
        </table>
        <!--------db에서 해당 sub메뉴를 불러옴--------->
		</td></tr>
         <tr>
			<td height="1" background="<?=$sub_menu_skin_path?>/img/dot_line.gif"></td></tr>
			<?}?>
	    </table>
    </td>
    <td background='<?=$sub_menu_skin_path?>/img/neto5.gif'></td>
  </tr>
  <tr>
    <td height='10'><img src='<?=$sub_menu_skin_path?>/img/neto6.gif' width='10' height='10' border='0'></td>
    <td background='<?=$sub_menu_skin_path?>/img/neto7.gif'></td>
    <td><img src='<?=$sub_menu_skin_path?>/img/neto8.gif' width='10' height='10' border='0'></td>
  </tr>
</table>
