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

<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  cellspacing="0" bordercolordark="white" bordercolorlight="black" cellpadding="0">
        <tr>
          <?
          for ($si=1;$si<($left_row= sql_fetch_array($result));$si++){

              $url_path   =  menu_url($left_row[po_poll9], $left_row[po_poll1]); // 메뉴경로
			  
		  //그릅의 링크를 사용하는경우
		  if($left_row[po_poll17])
			  $url_path  = $left_row[po_poll17];
		  else
			  $url_path  = $url_path;

		  //메뉴 이미지 사용시
		  if($left_row[po_poll19] and !$left_row[po_poll18]){ // 이미지 1개만 올린경우
			  $po_subject['$si']  = "<a href='{$url_path}' target='_self'><img src='$g4[path]/data/file/$left_row[po_poll1]/$left_row[po_poll19]' border='0'></a>";
		  }
		  elseif($left_row[po_poll19] and $left_row[po_poll18]){ // 이미지2개, on_off 사용시
		  $n_i_name    = "n_i_name".$si;
		     
			  if($left_row[po_poll1]  == $gr_id){//이미지가 선택된경우
             $po_subject_img = "<img src='$g4[path]/data/file/$left_row[po_poll1]/$left_row[po_poll18]' border='0' name='{$n_i_name}'>"; 
		     $po_subject['$si']  = "<a href={$url_path} OnMouseOut=\"na_restore_img_src('$n_i_name', 'document');\" OnMouseOver=\"na_change_img_src('$n_i_name', 'document', '$left_row[po_poll18]','$left_row[po_poll1]', true);\">{$po_subject_img}</a>";
			  }
			  else{//선택되지 않은경우
             $po_subject_img = "<img src='$g4[path]/data/file/$left_row[po_poll1]/$left_row[po_poll19]' border='0' name='{$n_i_name}'>"; 
		     $po_subject['$si']  = "<a href={$url_path} OnMouseOut=\"na_restore_img_src('$n_i_name', 'document');\" OnMouseOver=\"na_change_img_src('$n_i_name', 'document', '$left_row[po_poll18]','$left_row[po_poll1]', true);\">{$po_subject_img}</a>";
			  }
		  }
		  else{ //텍스트로 출력시
	          //선택된경우
	           if($left_row[po_poll1]  == $gr_id){
                  $color_r  = $text_font_on; 
			  $po_subject['$si']   = "<table width='100%' border=0 cellspacing=0 cellpadding=0>";
			  $po_subject['$si']  .= "<tr><td width=5><img src='$sub_menu_skin_path/img/m_l.gif' border='0'></td>";
			  $po_subject['$si']  .= "<td background='$sub_menu_skin_path/img/m_c.gif'><table><tr><td>";


	           }
	            else{
			  $po_subject['$si']   = "<table width='100%' border=0 cellspacing=0 cellpadding=0>";
			  $po_subject['$si']  .= "<tr><td width=5><img src='$sub_menu_skin_path/img/menu_bg.gif' border='0'></td>";
			  $po_subject['$si']  .= "<td ><table><tr><td>";
				 $color_r   = $text_font_off;
		 
	            }

			  $po_subject['$si']  .= "&nbsp;<a href='{$url_path}' target='_self'><font color='{$color_r}' face='굴림'><span style='font-size:{$text_size}pt;'><b>{$left_row[po_subject]}</b></span></font></a>&nbsp;</td>";  
			  $po_subject['$si']  .= "</td></tr><tr><td height=3></td></tr></table>";



	           if($left_row[po_poll1]  == $gr_id){
			  $po_subject['$si']  .= "<td width=5><img src='$sub_menu_skin_path/img/m_r.gif' border='0'></td></tr>";
	           }
	            else{
			  $po_subject['$si']  .= "<td width=5><img src='$sub_menu_skin_path/img/menu_bg.gif' border='0'></td></tr>";	 
	            }

			  $po_subject['$si']  .= "</table>";


		  }

          ?>
          <td align="center"><?=$po_subject['$si']?></td>
		  <!----메뉴간격-->
          <td width="<?=$text_width?>"></td>
		  <!--//메뉴간격-->

          <?}
          ?>
         
        </tr>
        </table>
        <!-------------------//메뉴출력----------------->




