<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");

// 날짜 위치
$today0 = "250";

// 날짜와 요일 나타내기
$today1 = date("Y.m.d");
$day = date("w");
if($day == 0) $today2= "(일)";
else if($day == 1) $today2 = "(월)";
else if($day == 2) $today2 = "(화)";
else if($day == 3) $today2 = "(수)";
else if($day == 4) $today2 = "(목)";
else if($day == 5) $today2 = "(금)";
else if($day == 6) $today2 = "(토)";
$today3 = $today1." ".$today2;

// 아래 부분 테이블명
$my_table1 = '03_1';
$my_table2 = '03_2';
$my_table3 = '03_3';
$my_table4 = '03_4';
$my_table5 = '03_5';

// 게시판 이름 구하기
// 오누리 빌더 1.3 포함
$sql1 = "select bo_subject from $g4[board_table] where bo_table='$my_table1'";
$sql2 = "select bo_subject from $g4[board_table] where bo_table='$my_table2'";
$sql3 = "select bo_subject from $g4[board_table] where bo_table='$my_table3'";
$sql4 = "select bo_subject from $g4[board_table] where bo_table='$my_table4'";
$sql5 = "select bo_subject from $g4[board_table] where bo_table='$my_table5'";
$bo_name_sql1 = sql_query($sql1);
$bo_name1 = sql_fetch_array($bo_name_sql1);
$bo_name_sql2 = sql_query($sql2);
$bo_name2 = sql_fetch_array($bo_name_sql2);
$bo_name_sql3 = sql_query($sql3);
$bo_name3 = sql_fetch_array($bo_name_sql3);
$bo_name_sql4 = sql_query($sql4);
$bo_name4 = sql_fetch_array($bo_name_sql4);
$bo_name_sql5 = sql_query($sql5);
$bo_name5 = sql_fetch_array($bo_name_sql5);
?>

<SCRIPT type="text/javascript">
<!--
	old_debate='1';

	function showLayer_tap(objid){
		document.getElementById("debate"+old_debate).style.display="none";
		document.getElementById("debate"+old_debate+"#1").style.display="";
		document.getElementById("debate"+objid+"#1").style.display="none";
		document.getElementById("debate"+objid).style.display="";
		document.getElementById("debate_content"+old_debate).style.display="none";
		document.getElementById("debate_content"+objid).style.display="";
		old_debate=objid;
	}
//-->
</SCRIPT>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr height="22">
		<td width="5" background="<?=$g4[path]?>/img/tap_img/top_1.gif"></td>
		<td background="<?=$g4[path]?>/img/tap_img/top_2.gif">
		<table border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="<?=$today0?>"><span class="small"><? echo $today3?></span></td>
				<td>
				<table cellSpacing=0 cellPadding=0 border=0>
					<tr>
						<td id=debate1><table cellSpacing=0 cellPadding=0 border=0 height="22" style="cursor:pointer;" onclick=location.href="<?=$g4[path]?>/bbs/board.php?bo_table=<?=$my_table1?>"><tr><td width="5" background="<?=$g4[path]?>/img/tap_img/on_1.gif"></td><td align="center" class="small" background="<?=$g4[path]?>/img/tap_img/on_2.gif"><span style="color:#f0761c; font-weight:bold; vertical-align:-3px;"><?=$bo_name1[bo_subject]?></span></td><td width="5" background="<?=$g4[path]?>/img/tap_img/on_3.gif"></td></tr></table></td>
						<td id=debate1#1 style="DISPLAY: none;"><table cellSpacing=0 cellPadding=0 border=0 height="22" style="cursor:pointer;" onclick=location.href="javascript:showLayer_tap('1')"><tr><td width="5" background="<?=$g4[path]?>/img/tap_img/off_1.gif"></td><td align="center" class="small" background="<?=$g4[path]?>/img/tap_img/off_2.gif"><span style="vertical-align:-3px;"><?=$bo_name1[bo_subject]?></span></td><td width="5" background="<?=$g4[path]?>/img/tap_img/off_3.gif"></td></tr></table></td>
					</tr></table>
				</td>
				<td width="5"></td>
				<td>
				<table cellSpacing=0 cellPadding=0 border=0>
					<tr>
						<td id=debate2 style="DISPLAY: none;"><table cellSpacing=0 cellPadding=0 border=0 height="22" style="cursor:pointer;" onclick=location.href="<?=$g4[path]?>/bbs/board.php?bo_table=<?=$my_table2?>"><tr><td width="5" background="<?=$g4[path]?>/img/tap_img/on_1.gif"></td><td align="center" class="small" background="<?=$g4[path]?>/img/tap_img/on_2.gif"><span style="color:#f0761c; font-weight:bold; vertical-align:-3px;"><?=$bo_name2[bo_subject]?></span></td><td width="5" background="<?=$g4[path]?>/img/tap_img/on_3.gif"></td></tr></table></td>
						<td id=debate2#1><table cellSpacing=0 cellPadding=0 border=0 height="22" style="cursor:pointer;" onclick=location.href="javascript:showLayer_tap('2')"><tr><td width="5" background="<?=$g4[path]?>/img/tap_img/off_1.gif"></td><td align="center" class="small" background="<?=$g4[path]?>/img/tap_img/off_2.gif"><span style="vertical-align:-3px;"><?=$bo_name2[bo_subject]?></span></td><td width="5" background="<?=$g4[path]?>/img/tap_img/off_3.gif"></td></tr></table></td>
					</tr></table>
				</td>
				<td width="5"></td>
				<td>
				<table cellSpacing=0 cellPadding=0 border=0>
					<tr>
						<td id=debate3 style="DISPLAY: none;"><table cellSpacing=0 cellPadding=0 border=0 height="22" style="cursor:pointer;" onclick=location.href="<?=$g4[path]?>/bbs/board.php?bo_table=<?=$my_table3?>"><tr><td width="5" background="<?=$g4[path]?>/img/tap_img/on_1.gif"></td><td align="center" class="small" background="<?=$g4[path]?>/img/tap_img/on_2.gif"><span style="color:#f0761c; font-weight:bold; vertical-align:-3px;"><?=$bo_name3[bo_subject]?></span></td><td width="5" background="<?=$g4[path]?>/img/tap_img/on_3.gif"></td></tr></table></td>
						<td id=debate3#1><table cellSpacing=0 cellPadding=0 border=0 height="22" style="cursor:pointer;" onclick=location.href="javascript:showLayer_tap('3')"><tr><td width="5" background="<?=$g4[path]?>/img/tap_img/off_1.gif"></td><td align="center" class="small" background="<?=$g4[path]?>/img/tap_img/off_2.gif"><span style="vertical-align:-3px;"><?=$bo_name3[bo_subject]?></span></td><td width="5" background="<?=$g4[path]?>/img/tap_img/off_3.gif"></td></tr></table></td>
					</tr></table>
				</td>
				<td width="5"></td>
				<td>
				<table cellSpacing=0 cellPadding=0 border=0>
					<tr>
						<td id=debate4 style="DISPLAY: none;"><table cellSpacing=0 cellPadding=0 border=0 height="22" style="cursor:pointer;" onclick=location.href="<?=$g4[path]?>/bbs/board.php?bo_table=<?=$my_table4?>"><tr><td width="5" background="<?=$g4[path]?>/img/tap_img/on_1.gif"></td><td align="center" class="small" background="<?=$g4[path]?>/img/tap_img/on_2.gif"><span style="color:#f0761c; font-weight:bold; vertical-align:-3px;"><?=$bo_name4[bo_subject]?></span></td><td width="5" background="<?=$g4[path]?>/img/tap_img/on_3.gif"></td></tr></table></td>
						<td id=debate4#1><table cellSpacing=0 cellPadding=0 border=0 height="22" style="cursor:pointer;" onclick=location.href="javascript:showLayer_tap('4')"><tr><td width="5" background="<?=$g4[path]?>/img/tap_img/off_1.gif"></td><td align="center" class="small" background="<?=$g4[path]?>/img/tap_img/off_2.gif"><span style="vertical-align:-3px;"><?=$bo_name4[bo_subject]?></span></td><td width="5" background="<?=$g4[path]?>/img/tap_img/off_3.gif"></td></tr></table></td>
					</tr></table>
				</td>
				<td width="5"></td>
				<td>
				<table cellSpacing=0 cellPadding=0 border=0>
					<tr>
						<td id=debate5 style="DISPLAY: none;"><table cellSpacing=0 cellPadding=0 border=0 height="22" style="cursor:pointer;" onclick=location.href="<?=$g4[path]?>/bbs/board.php?bo_table=<?=$my_table5?>"><tr><td width="5" background="<?=$g4[path]?>/img/tap_img/on_1.gif"></td><td align="center" class="small" background="<?=$g4[path]?>/img/tap_img/on_2.gif"><span style="color:#f0761c; font-weight:bold; vertical-align:-3px;"><?=$bo_name5[bo_subject]?></span></td><td width="5" background="<?=$g4[path]?>/img/tap_img/on_3.gif"></td></tr></table></td>
						<td id=debate5#1><table cellSpacing=0 cellPadding=0 border=0 height="22" style="cursor:pointer;" onclick=location.href="javascript:showLayer_tap('5')"><tr><td width="5" background="<?=$g4[path]?>/img/tap_img/off_1.gif"></td><td align="center" class="small" background="<?=$g4[path]?>/img/tap_img/off_2.gif"><span style="vertical-align:-3px;"><?=$bo_name5[bo_subject]?></span></td><td width="5" background="<?=$g4[path]?>/img/tap_img/off_3.gif"></td></tr></table></td>
					</tr></table>
				</td>
				<td width="5"></td>
			</tr>
		</table>
		</td>
		<td width="5" background="<?=$g4[path]?>/img/tap_img/top_3.gif"></td>
	</tr>
	<tr height="3">
		<td background="<?=$g4[path]?>/img/tap_img/mid_1.gif"></td>
		<td></td>
		<td background="<?=$g4[path]?>/img/tap_img/mid_2.gif"></td>
	</tr>
	<tr>
		<td background="<?=$g4[path]?>/img/tap_img/mid_3.gif"></td>
		<td align="center">
		<table width="100%" height="115" border="0" cellspacing="0" cellpadding="0">
			<tr> 
				<td valign='top'>
				<DIV id=debate_content1><?=latest('tab',$my_table1, "5", "42");	?></div>
				<DIV id=debate_content2 style="DISPLAY: none;"><?=latest('tab',$my_table2, "5", "42");	?></div>
				<DIV id=debate_content3 style="DISPLAY: none;"><?=latest('tab',$my_table3, "5", "42");	?></div>
				<DIV id=debate_content4 style="DISPLAY: none;"><?=latest('tab',$my_table4, "5", "42");	?></div>
				<DIV id=debate_content5 style="DISPLAY: none;"><?=latest('tab',$my_table5, "5", "42");	?></div>
				</td>
			</tr>
		</table>
		</td>
		<td background="<?=$g4[path]?>/img/tap_img/mid_4.gif"></td>
	</tr>
	<tr height="5">
		<td background="<?=$g4[path]?>/img/tap_img/bot_1.gif"></td>
		<td background="<?=$g4[path]?>/img/tap_img/bot_2.gif"></td>
		<td background="<?=$g4[path]?>/img/tap_img/bot_3.gif"></td>
	</tr>
</table>
