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

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

<script type="text/javascript" src="<?=$g4[path]?>/js/capslock.js"></script>
<style>
#main_login_wrap {margin:30px auto;width:620px;padding:10px;}
.main_login_top_line {width:100%;border-bottom:1px solid #555;padding:0;margin:0}
#main_login_border {float:left;width:100%;border:1px solid #ccc;border-bottom:2px solid #eee;border-top-width:1px;}
#main_login_left {float:left;width:290px;padding:0 20px;}
#main_login_banner {float:right;width:250px;margin:10px;height:250px;border:1px solid #eee;}
.main_login_title {margin:20px;margin-bottom:10px;}
.main_login_title p {margin:0;padding:0;}
.main_login_title p span {font:normal 11px dotum;color:#999;}

#left_login_wrap {float:left;width:280px;}
#left_login_wrap span {font:normal 11px dotum;color:#999;}
.left_login_bottom {float:left;width:320px;text-align:center;margin:0;padding:0;}
.left_login_bottom a {font:normal 11px dotum;color:#999;}
.left_login_btn {float:right;width:60px;margin:6px 5px;}
#bottom_menu {margin:10px auto;}
.clr {clear:both;}
.blank {padding:10px;}
.line {clear:both;margin:10px auto;border-top:1px solid #ddd;padding:0}
.line2 {clear:both;border-top:1px solid #ddd;margin:10px 0;padding:0}
.bt_area {padding:20px;text-align:center;}
.center {text-align:center;}

.in_table {margin:20px auto;height:70px;}
.in_table th {text-align:right;font:bold 11px dotum;color:#999;padding:2px;}
.in_table td {text-align:left;padding:2px 0;}
.in_table .ed {height:19px;}

.in_modify_btn {float:left;margin-bottom:26px;}
</style>

<form name="flogin" method="post" onsubmit="return flogin_submit(this);" autocomplete="off">
<input type="hidden" name="url" value='<?=$login_url?>'>
<div id="main_login_wrap">
	<div class="main_login_top_line"></div>
	<div id="main_login_border">		
		<div id="main_login_left">
			<div class="main_login_title">
				<p><img src="<?=$member_skin_path?>/img/title.gif"></p>
				<p><span>회원님의 로그인정보를 확인입력하여주세요.</span></p>
			</div>
			<div class="line"></div>
			<div id="left_login_wrap">

				<table class="in_table">
				<colgroup width="80" />
				<colgroup width="115" />
				<colgroup width="60" />
				<tr>
				<th>아이디&nbsp;</th>
				<td><input type="text" class="ed" maxLength="20" tabindex="1001" size="16" name="mb_id" itemname="아이디" required="required" minlength="2"></td>
				<td rowspan="3" style="padding:0;vertical-align:top;padding-top:3px"><div class="in_modify_btn"><input type="image" tabindex="1003" src="<?=$member_skin_path?>/img/bt_login.gif"></div></td>
				</tr>	
				<tr>
				<th>패스워드&nbsp;</th>
				<td><input type="password" class="ed" maxLength="20" tabindex="1002" size="16" name="mb_password" id="login_mb_password" itemname="패스워드" required="required" onkeypress="check_capslock(event, 'login_mb_password');"></td>
				</tr>		
				<tr>
				<th>자동로그인&nbsp;</th>
				<td><input onclick="if (this.checked) { if (confirm('자동로그인을 사용하시면 다음부터 회원아이디와 패스워드를 입력하실 필요가 없습니다.\n\n\공공장소에서는 개인정보가 유출될 수 있으니 사용을 자제하여 주십시오.\n\n자동로그인을 사용하시겠습니까?')) { this.checked = true; } else { this.checked = false;} }" type="checkbox" tabindex="1004" name="auto_login">
									<span>사용</span></td>
				</tr>		
				</table>						
			</div>
			<div class="line"></div>
			<div class="left_login_bottom"><a href="<?=$g4[bbs_path]?>/register.php">회원가입</a> <span class="bt">|</span> <a href="javascript:win_password_lost();">아이디·비밀번호 찾기</a></div>	
		</div>
		<div id="main_login_banner">
			<!-- 250*250사이즈배너 -->
			<script type="text/javascript"><!--
			google_ad_client = "ca-pub-1695408896175471";
			/* 메인로그인배너 */
			google_ad_slot = "6243250949";
			google_ad_width = 250;
			google_ad_height = 250;
			//-->
			</script>
			<script type="text/javascript"
			src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
			</script>
		</div>
	</div>
</div>
</form>
<div class="clr"></div>
<div id="bottom_menu">
	<div class="bt_area">
		<a href="<?=$g4[path]?>"><img src="<?=$member_skin_path?>/img/bt_home.gif" border="0"></a>&nbsp;<img src="<?=$member_skin_path?>/img/bt_back.gif" style="cursor:pointer;border-width:0" onclick="history.back()">
		
	</div>
</div>

<script type='text/javascript'>
document.flogin.mb_id.focus();

function flogin_submit(f)
{
    <?
    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>
