<?
if (!defined("_GNUBOARD_")) exit;

$begin_time = get_microtime();

include_once("$g4[path]/head.sub.php");

function print_menu1($key, $no)
{
    global $menu;

    $str = "<table width=130 cellpadding=1 cellspacing=0 id='menu_{$key}' style='position:absolute; display:none; z-index:1;' onpropertychange=\"selectBoxHidden('menu_{$key}')\"><colgroup><colgroup><colgroup width=10><tr><td rowspan=2 colspan=2 bgcolor=#EFCA95><table width=127 cellpadding=0 cellspacing=0 bgcolor=#FEF8F0><colgroup style='padding-left:10px'>";
    $str .= print_menu2($key, $no);
    $str .= "</table></td><td></td></tr><tr><td bgcolor=#DDDAD5 height=40></td></tr><tr><td width=4></td><td height=3 width=127 bgcolor=#DDDAD5></td><td bgcolor=#DDDAD5></td></tr></table>\n";

    return $str;
}


function print_menu2($key, $no)
{
    global $menu, $auth_menu, $is_admin, $auth, $g4;

    for($i=1; $i<count($menu[$key]); $i++)
    {
        //if (!strstr($auth[$menu[$key][$i][0]], "r") && $is_admin != "super") continue;

        if ($menu[$key][$i][0] == "-")
            $str .= "<tr><td class=bg_line{$no}></td></tr>";
        else
        {
            $span1 = $span2 = "";
            if ($menu[$key][$i][3])
            {
                $span1 = "<span style='{$menu[$key][$i][3]}'>";
                $span2 = "</span>";
            }
            $str .= "<tr><td class=bg_menu{$no}>";
            if ($no == 2)
                $str .= "&nbsp;&nbsp;<img src='./img/icon.gif' align=absmiddle> ";
            $str .= "<a href='{$menu[$key][$i][2]}' style='color:#555500;'>{$span1}{$menu[$key][$i][1]}{$span2}</a></td></tr>";
        }

        $auth_menu[$menu[$key][$i][0]] = $menu[$key][$i][1];
    }

    return $str;
}
?>

<script language="JavaScript">
if (!g4_is_ie) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0;
var tempY = 0;
var prevdiv = null;
var timerID = null;

function getMouseXY(e) 
{
    if (g4_is_ie) { // grab the x-y pos.s if browser is IE
        tempX = event.clientX + document.body.scrollLeft;
        tempY = event.clientY + document.body.scrollTop;
    } else {  // grab the x-y pos.s if browser is NS
        tempX = e.pageX;
        tempY = e.pageY;
    }  

    if (tempX < 0) {tempX = 0;}
    if (tempY < 0) {tempY = 0;}  

    return true;
}

function imageview(id, w, h)
{

    menu(id);

    //submenu = eval(name+".style");
    submenu = document.getElementById(id).style;
    submenu.left = tempX - ( w + 11 );
    submenu.top  = tempY - ( h / 2 );

    selectBoxVisible();

    if (id.style != 'none')
        selectBoxHidden(id);
}

function help(id, left, top)
{
    menu(id);

    //submenu = eval(name+".style");
    submenu = document.getElementById(id).style;
    submenu.left = tempX - 50 + left;
    submenu.top  = tempY + 15 + top;

    selectBoxVisible();

    if (id.style != 'none')
        selectBoxHidden(id);
}

// TEXTAREA 사이즈 변경
function textarea_size(fld, size)
{
	var rows = parseInt(fld.rows);

	rows += parseInt(size);
	if (rows > 0) {
		fld.rows = rows;
	}
}
</script>

<script language="javascript" src="<?=$g4[path]?>/js/common.js"></script>
<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>
<script language="JavaScript">
var save_layer = null;
function layer_view(link_id, menu_id, opt, x, y)
{
    var link = document.getElementById(link_id);
    var menu = document.getElementById(menu_id);

    //for (i in link) { document.write(i + '<br/>'); } return;

    if (save_layer != null)
    {
        save_layer.style.display = "none";
        selectBoxVisible();
    }

    if (link_id == '')
        return;

    if (opt == 'hide')
    {
        menu.style.display = 'none';
        selectBoxVisible();
    }
    else
    {
        x = parseInt(x);
        y = parseInt(y);
        menu.style.left = get_left_pos(link) + x;
        menu.style.top  = get_top_pos(link) + link.offsetHeight + y;
        menu.style.display = 'block';
    }

    save_layer = menu;
}
</script>

<style>
a:link, a:visited, a:active { text-decoration:none; color:#CD7444; }
a:hover { text-decoration:underline; color:#C15B27; }

.title { font-size:9pt; font-family:굴림; font-weight:bold; color:#616161; }

.btn1 { background-color:#FBF8EE; } 

.col1 { color:#616161; }
.col2 { color:#868686; }

.pad1 { padding:5px 10px 5px 10px; }
.pad2 { padding:5px 0px 5px 0px; }

.bgcol1 { background-color:#FBF8EE; padding:5px; }
.bgcol2 { background-color:#F5F5F5; padding:5px; }

.line1 { background-color:#CCCCCC; height:2px; }
.line2 { background-color:#CCCCCC; height:1px; }

.list0 { background-color:#FFFFFF; }
.list1 { background-color:#F8F8F8; }

.bold { font-weight:bold; }
.center { text-align:center; }
.right { text-align:right; }

.w99 { width:99%; }
.ht { height:30px; }

.bg_menu1 { height:22px; 
            padding-left:15px; 
            padding-right:15px; } 
.bg_line1 { height:1px; background-color:#EFCA95; } 

.bg_menu2 { height:22px; 
            padding-left:25px; } 
.bg_line2 { background-image:url('./img/dot.gif'); height:3px; } 
.dot {color:#D6D0C8;border-style:dotted;}

#csshelp1 { border:0px; background:#FFFFFF; padding:6px; }
#csshelp2 { border:2px solid #BDBEC6; padding:0px; }
#csshelp3 { background:#F9F9F9; padding:6px; width:200px; color:#222222; line-height:120%; text-align:left; }

.border1 {border:3px solid #ccc;}
</style>

<body leftmargin=0 topmargin=0>
<a name='gnuboard4_admin_head'></a>

<table width=1004 cellpadding=0 cellspacing=0 border=0>
<colgroup width=180>
<colgroup>
<colgroup>
<colgroup width=100 align=right>
<tr bgcolor=#E3DCD2 height=70>
    <td colspan=2 onmouseover="layer_view('','','','','')"><a href='./'><img src='./img/logo.gif' border=0></a></td>
    <td>
        <?
        foreach($amenu as $key=>$value)
        {
            $href1 = $href2 = "";
            if ($menu["menu{$key}"][0][2])
            {
                $href1 = "<a href='".$menu["menu{$key}"][0][2]."'>";
                $href2 = "</a>";
            }
            echo "{$href1}<img src='./img/menu{$key}.gif' border=0 id='id_menu{$key}' onmouseover=\"layer_view('id_menu{$key}', 'menu_menu{$key}', 'view', -2, 5);\">{$href2}&nbsp; ";
            echo print_menu1("menu{$key}", 1);
        }
        ?>
    </td>
    <td style='padding-right:10px;'>
        <!-- <form name='c24r_form' method='post' action='http://hosting.cafe24.com' style='margin:0px;' target='_blank'>
        <input type='hidden' name='r_id' value='kagla'>
        <input type='hidden' name='r_idx' value='326'>
        <input type='image' src='http://reseller.cafe24.com/banner/img/88x31_02.gif' border='0' title='빠르고 안정적인 cafe24 호스팅'>
        </form> -->
    </td>
</tr>
<tr><td colspan=4 bgcolor=#C3BBB1 height=1></td></tr>
<tr><td colspan=4 bgcolor=#E5E5E5 height=2></td></tr>
<tr onmouseover="layer_view('','','','','')">
    <td><a href='<?=$g4[path]?>/'><img src='./img/home.gif' border=0></a><a href='#'><img src='./img/logout.gif' border=0></a></td>
    <td rowspan=2 width=1 bgcolor=#DBDBDB></td>
    <td bgcolor=#F8F8F8 align=right colspan=2>
        <img src='./img/navi_icon.gif' align=absmiddle> 
        &nbsp;<a href='./'>Manual</a> > 
        <? 
        $tmp_menu = substr($sub_menu, 0, 3);
        if (isset($menu["menu{$tmp_menu}"][0][1]))
        {
            if ($menu["menu{$tmp_menu}"][0][2])
            {
                echo "<a href='".$menu["menu{$tmp_menu}"][0][2]."'>";
                echo $menu["menu{$tmp_menu}"][0][1];
                echo "</a> > ";
            }
            else
                echo $menu["menu{$tmp_menu}"][0][1]." > ";
        }
        ?>
        <?=$g4[title]?>&nbsp;&nbsp;</td>
</tr>
<tr onmouseover="layer_view('','','','','')">
    <td valign=top>
        <table width=180 cellpadding=0 cellspacing=0>
        <?
        echo "<tr><td><img src='./img/title_menu{$tmp_menu}.gif'></td></tr>";
        echo print_menu2("menu{$tmp_menu}", 2);
        ?>
        </table><br>
    </td>
    <td valign=top style='padding:10px;' colspan=3>
