<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 
?>
<style>
.title		{ background:#F3F3F3; padding:10px; font-weight:bold; font-size:15px; }
.to_name	{ margin:10px 0 20px 20px; color:#454545; font:normal 14px 나눔고딕; }
td input.minp	{ border:1px solid #AAAAAA; border-radius:3px; padding:8px 10px 6px 9px; margin:6px 0 6px 0; }
td textarea.minp	{ border:1px solid #AAAAAA; border-radius:3px; padding:8px 10px 6px 9px; margin:6px 0 6px 0; }
table.tblinput tr td:first-child	{ text-align:left; }
</style>

<div class="title"><?=$g4[title]?></div>
<div class="to_name"><b><?=$name?></b>님께 메일보내기</div>

<form name="fformmail" method="post" onsubmit="return fformmail_submit(this);" enctype="multipart/form-data" style="margin:0px;">
<input type="hidden" name="to"     value="<?=$email?>">
<input type="hidden" name="attach" value="2">
<input type="hidden" name="token"  value="<?=$token?>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> 
    <td align="center" valign="top">
	<table width="95%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
            <td height="1" bgcolor="#E9E9E9"></td>
        </tr>
        <tr> 
            <td valign="top" bgcolor="#FFFFFF">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tblinput">
                <colgroup width="10%" align="right">
                <colgroup width="5%" align="center">
                <colgroup width="85%" align="left">
                <? if ($is_member) { // 회원이면 ?>
                <input type='hidden' name='fnick'  value='<?=$member[mb_nick]?>'>
                <input type='hidden' name='fmail'  value='<?=$member[mb_email]?>'>
                <? } else { ?>
                <tr> 
                    <td height="27" align="center">이름</td>
                    <td valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td><input type=text style='width:90%;' name='fnick' required minlength=2 itemname='이름' class="minp"></td>
                </tr>
                <tr> 
                    <td height="27" align="center">E-mail</td>
                    <td valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td align="left"><input type=text style='width:90%;' name='fmail' required email itemname='E-mail' class="minp"></td>
                </tr>
                <? } ?>

                <tr> 
                    <td height="27" align="center">제목</td>
                    <td valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td align="left"><input type=text style='width:90%;' name='subject' required itemname='제목' class="minp"></td>
                </tr>
                <tr> 
                    <td height="28" align="center">선택</td>
                    <td valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td align="left"><input type='radio' name='type' value='0' checked> TEXT <input type='radio' name='type' value='1' > HTML <input type='radio' name='type' value='2' > TEXT+HTML</td>
                </tr>
                <tr> 
                    <td height="150" align="center">내용</td>
                    <td valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td align="left"><textarea name="content" style='width:90%;' rows='9' required itemname='내용' class="minp"></textarea></td>
                </tr>
                <tr> 
                    <td height="27" align="center">첨부파일 #1</td>
                    <td valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td align="left"><input type=file style='width:50%;' name='file1' class="minp"></td>
                </tr>
                <tr> 
                    <td height="27" align="center">첨부파일 #2</td>
                    <td valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td align="left"><input type=file style='width:50%;' name='file2' class="minp"></td>
                </tr>
                <tr> 
                    <td height="27" align="center"><img id='kcaptcha_image' /></td>
                    <td valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td align="left"><input type=input size=10 name=wr_key itemname="자동등록방지" required class="minp">&nbsp;&nbsp;왼쪽의 글자를 입력하세요.</td>
                </tr>
                <tr> 
                    <td height="1" colspan="3" bgcolor="#E9E9E9"></td>
                </tr>
                </table></td>
        </tr>
        </table></td>
</tr>
<tr>
    <td height="40" align="center" valign="bottom"><input id=btn_submit type=image src="<?=$member_skin_path?>/img/btn_mail_send.gif" border=0>&nbsp;&nbsp;<a href="javascript:window.close();"><img src="<?=$member_skin_path?>/img/btn_close.gif" width="48" height="20" border="0"></a></td>
</tr>
</table>
</form>

<script type="text/javascript" src="<?="$g4[path]/js/md5.js"?>"></script>
<script type="text/javascript" src="<?="$g4[path]/js/jquery.kcaptcha.js"?>"></script>
<script type="text/javascript">
with (document.fformmail) {
    if (typeof fname != "undefined")
        fname.focus();
    else if (typeof subject != "undefined")
        subject.focus();
}

function fformmail_submit(f)
{
    if (!check_kcaptcha(f.wr_key)) {
        return false;
    }

    if (f.file1.value || f.file2.value) {
        // 4.00.11
        if (!confirm("첨부파일의 용량이 큰경우 전송시간이 오래 걸립니다.\n\n메일보내기가 완료되기 전에 창을 닫거나 새로고침 하지 마십시오."))
            return false;
    }

    document.getElementById('btn_submit').disabled = true;

    f.action = "./formmail_send.php";
    return true;
}

document.onready = function() {
	window.resizeTo(900, 600);
	document.body.scrollbar = "hidden"; 
}
</script>
