<? if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가  ?>
<?=zm_topmenu("zm.basic")?>

<link rel="stylesheet" href="<?=$member_skin_path?>/zm.style.css" type="text/css">
<style type="text/css">
.latesend			{ border:1px solid #E3E3E3; background-color:#F7F7F7; color:#888888; font-size:11px; padding:5px; margin:3px 0 3px 0; line-height:160%; }
.friend				{ border:1px solid #E3E3E3; background-color:#F7F7F7; color:#888888; font-size:11px; padding:5px; margin:3px 0 3px 0; line-height:160%; display:none; }
.bttn_friend		{ border:1px solid #E3E3E3; background:#F3F3F3; padding:2px 10px 0 10px; cursor:pointer; color:#242424; font-size:11px; }
</style>

<section id="wrap">

<? include_once("zm.memo_top.skin.php"); ?>
<? include_once("zm.memo_left.skin.php"); ?>
<div id="memo_write_box">
	<form name=fmemoform method=post onsubmit="return fmemoform_submit(this);" autocomplete="off">
	<table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td width="80" valign="top">받는사람</td>
		<td><input type=text name="me_recv_mb_id" id="me_recv_mb_id" required itemname="받는 회원아이디" value="<?=$me_recv_mb_id?>" style="width:50%;"> 
			<span><input type="button" value="친구목록" onClick="toggle_friendbox()" class="bttn_friend"></span>
			<div class="txtsmall">여러 회원에게 보낼 때는 아이디를 콤마(,)로 구분하세요.</div>
        </td>
	</tr>
	<tr>
	    <td></td>
		<td><div class="<?=($write_sendid)?'latesend':''?>"><?=$write_sendid?></div>
		<div id="friendbox" class="friend"><span><a href="javascript:toggle_friendbox()"><img src="<?=$member_skin_path?>/img/btn_del.gif" align="absmiddle"></a></span> <?=$write_friend?></div>
		</td>
    </tr>
    <tr>
	    <td valign="top">내용</td>
		<td><textarea name=me_memo rows=10 style='width:98%;' required itemname='내용'></textarea></td>
    </tr>
	</table>
	
	<table width="99%" align="center">
<?	if($zm_config[memo_today] > 0) : ?>
	<tr><td align="center"><span class="memotoday"><font color="#656565">오늘 보낸쪽지</font> <font color="#FF8080"><b><?=number_format($zm_member[memo_today])?></b></font> / 하루 최대 <?=number_format($zm_config[memo_today])?>통</span></td></tr>
<?	endif; ?>
	<tr><td align="center"><span><input id=btn_submit type=submit value="쪽지 보내기" class="bttn2"></span></td></tr>
	</table>
	</form>
<?	if($me_recv_mb_id && $me_id) : ?>
	<table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
	    <td>받은내용</td>
	</tr>
	<tr>
		<td><div id="recvmemo"><?=nl2br(trim($content))?></div></td>
    </tr>
	</table>
<?	endif; ?>
</div> <!-- main end -->

</section>

<script type="text/javascript" src="<?=$g4[path]?>/js/md5.js"></script>
<script type="text/javascript">
with (document.fmemoform) {
    if (me_recv_mb_id.value == "")
        me_recv_mb_id.focus();
    else
        me_memo.focus();
}

function fmemoform_submit(f)
{
    document.getElementById("btn_submit").disabled = true;

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

/* no modify ↓ ziumsoft */
function toggle_friendbox(){
	if($("#friendbox").css("display") == "none") $("#friendbox").css("display", "block");
	else $("#friendbox").css("display", "none");
}
</script>
<!-- 수정 X -->
<script language="javascript">
document.onready = function() {
	window.resizeTo(910, 600);
	window.document.body.scroll = "auto"; 
}
</script>

<?=zm_bottom("zm.basic")?>