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

$url = '';
if ($g4['https_url']) {
    if (preg_match("/^\./", $urlencode))
        $url = $g4[url];
    else
        $url = $g4[url].$urlencode;
} else {
    $url = $urlencode;
}

// 아이디 자동저장
$ck_id_save = get_cookie("ck_id_save");

if ($ck_id_save) {
	$ch_id_save_chk = "checked";
	$ck_id_save = "{$ck_id_save}";
} else {
	$ck_id_save = "아이디";
}

$table_width = 190;//테이블 크기
$home_name = get_text($config[cf_home_name]);
?>

<style>
.login_msg { font-size:11px; padding:5px; }
.login_text1 { font-family:굴림; font-size:11px; font-weight:bold; padding-top:6px; padding-left:6px; padding-bottom:3px; }
.login_text2 { font-family:굴림; font-size:11px; padding-top:6px; padding-bottom:3px; color:#999999;}
.login_text3 { font-family:굴림; font-size:11px; padding-top:0px; padding-bottom:0px; }
.login_box {  padding:1px; }
.login_input { font-family:굴림; font-size:8pt; color:#777777; border-top:1px solid #d9d9d9;  border-bottom:1px solid #d9d9d9; border-left:1px solid #d9d9d9; border-right:1px solid #d9d9d9; letter-spacing:0px; padding-top:4px; padding-left:5; padding-right:0; padding-bottom:0; }
</style>
<script type="text/javascript" language=JavaScript>
// 엠파스 로긴 참고
var bReset = true;
function chkReset(f) 
{
    if (bReset) { if ( f.mb_id.value == '아이디' ) f.mb_id.value = ''; bReset = false; }
    document.getElementById("pw1").style.display = "none";
    document.getElementById("pw2").style.display = "";
}
</script>

<!-- 로그인 전 외부로그인 시작 -->
<form name="fhead" method="post" action="javascript:fhead_submit(document.fhead);" autocomplete="off" style="margin:0">
<input type="hidden" name="url" value="<?=$url?>">
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#d9d9d9">
	<tr height="100">
		<td bgcolor="#ffffff" align="center" valign="top">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr height="12"><td></td></tr>
			<tr>
				<td align="center">
				<table width="97%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td rowspan="3" width="100" background="<?=$outlogin_skin_path?>/img/login_box.gif">
						<table width="100%" height="51" border="0" cellspacing="0" cellpadding="0">
							<tr><td width="26"></td><td class=small><?=$home_name?></td></tr>
						</table>
						</td>
					</tr>
					<tr>
						<td class="login_box"><input name="mb_id" type="text" class="login_input" maxlength="20" required itemname="아이디"  value='<?=$ck_id_save?>' onMouseOver='chkReset(this.form);' onFocus='chkReset(this.form);' style="width:80px;height:21px;" tabIndex=3></td>
						<td class="login_text3"><input type='checkbox' id='id_save' name='id_save' <?=$ch_id_save_chk?>><span class="lo_id_save">ID저장</td>
					</tr>
					<tr>
						<td class="login_box" id="pw1"><input type="text" class="login_input" maxlength="20" required itemname="패스워드" value='비밀번호' onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);' style="width:80px;height:21px;" tabIndex=4></td>
						<td class="login_box" id=pw2 style='display:none;'><input name="mb_password" type="password" class="login_input" maxlength="20" itemname="패스워드" onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);' style="width:80px;height:21px;" tabIndex=4></td>
						<td><input type="image" src="<?=$outlogin_skin_path?>/img/login_button.gif" tabIndex=5></td>
					</tr>
					<tr height="5"><td colspan="3"></td></tr>
					<tr>
						<td colspan="3" class="login_text3">&nbsp;&nbsp;<input type="checkbox" name="auto_login" value="1" onclick="if (this.checked) { if (confirm('자동로그인을 사용하시면 다음부터 회원아이디와 패스워드를 입력하실 필요가 없습니다.\n\n\공공장소에서는 개인정보가 유출될 수 있으니 사용을 자제하여 주십시오.\n\n자동로그인을 사용하시겠습니까?')) { this.checked = true; } else { this.checked = false; } }">자동로그인</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?=$g4[bbs_path]?>/register.php" style="color:#f0761c; font-weight:bold;">회원가입</a> | <a href="javascript:win_password_forget();">비밀번호 찾기</a></span>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</form>
<script language="JavaScript">
function fhead_submit(f)
{
    if (!f.mb_id.value)
    {
        alert("회원아이디를 입력하십시오.");
        f.mb_id.focus();
        return;
    }

    if (document.getElementById('pw2').style.display!='none' && !f.mb_password.value)
    {
        alert("패스워드를 입력하십시오.");
        f.mb_password.focus();
        return;
    }

    <?
    if ($g4[https_url])
        echo "f.action = '$g4[https_url]/$g4[bbs]/login_check.php';";
    else
        echo "f.action = '$g4[bbs_path]/login_check.php';";
    ?>
    f.submit();
}
</script>
<!-- 로그인 전 외부로그인 끝 -->
