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

<table width='100%' cellpadding='0' cellspacing='0' border='0'>
	<tr height='60'><td width='40%'></td><td align='center' width='20%'><a href='<?=$g4['path']?>/'><img src='<?=$main_skin_path?>/img/logo_green.gif' alt='Onuri' border='0'></a></td><td align='right' valign='bottom' width='40%' style='padding: 3 3 3 3;'></td></tr>
	<tr><td colspan='3'>
		<table width='100%' cellpadding='0' cellspacing='0' border='0'>
			<tr height='71'>
				<td width='10'><img src='<?=$main_skin_path?>/img/left_bg.gif' alt=''></td>
				<td background='<?=$main_skin_path?>/img/bg.gif' align='center' valign='top'>
				<table width='100%' cellspacing='0' cellpadding='0' border='0'>
					<tr height='48'>
						<td width='10'></td>
						<td width='150' align='center'><a href='http://sir.co.kr' target='_blank' onfocus='this.blur();'><img src='<?=$main_skin_path?>/img/title_01.gif' border='0'></a></td>
						<td align='center' width='100%'>
						<table cellpadding='0' cellspacing='0' border='0' style='padding: 9 0 0 0 ;'>
							<tr>								
								<?
								if($config[cf_home_ex_main_use] == 1) $home_ex_main = $config[cf_home_ex_main];
								else $home_ex_main = "''";

								$excgr = "(".$home_ex_main.")";
								$sql = " SELECT a.gr_id, a.gr_subject, a.gr_use_access, a.gr_9, a.gr_10, b.mb_id FROM $g4[group_table] AS a LEFT JOIN $g4[group_member_table] AS b ON a.gr_id = b.gr_id WHERE (b.mb_id = '$member[mb_id]' AND a.gr_use_access = '1' ) OR a.gr_use_access = '0' and a.gr_id not in " . $excgr . " ORDER BY a.gr_1";
								$result = sql_query($sql);
								for ($i=0; $row=sql_fetch_array($result); $i++){

								$gr_name = ($row['gr_id'] == $gr_id)?"<span style=''>" .$row['gr_subject']."</span>":"<span style=''>" .$row['gr_subject']."</span>";//그룹제목
								$gr_target = (!empty($row['gr_9']))?$row['gr_9']:"_self";
								$gr_link = (!empty($row['gr_10']))?$row['gr_10']:$g4['bbs_path'].'/'.'group.php?gr_id=' .$row['gr_id'];//그룹링크 - 별도링크 필요하면 gr_10 필드에 전체 url 입력
								echo "<td><a href='" . $gr_link . "' style='color:#FFFFFF;' class='quick_link_01' target='".$gr_target."'>" . $gr_name . "</a></font></td><td><img src='$main_skin_path/img/_bar_01.gif' alt='' width='2' height='12'></td>"; // 그룹명 출력
								}
								?><td><a href='<?=$g4[bbs_path]?>/board.php?bo_table=01_3' style='color:#ffffff;' class='quick_link_01'>배너등록</a></td>
							</tr>
						</table>
						</td>
						<td width='150' align='right'><a href='http://www.onuri.co.kr/' onfocus='this.blur();'><img src='<?=$main_skin_path?>/img/title_02.gif' border='0'></a></td>
						<td width='10'></td>
					</tr>
					<tr height='2'><td colspan='5' background='<?=$main_skin_path?>/img/search_bar_green.gif'></td></tr>
					<tr height='5'><td colspan='5'></td></tr>
					<tr>
						<td colspan='5' align='center'>
						<table cellspacing='0' cellpadding='0' border='0'>
							<tr height='16'>
								<td width='12' background='<?=$main_skin_path?>/img/top_n_left.gif'></td>
								<td width='<?=$navi_width?>' background='<?=$main_skin_path?>/img/top_n_bg.gif'></td>
								<td width='16' background='<?=$main_skin_path?>/img/top_n_right.gif'></td>
							</tr>
						</table>
						</td>
					</tr>
				</table>
				</td>
				<td width='10'><img src='<?=$main_skin_path?>/img/right_bg.gif' alt=''></td>
			</tr>
		</table>
		<table width="100%" cellspacing='0' cellpadding='0' border='0' align='center'>
			<tr>
				<td valign='top' width="190">
				<table cellspacing='0' cellpadding='0' border='0' width='190'>
					<tr height='5'><td colspan='3'></td></tr>
					<tr height='24'><td width='5'></td><td colspan='2' width='185'>&nbsp;&nbsp;<span style='color:#15470a;vertical-align:0px;font-weight:bold;'>공지사항</span></td></tr>
					<tr><td width='5'></td><td width='9' align='center'><img src='<?=$main_skin_path?>/img/notice_icon.gif'></td><td width='186'><?=latest('notice', '01_1', 1, 26)?></td>
					</tr>
				</table>
				</td>
				<td valign='top'>
				<table cellspacing='0' cellpadding='0' border='0' align='center'>
					<tr height='5'>
						<td width='12' background='<?=$main_skin_path?>/img/middle_n_left.gif'></td>
						<td width='<?=$navi_width?>' background='<?=$main_skin_path?>/img/middle_n_bg.gif'>
						<table cellspacing='0' cellpadding='0' border='0'>
						<form name='fsearchbox' method='get' action='javascript:fsearchbox_submit(document.fsearchbox);'>		
							<tr>
								<?if(!$sfl){?><input type='hidden' name='sfl' value='wr_subject||wr_content'><?}?>
								<input type='hidden' name='sop' value='and'>
								<td>
								<? 
								$text_stx = get_text(stripslashes($stx));
								?> 
								<select id='gr_id' name='gr_id' class=select>
								<option value=''>통합검색</option>
								<?
								if($config[cf_home_ex_search_use] == 1) $home_ex_search = $config[cf_home_ex_search];
								else $home_ex_search = "''";
								
								$text_stx = get_text(stripslashes($stx));
								$excgr = "(".$home_ex_search.")";
								$sql = " SELECT a.gr_id, a.gr_subject, a.gr_use_access, a.gr_10, b.mb_id FROM $g4[group_table] AS a LEFT JOIN $g4[group_member_table] AS b ON a.gr_id = b.gr_id WHERE (b.mb_id = '$member[mb_id]' AND a.gr_use_access = '1' ) OR a.gr_use_access = '0' and a.gr_id not in " . $excgr . " ORDER BY a.gr_admin";
								$result = sql_query($sql);
								for ($i=0; $row=sql_fetch_array($result); $i++){
								?>
								<option value='<?=$row['gr_id']?>'><?=$row['gr_subject']?></option>
								<?}?>
								</select>
									<?=$group_select?> 
								</td>
								<td width='5'></td>
								<?if($s_menu == "search"){?>
								<td>
								<select name=sfl>
									<option value='wr_subject||wr_content'>제목+내용</option>
									<option value='wr_subject'>제목</option>
									<option value='wr_content'>내용</option>
									<option value='wr_id'>아이디</option>
									<option value='wr_name'>이름</option>
								</select>
								</td>
								<?}?>
								<td width='5'></td>
								<td><INPUT name='stx' maxlength='100' style='<?if($s_menu == "index"){ echo "width:300px;";}else if($s_menu == "search"){ echo "width:210px;";}?>height:21;' tabIndex=1 class=ed trim value='<?=$text_stx?>'></td>
								<td width='5'></td>
								<td width='28' align='right'>
								<script type='text/javascript'>
								//document.fsearchbox.gr_id.value = "<?=$gr_id?>";
								//document.fsearchbox.sfl.value = "<?=$sfl?>";
								function fsearchbox_submit(f)
								{
									if (f.stx.value == '')
									{
										alert('검색어를 입력하세요.');
										f.stx.select();
										f.stx.focus();
										return;
									}
										/*
									// 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
									var cnt = 0;
									for (var i=0; i<f.stx.value.length; i++)
									{
										if (f.stx.value.charAt(i) == ' ')
										cnt++;
									}
									if (cnt > 1)
									{
										alert('빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.');
										f.stx.select();
										f.stx.focus();
										return;
									}
									*/
										f.action = '<?=$g4[bbs_path]?>/search.php';
										f.submit();
									}
								</script>
								<input type=image src='<?=$main_skin_path?>/img/btn_search.gif' tabindex=3 style='width:55px;height:25px' title='검색' onmouseover=this.src='<?=$main_skin_path?>/img/btn_search2.gif' onmouseout=this.src='<?=$main_skin_path?>/img/btn_search.gif' onmousedown=this.src='<?=$main_skin_path?>/img/btn_search3.gif' alt='검색' onfocus='this.blur();'></td></tr>
								<tr><td></td></tr></form>
						</table>
						
						</td>
						<td width='16' background='<?=$main_skin_path?>/img/middle_n_right.gif'></td>
					</tr>
					<tr height='16'>
						<td width='12' background='<?=$main_skin_path?>/img/bottom_n_left.gif'></td>
						<td width='<?=$navi_width?>' background='<?=$main_skin_path?>/img/bottom_n_bg.gif'> </td>
						<td width='16' background='<?=$main_skin_path?>/img/bottom_n_right.gif'></td>
					</tr>
				</table>				
				</td>
				<td valign='top' width="190">
				<table cellspacing='0' cellpadding='0' border='0' width='190'>
					<tr height='5'><td colspan='3'></td></tr>
					<tr height='24'><td width='5'></td><td colspan='2' width='185'><?include_once("$g4[path]/rank_.php");?></td></tr>
				</table></td>
			</tr>
		</table>
		</td>
	</tr><tr height='5'><td></td></tr>
</table>
