<!--<?php
include_once PrintEot('m_header');
$styleStr=$s?"<style>html,body{background:#FFF;}</style>":"";
print <<<EOT
-->
$styleStr
	<div id="content" class="w800 fr cc">
<!--
EOT;
if ($a == 'write' || $a == 'edit') {print <<<EOT
-->
		<div class="cc">
			<style>
			#upPanel
			{
			overflow:hidden;
			}
			</style>
			<script type="text/javascript">
			if(getObj('upPanel'))
			{
				getObj('upPanel').style.overflow="hidden";
				getObj('upPanel').style.overflowY="hidden";
			}
			function IFRAME_FORM (obj)
			{
				var tds = obj.contentWindow.document.getElementsByTagName('span') || [];
				var tipText = '';
				for (var i = 0; i < tds.length; i++)
				{
					if (tds[i].className == 'f14')
					{
						tipText = tds[i].innerHTML.replace(/<.+?>/g, '');
						break;
					}
				}
				obj.contentWindow.document.body.innerHTML.indexOf('操作完成') == -1 ? (showDialog('fail', tipText) & SETTOP() & (document.FORM.Submit.disabled = false)) : showDialog('success', '日志发表成功！') & (parent.location.href = 'mode.php?m=o&q=diary') & setEditorContent() & (SETTOP()) & getObj('FORM').reset()
			}
			</script>
			<iframe width=0 height=0 name=formTarget src='javascript:;' onload="IFRAME_FORM(this)"></iframe>
			<form action="{$basename}a=$a" style="padding:10px 0 0 15px;width:100%;height:2000px;background:#FFF;position:absolute;left:0px;top:0px;" method="post" enctype="multipart/form-data" onsubmit="return checkpost(document.FORM);" name="FORM" id="FORM" target="formTarget" />
			<input type="hidden" name="did" value="$did" />
			<input type="hidden" name="dtided" value="$diary[dtid]" />
			<input type="hidden" name="privacyed" value="$diary[privacy]" />
			<input type="hidden" name="atc_autourl" value="1" />
			<input type="hidden" name="step" value="2" />
			<input type="hidden" name="verify" value="$verifyhash" />
			<div>
			<div><!--标题--><input type="text" class="input" name="atc_title" id="atc_title" value="$diary[subject]" size="70"/>&nbsp;<span id="atc_title_warn" class="gray">限 $db_titlemax 字节</span>
			</div>
						<div id="menu_face" class="menu" style="display:none;"></div>
						<div style="padding:10px 0 0;">
						<script language="javascript">
	var imgpath   = 'images';
	var stylepath = 'wind';
	function addsmile(NewCode){
	    document.FORM.atc_content.value += ' [s:'+NewCode+'] ';
	}
	window.onerror=function()
	{
	return true;
	};
</script>
<script language="JavaScript" src="data/bbscache/face.js"></script>
 						<script language="JavaScript" src="js/global.js"></script>
						<script language="JavaScript" src="js/app_global.js"></script>
					<div id="menu_show" style="display:none;"></div>
					<div id="menu_face" class="menu" style="display:none;"></div>
					<script language="JavaScript" src="js/post.js"></script>
							<div id="linkbox" style="display:none;"></div>
							<div class="o-editor" style="width:600px;">
                                <div class="o-operation cc">
                                     <span class="createlink" title="插入url链接" onClick="createLinkBox();" id="createlinkid">插入url链接</span><span class="o-face" id="td_face" style="cursor:pointer;" onClick="showDefault();" align="absmiddle" unselectable="on">添加表情</span>
                                </div>
                               <div class="fl" width="100%"><textarea maxlength="200" id="comm_input_diary_5294_0" name="atc_content" /></textarea></div>
                            </div>
				</div>
				<div class="c"></div>
<!--
EOT;
if ($o_diary_gdcheck) {print <<<EOT
-->
				<div class="mt10">
					认证码:
<input class="input" type="text" name="gdcode" size="5" tabindex="12" onfocus="try{opencode('menu_gd',this)}catch(e){}" /><span style="cursor:pointer; margin-left:3px" onclick="this.previousSibling.focus();">点此显示验证码</span>
					<div class="menu" id="menu_gd" style="visibility:hidden;">
						<img src="ck.php?" align="absmiddle" style="cursor:pointer;" id="ckcode" alt="看不清楚，换一张" />
					</div>
				</div>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if($o_diary_qcheck){print <<<EOT
-->
				<div class="mt10">
				<table cellpadding="0" cellspacing="0" width="600">
					<tr class="f12">
						<td>验证问答:</td>
						<td>
						{$db_question[$qkey]} （正确答案:{$db_answer[$qkey]}）
						<input class="input" name="qanswer" id="qanswer" size="25" tabindex="7" />
						<input type="hidden" name="qkey" id="qkey" value="$qkey" />
						</td>
					</tr>
				</table>
				</div>
<!--
EOT;
}print <<<EOT
-->
		<div style="display:block;padding:10px 0;">
<!--
EOT;
//require_once PrintEot('wysiwyg_editor');
print <<<EOT
-->
				隐私设置&nbsp;
				<select name="privacy" onchange="optionsel(this.value)">
					<option value="0" $privacy_0>全站可见</option>
					<option value="1" $privacy_1>仅好友可见</option>
					<option value="2" $privacy_2>仅自己可见</option>
				</select>
				<span style="display:none;">
				<input id="if_copy" type="checkbox" name="ifcopy" value="1" $checked $disabled>允许好友转载
				<input type="checkbox" name="atc_convert" id="atc_convert" value="1" checked/>Wind Code自动转换
				</span>&nbsp;&nbsp;&nbsp;&nbsp;日志分类 <select name="dtid" id="dtid_add">
					<option value="0" $dtid_0>默认分类</option>
					$dtsel
				</select>
				</div>
				<span class="button" style="margin-left:0;"><span><button name="Submit" type="submit">提 交</button></span></span>
			</div>
			</form>
	</div>
<!--
EOT;
if($a == 'edit'){print <<<EOT
-->
<script language="JavaScript">setTimeout("editor.gotoEnd();",50);</script>
<!--
EOT;
}else{print <<<EOT
-->
<script language="JavaScript">setTimeout("document.FORM.atc_title.focus()",50);</script>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript">var stylepath = 'wind';</script>
<!--
EOT;
if(R_P!=D_P){
$facedb = readover(D_P.'data/bbscache/face.js');
print <<<EOT
-->
<script language="javascript">
{$facedb}
</script>
<!--
EOT;
}else{print <<<EOT
-->
<script language="JavaScript" src="data/bbscache/face.js"></script>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript">
//editor.init();
var cnt  = 0;
document.FORM.Submit.disabled = false;
 SETTOP=function()
	{
	read.menu.style.top='50px';
	};
function checkpost(obj) {

	if (obj.atc_title.value == "") {
		showDialog("error","标题不能为空",2);
		SETTOP();
		obj.atc_title.focus();
		return false;
	} else if (strlen(obj.atc_title.value) > $db_titlemax) {
		showDialog("error","标题超过最大长度 $db_titlemax 个字节",2);
		obj.atc_title.focus();
		SETTOP();
		return false;
	}
	if (strlen(obj.atc_content.value) < $db_postmin) {
		showDialog("error","文章内容少于 $db_postmin 个字节",2);
		editor.focusEditor();
		SETTOP();
		return false;
	} else if (strlen(obj.atc_content.value) > $db_postmax) {
		showDialog("error","文章内容大于 $db_postmax 个字节",2);
		editor.focusEditor();
		SETTOP();
		return false;
	}
	document.FORM.Submit.disabled = true;
	cnt++;
	if (cnt != 1) {
		//showDialog("warning","Submission Processing. Please Wait");
		//SETTOP();
		//return false;
	}

	return true;
}
</script>
<script language="JavaScript" src="js/post.js"></script>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript" src="apps/$appdir/js/diarytype.js"></script>
<script language="JavaScript" src="js/app_comment.js"></script>
<SCRIPT type="text/javascript" LANGUAGE="JavaScript" src="js/core/friendlist.js"></SCRIPT>

<!--
EOT;
if((empty($a) || $a == 'privacy' || $a == 'friend') && !empty($sum)) {print <<<EOT
-->
<SCRIPT type="text/javascript" LANGUAGE="JavaScript" src="js/core/space.js"></SCRIPT>
<!--
EOT;
}print <<<EOT
-->
</div>
<!--
EOT;
exit;

?>-->