<style type="text/css">
.text_tbl {
	cursor:pointer;
	cursor:hand;
	background-color:#ffffff;
	border-top:1px solid #dddddd;
	border-left:1px solid #dddddd;
	border-right:1px solid #dddddd;
	border-bottom:1px solid #dddddd;
}

.open_div {
	position:absolute;
	border-left:1px solid #dddddd;
	border-right:1px solid #dddddd;
	border-bottom:1px solid #dddddd;
	background-color:#ffffff;
	display:none;
}

.open_div td {
	padding:4 4 4 4;
}

.eds { border:1px solid #DDDDDD; height:20; padding:3 3 3 3; background-color:#FFFFFF; width:100px;}
</style>

<!-- 밑에 open_tbl 테이블의 width 만 변경하셔서 사용하시면 됨니다 -->

<table width="100%" align="right" cellpadding='0' cellspacing='0' border='0'>
<form name="mainsearch" method="get" action="javascript:fsearch_check(document.mainsearch);">
<input type='hidden' name='srows' value="10">
<input type='hidden' name='gr_id' value="">
<input type='hidden' name='sfl' value="wr_subject||wr_content">
<tr>
    <td>

		<table id="open_tbl" height="40" width='110' align="center" width='100%' cellpadding='0' cellspacing='0' border='0'>
		<tr>
		    <td>

				<table id="text_tbl" width='100%' onmousedown="body_bool=true;" class="text_tbl" cellpadding='0' cellspacing='0' border='0'>
				<tr height="18">
					<td width="5"></td>
					<td id="select_text" class="small" style="padding-top:3px;">
					전체검색
					</td>
					<td width="11" align="center"><img src='<?=$sitemap_skin_path?>/img/arrow.gif' align='absmiddle'></td>
					<td width="5"></td>
				</tr>
				</table>

				<table id="open_bar" class="open_div" cellpadding='0' cellspacing='0' border='0'>
				<tr>
					<td onclick="select_menu('',this.innerHTML,'0')" class="small">전체검색</td>
				</tr>
				<?
				//그룹을 구함
				$sql = mysql_query(" select gr_id, gr_subject from $g4[group_table] order by gr_id asc ");
				for ($i=0; $row=mysql_fetch_array($sql); $i++) {
					echo"
					<tr>
						<td onclick=\"select_menu('$row[gr_id]',this.innerHTML,".($i+1).")\" class='small'>$row[gr_subject]</td>
					</tr>
					";

					//gr_id 가 있으면 체크
					if ($row[gr_id] == $_GET[gr_id]) {
						$select_check = "
						<script language='javascript'>
						select_menu('$row[gr_id]','$row[gr_subject]',".($i+1).");
						</script>
						";
					}
				}
				?>
				</table>

		    </td>
		</tr>
		</table>

    </td>
	<td width="5"></td>
	<td>
		<input type='text' name='stx' class="eds" value="<?=$_GET[stx]?>">
	</td>
	<td width="5"></td>
	<td>
		<input type=image src="<?=$sitemap_skin_path?>/img/search.gif" align="absmiddle">
	</td>
</tr>
<input type='hidden' name='sop' value="or">
</form>
</table>

<script type="text/javascript" src="<?=$sitemap_skin_path?>/search.js"></script>
<!-- gr_id 가 있으면 -->
<?=$select_check?>