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

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

<script type="text/javascript" src="<?=$g4[path]?>/js/capslock.js"></script>
<script type="text/javascript">
// 엠파스 로긴 참고
var bReset = true;
function chkReset(f) 
{
    if (bReset) { if ( f.mb_id.value == 'USERID' ) f.mb_id.value = ''; bReset = false; }
    document.getElementById("pw1").style.display = "none";
    document.getElementById("pw2").style.display = "";
}
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="2" bgcolor="#e1e1e1">
<tr><td>
	<table width="100%" border="0" cellpadding="0" cellspacing="4" bgcolor="#ffffff">
	<tr><td align="center" valign="top" bgcolor="#ffffff" style="padding:0px">
		<table width=100% border=0 cellpadding=0 cellspacing=0>
		<tr><td align=center>
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr><td align="center">
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr><td valign="top" style="padding:0px">
					<!-- 로그인 전 외부로그인 시작 -->
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<form name="fhead" method="post" onsubmit="return fhead_submit(this);" autocomplete="off" style="margin:0px;">
					<input type="hidden" name="url" value="<?=$url?>">
					<tr><td colspan="2" align="center" height="20" bgcolor=#f9f9f9>
						<SCRIPT language="JavaScript">
						<!--
						var today = new Date();
						var day = today.getDay();
						var year = today.getYear();
						if (year < 2000) year+=1900;
						var month = today.getMonth();
						var date = today.getDate();
						var week;
						if (day == 0) week = " (일요일)" ;
						if (day == 1) week = " (월요일)" ;
						if (day == 2) week = " (화요일)" ;
						if (day == 3) week = " (수요일)" ;
						if (day == 4) week = " (목요일)" ;
						if (day == 5) week = " (금요일)" ;
						if (day == 6) week = " (토요일)" ;
						document.write(""+year+ "년 " + (month+1) + "월 " + date + "일");
						document.write(""+week +"");
						//현재 날짜,요일을 표시하는 스크립트 -->
						</SCRIPT>
						</td>
					</tr>
					<tr>
						<td height="55" border="0">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td height="23" align="center"><input name="mb_id" type="text" class=ed style="width:98%" maxlength="20" required itemname="USERID" value='USERID' onMouseOver='chkReset(this.form);' onFocus='chkReset(this.form);'></td>
							</tr>
							<tr> 
								<td id=pw1 height="23" align="center"><input type="text" class=ed style="width:98%" maxlength="20" required itemname="PASSWORD" value='PASSWORD' onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);'></td>
								<td id=pw2 style='display:none;' height="23" align="center"><input name="mb_password" id="outlogin_mb_password" type="password" class=ed style="width:98%" maxlength="20" itemname="PASSWORD" onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);' onKeyPress="check_capslock(event, 'outlogin_mb_password');"></td>
							</tr>
							</table>
						</td>
						<td width="60" align="center">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr><td border="0">
									<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; } }"><font style='font-size:8pt;'>ID저장</FONT></td>
								</tr>
								<tr><td width="60" border="0" align="center">
									<input type="image" src="<?=$outlogin_skin_path?>/img/login_05.gif" border="0" alt="로그인">
								</td></tr>
							</table>
						</td>
					</tr>		
					<tr>
						<td colspan="2" bgcolor=#e1e1e1 height="1"></td>
					</tr>			
					<tr>
						<td colspan="2" border="0" height="23" align="center">
						<a href="<?=$g4[bbs_path]?>/register.php"><b>회원가입</a></b></a>
						<font color="#CCCCCC">ㅣ</font>
						<a href="javascript:win_password_forget();">ID/PW찾기</a>
						</td></tr>
						</form>
					</table>
				</td></tr></table>
			</td></tr></table>
		</td></tr></table>
	</td></tr></table>
</td></tr></table>
<script language="JavaScript">
function fhead_submit(f)
{
    if (!f.mb_id.value) {
        alert("회원아이디를 입력하십시오.");
        f.mb_id.focus();
        return false;
    }

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

    <?
    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';";
    ?>
    
    return true;
}
</script>
<!-- 로그인 전 외부로그인 끝 -->
