<!--<?php
print <<<EOT
-->
<style type="text/css">
/*左边*/
.wy_left{padding:10px;}
.wy_left .wy_face{margin-bottom:5px;}
.wy_left .wy_uid{line-height:18px;color:#3366cc;}
/*边框样式*/
.mb10{margin-bottom:10px;}
.mr50{margin-right:50px;}
.w_title_ip,.menu_select div,.menu_select .hover{border:1px solid;border-color:#aaa #ddd #ddd #aaa;}
.w_title_ip i,.menu_select div{background:url($imgpath/post/c_editor/droparrow.gif) no-repeat right center;padding-right:15px;}
.w_btn,.w_bt,.wy_top_but i,.wy_menu .wy_title{background:url($imgpath/post/c_editor/editor_bg.png) repeat-x;}

/*按钮*/
.w_btn{border:1px solid #ce7201;color:#fff;background-position:0 -60px; background-color:#fcd791; font-weight:700;}
.w_btn,.w_bt{cursor:pointer;padding:2px 12px;*padding:2px 12px 0;;font-size:9pt; line-height:130%; overflow:visible;vertical-align:middle; font-size:14px;}
.w_bt{border:1px solid #ccc; background-position:0 -85px;}

/*编辑器外框架*/
.wind_editor{margin:0 30px 0 0;min-width:700px;background:#fff;}
.tr3 td{padding:5px 10px 5px 0;border-bottom:1px dashed #e4e4e4;}
/*标题栏*/
.w_title_ip{float:left;height:25px;line-height:25px;}
.w_title_ip input{width:340px;float:left;border:0;background:#fff;padding:0 5px;font:14px Arial;vertical-align:middle;margin-top:5px;}
.w_title_ip i{float:left;margin:3px 2px 0;}
.w_input_text{font-style:normal;line-height:18px;padding:0 4px;color:#fff;margin-left:10px; position:absolute;right:-1px;bottom:25px;background:#ff0000;}

#icontab{position:absolute;right:-1px;top:-27px; cursor:pointer;}
#icontab div{background:#f7f7f7;padding:3px 5px;border:1px solid #ccc;line-height:100%;}
/*分类下拉*/
.menu_select{float:left;line-height:25px;height:25px;margin-left:5px;cursor:pointer; font-size:14px;}
.menu_select div{padding-left:10px;background-color:#fff;white-space:nowrap;}
.menu_select ul{height:0;overflow:hidden;float:left;clear:left;padding:0 1px;}
.menu_select li{white-space:nowrap;padding:0 15px 0 10px;}
.menu_select li:hover{background-color:#f2f2f2;}
.menu_select .hover{position:absolute;height:auto;z-index:9999;background:#fff;border-top:0;margin-top:-1px;float:normal;clear:both;padding:0;}
.w_editor_up{background-color:#f8f8f8;padding:5px;}
.w_editor_up td{padding:2px 0 2px 10px;}
.w_editor_up .w_tab_a{padding-left:10px;position:absolute;}
.w_editor_up .w_tab_a li{float:left;margin-right:5px;color:#666;}
.w_editor_up .w_tab_a li a{float:left;display:block;line-height:22px;padding:0 15px;border:1px solid #ddd;color:#666;background-color:#fbf9fa;}
.w_editor_up .w_tab_a li a:hover{background-color:#fff;text-decoration:none;}
.w_editor_up .w_tab_a .none_css a{border:none;background-color:none;line-height:18px;margin-top:2px;}
.w_editor_up .w_tab_a .none_css a:hover{background-color:#f8f8f8;color:#3366cc;}
.w_editor_up .w_tab_a .none_css .wy_tips:hover{color:#666;}
.wy_tips{background:url($imgpath/post/c_editor/w_edit_but.png) right center no-repeat;float:left;}
.wy_tips i{display:none;}
.wy_tips:hover{color:#333;_position:relative;text-decoration:none;}
.wy_tips:hover i{display:block; position:absolute;border:1px solid #f8ad48;background:#fffeed;padding:5px 8px;color:#333;font-style:normal;line-height:150%;word-break:keep-all;word-wrap:no-wrap;}
.w_editor_up .w_tab_a .current a{background:#fff;border-bottom:none;color:#333;padding-bottom:1px;}
.w_editor_up_con{background-color:#ffffff;padding:10px;border-top:1px solid #ddd;}
/*标题栏按钮*/
.wy_top_but{position:absolute;margin-top:-27px;}
.wy_top_but i{font-style:normal;background-position: 0 -85px;padding:0 10px;border:1px solid #ccc; cursor:pointer;line-height:21px;float:left;margin-right:5px;height:21px;overflow:hidden;background-color:#fff; -moz-border-radius:2px;-khtml-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;}
.wy_top_but i.cc{margin-left:30px;}
.wy_top_but i span{padding-right:14px;background:url($imgpath/post/c_editor/droparrow.gif) right center no-repeat;float:left;}
.wy_top_but i.current{border-bottom:1px solid #fff;padding:0 10px 4px 10px;}
/*设置*/
.w_options{padding:10px;border:1px solid #ccc;background:#ffffff;border-top:0;}
.w_options ul{width:160px;border-right:1px solid #e4e4e4;float:left;margin-right:15px;}
.w_options li{line-height:25px;}
.w_options li .input,.w_options li select{margin-right:5px;}

.post-tips{margin-top:5px;background:#fffeed;padding:5px 10px;}
.menu_img{margin-left:-130px;margin-top:20px;}
.menu_img img{width:120px;}
.review_bg:hover{background:#f7f7f7; cursor:default;}
</style>
<!--
EOT;
if((!$db_toolbar || $_COOKIE['toolbarhide']) && $pwForumList){print <<<EOT
-->
<div id="menu_forumlist" style="display:none;">
	<div class="sbar-box-a" style="width:700px;">
		<div class="sbar-title" style="cursor:pointer" onclick="try{pw_bottom.hiddenTab();read.close();}catch(e){read.close();}">
				<span class="menu-hidden aimg">隐藏</span>
				<span id="title_forumlist" class="b">快速浏览</span>
		</div>
		<div class="sbar-box-b">
			<div class="forum-list-popout">
<!--
EOT;
foreach($pwForumList as $key=>$value){print <<<EOT
-->
			<dl class="cc">
				<dt><a href="index.php?cateid=$key">$value[name]</a></dt>
				<dd class="cc">
<!--
EOT;
foreach($value['child'] as $k=>$v){print <<<EOT
-->
					<a href="thread.php?fid=$k" onclick="return pwForumList(true,gIsPost,$k);"><span>$v</span></a>
<!--
EOT;
}print <<<EOT
-->
				</dd>
			</dl>
<!--
EOT;
}print <<<EOT
-->
			</div>
		</div>
	</div>
</div>
<!--
EOT;
}print <<<EOT
-->
<div id="breadCrumb">$msg_guide</div>
<!--
EOT;
if($action=='modify' && ($winduid == $atcdb['authorid'] && $_G['allowdelatc'] || $isGM || pwRights($isBM,'modother'))){print <<<EOT
-->
<form method="post" name="delForm" action="post.php?">
<div class="t5"><table cellpadding="0" cellspacing="0" width="100%">
	<tr><th class="h"><b>修改文章</b></th></tr>
	<tr class="tr3 f_one"><th>删除帖子(此操作不可恢复，请慎重使用！)</th></tr>
	<tr class="tr3 f_one"><th style="border-bottom:0px;">
		<span class="fr" style="padding-right:12px; padding-bottom:5px">
<!--
EOT;
if(($db_gdcheck & 4) && $winddb['postnum'] < $db_postgd){print <<<EOT
-->

		<input class="input" type="text" name="gdcode" size="5" 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_gd1" style="visibility:hidden;"><img src="ck.php?" align="absmiddle" style="cursor:pointer;" id="ckcode" alt="看不清楚，换一张" /></div>
<!--
EOT;
}if($winddb['postnum'] < $postq && $db_question){
$qkey = array_rand($db_question);print <<<EOT
-->
		验证问题: {$db_question[$qkey]} &nbsp;
		<input class="input" type="text" name="qanswer" size="5"/>
		答案:{$db_answer[$qkey]}
		<input type="hidden" name="qkey" value="$qkey" />
<!--
EOT;
}print <<<EOT
-->
		<input class="bt" type="submit" value="直接删除" /></span>
		<font color=red>注意:</font> 如果这个帖子是主题内的第一个帖子且已有人回复此帖，需拥有管理权限才能删除。
		</th>
	</tr>
</table></div>
<input type="hidden" value="1" name="step" />
<input type="hidden" value="$action" name="action" />
<input type="hidden" value="$fid" name="fid" />
<input type="hidden" value="$tid" name="tid" />
<input type="hidden" value="$pid" name="pid" />
<input type="hidden" value="$article" name="article" />
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" value="cn0zz" name="_hexie" />
</form>
<script type="text/javascript">
<!--
EOT;
$tmpVerify = GetVerify($onlineip.$GLOBALS['winddb']['regdate'].$fid.$tid);print <<<EOT
-->
if (document.delForm) document.delForm._hexie.value='$tmpVerify';
</script>
<!--
EOT;
}if ($isGM || ($db_allowupload && $_G['allowupload']) || $attach) {print <<<EOT
-->
<table cellPadding="0" cellSpacing="0" style="display:none" width="100%">
	<tbody id="att_mode"><tr>
		<td class="review_bg"><input class="input" type="file" name="attachment_" style="width:200px;overflow:hidden;"/></td><td><input class="input" type="text" name="atc_desc" size="25" /></td>
		<td><select name="att_special" onchange="newAtt.sel(this);" style="width:60px;"><option value="0"></option><option value="1">加密</option><option value="2">出售</option></select></td>
		<td><select name="att_ctype" style="width:60px;">{$alltype}</select></td>
		<td><input class="input" type="text" name="atc_needrvrc" value="0" size="1" /></td>
		<td></td></tr>
	</tbody>
</table>
<script language="JavaScript">
var allowmutinum = 15;
var allow_ext = '$uploadfiletype';
var attachnum = parseInt('$db_attachnum');
</script>
<script type="text/javascript" language="JavaScript" src="js/upload.js"></script>
<!--
EOT;
}print <<<EOT
-->
<form method="post" id="mainForm" name="FORM" action="post.php?" enctype = "multipart/form-data" onsubmit="return checkpost(document.FORM);">
<input type="hidden" value="$magicname" name="magicname"/>
<input type="hidden" value="$magicid" name="magicid"/>
<input type="hidden" name="verify" value="$verifyhash" />
<script type="text/javascript">
var stylepath = '$stylepath';
var $=function(s){return document.getElementById(s)};
function post_set() {
	var ishide = $('post_set_button').className == 'cc' ? 1 : 0;
	$('post_set_button').className = ishide ? 'current cc' : 'cc';
	$('post_set_box').style.display = ishide ? '' : 'none';
	SetCookie('post_set',ishide);
}
</script>
<div class="t" style="min-width:778px;background:#ffffff;">
<table cellPadding="0" cellSpacing="0" width="100%">
	<tr>
		<td class="h b">发表帖子</td><td class="h tar"><a href="profile.php?action=permission&fid=$fid" title="查看您在本版块的权限" target="_blank" class="fr">版块权限查看</a></td>
	</tr>
	<tr class="vt">
		<td width="185" class="f_two">
			<div class="wy_left">
					<div style="_height:26px;">
<!--
EOT;
if ($action != 'modify' && getstatus($winddb['userstatus'],12)) {print <<<EOT
-->
					<div class="cc menu_userA" id="div_userinfomore"><a href="javascript:;" hidefocus="true" onclick="userBinding.get('div_userinfomore');"><b>$windid</b><img src="$imgpath/pwicon/switch.gif" style="cursor:pointer;" align="absmiddle" /><i>切换帐号</i></a></div>
<script language="JavaScript">
var userinfomorediv = {
	open : function() {
		$('div_userinfomore').className = 'cc menu_userA menu_userAcur';
	},
	close : function () {
		$('div_userinfomore').className = 'cc menu_userA';
	}
}
</script>
<!--
EOT;
}else{
print <<<EOT
-->
	<b style="padding-left:10px;">$windid</b>
<!--
EOT;
}$fp_face = showfacedesign($winddb['icon']);
print <<<EOT
-->
					</div>
					<div style="margin:5px 10px;" class="cc">
                    	<div style="background:#fff;padding:2px;border:1px solid $tdcolor;float:left;">{$fp_face}</div>
                    </div>
			</div>
		</td>
		<td style="padding-left:15px;">
		<div class="wind_editor">
			<div class="wy_top_but cc">
				<i onclick="document.FORM.Submit.click();">发布</i>
				<i onclick="gopreview();">预览</i>
				<!--i onclick="javascript:history.go(-1);" >取消</i-->
				<i id="post_set_button" class="cc" style="width:65px;padding-right:0;" onclick="post_set()"><b></b><span>设置</span></i>
			</div>
			<div class="w_options cc" id="post_set_box" style="display:none">
				<ul>
					<li><input type="checkbox" name="atc_usesign" value="1" checked />&nbsp;使用签名</li>
					<li><input type="checkbox" name="atc_autourl" value="1" checked />&nbsp;自动分析url</li>
					<li><input type="checkbox" name="atc_convert" value="1" checked onclick="editor.setConvert(this)" />&nbsp;WindCode转换</li>
<!--
EOT;
if ($db_replysendmail && $action == 'new') {print <<<EOT
-->
					<li><input type="checkbox" name="atc_email" value="1" />&nbsp;回复邮件通知</li>
<!--
EOT;
}print <<<EOT
-->
				</ul>
				<ul>
					<li><input type="checkbox" name="atc_anonymous" value="1" $ifanonymous />&nbsp;匿名贴</li>
					<li><input type="checkbox" name="atc_hide" value="1" $htmlpost />&nbsp;隐藏此帖(回复可见)</li>
<!--
EOT;
if ($pwpost->isGM || $_G['htmlcode']) {print <<<EOT
-->
					<li><input type="checkbox" name="atc_html" id="atc_html" value="1" $htmcheck onclick="editor.setHtmlMode(this)" />&nbsp;使用html代码</li>
<!--
EOT;
}if($db_replysitemail){print <<<EOT
-->
					<li><input type="checkbox" name="atc_newrp" value="1" $ifmailck />&nbsp;回复站内通知</li>
<!--
EOT;
}print <<<EOT
-->
				</ul>
				<ul style="width:320px;border-right:0;">
<!--
EOT;
if (($action == 'new' || $action == 'vote') && ($pwpost->isGM || pwRights($pwpost->isBM,'typeadmin'))) {print <<<EOT
-->
					<li>精华：<input name="digest" type="radio" value="1" />&nbsp;1&nbsp;&nbsp;<input name="digest" type="radio" value="2" />&nbsp;2&nbsp;&nbsp;<input name="digest" type="radio" value="0" checked />&nbsp;无</li>
<!--
EOT;
}if ($db_topped == 1 && $action == 'new' && ($pwpost->isGM || pwRights($pwpost->isBM,'topped') > 0)) {print <<<EOT
-->
					<li>置顶：<input name="topped" type="radio" value="1" />&nbsp;1
<!--
EOT;
if ($pwpost->isGM || pwRights($pwpost->isBM,'topped') > 1) {print <<<EOT
-->
						&nbsp;<input name="topped" type="radio" value="2" />&nbsp;2
<!--
EOT;
}if ($pwpost->isGM || pwRights($pwpost->isBM,'topped') > 2) {print <<<EOT
-->
						&nbsp;<input name="topped" type="radio" value="3" />&nbsp;3
<!--
EOT;
}print <<<EOT
-->
						&nbsp;<input name="topped" type="radio" value="0" checked />&nbsp;无
<!--
EOT;
}
print <<<EOT
-->
					</li>
<!--
EOT;
if(($pwpost->isGM || pwRights($pwpost->isBM,'replayorder')) && (!$pid || $pid == 'tpc')){print <<<EOT
-->
					<li>回复显示顺序：
						<input type="radio" name="replayorder" value="1" $replayorder_asc>&nbsp;正序
						<input type="radio" name="replayorder" value="2" $replayorder_desc>&nbsp;倒序
						<input type="radio" name="replayorder" value="0" $replayorder_default>&nbsp;默认
					</li>
<!--
EOT;
}print <<<EOT
-->
					<li><input type="checkbox" name="atc_requiresell" id="atc_requiresell" value="1" $htmlsell />出售：<input name="atc_money" type="text" value="0" maxlength="6" size="4" class="input" />
						<select name="atc_credittype" id="attmode_2">$selltype</select>(不能大于:<font color="blue">{$db_sellset[price]}</font>)
						<div class="c"></div>
					</li>
					<li>
						<input type="checkbox" name="atc_requireenhide" id="atc_requireenhide" value="1" $htmlhide />加密：<input name="atc_rvrc" type="text" value="0" class="input" maxlength="6" size="4" />
						<select name="atc_enhidetype" id="attmode_1">$enhidetype</select>以上才能浏览
						<div class="c"></div>
					</li>
				</ul>
			</div>
			<script language="JavaScript">if (FetchCookie('post_set') == '1') post_set();</script>
            <div class="cc" style="padding-top:15px;margin-bottom:5px;">
                <div class="w_title_ip pr">
					<span id="wordtip" style="position:absolute;color:#999;top:-25px;right:0;line-height:2;background:#fff;padding:0 5px;display:none"></span>
                    <input name="atc_title" id="atc_title" value="$atc_title" tabindex="1" title="请输入标题" onkeydown="checktitlelength()" />
                    <i id="icon_button" onclick="show_icontab()" style="cursor:pointer;"><img align="absmiddle" src="$imgpath/post/emotion/$icon.gif" /></i>
                    <div id="icontab" onmouseover="if(icontab==1)icontab=2;" onmouseout="if(icontab==2)icontab=1;" style="display:none;">
                        <input type="hidden" id="atc_iconid" name="atc_iconid" value="$icon" />
                        <div>
                            <img onmouseover="this.className='iconhover'" onmouseout="this.className=''" onclick="seticonid(0,'0.gif')" align="absmiddle" src="$imgpath/post/emotion/0.gif" />
<!--
EOT;
foreach ($icondb as $key => $value) {print <<<EOT
-->
                            <img onmouseover="this.className='iconhover'" onmouseout="this.className=''" onclick="seticonid('$key','$value')" align="absmiddle" src="$imgpath/post/emotion/$value" />
<!--
EOT;
}print <<<EOT
-->
                        </div>
                    </div>
                    <span class="w_input_text" style="display:none;" id="atc_title_warn"></span>
                </div>
<!--
EOT;
if ($article == '0' && (($t_per>0 || $pwpost->admincheck) && $t_db && !$modelid && !$pcid)) {print <<<EOT
-->
                <div class="menu_select" id="td_p_type">
                    <div id="p_type_v" onclick="showPtypeSelect();">分类</div>
                    <ul id="menu_p_type" style="max-height:150px;overflow:hidden;overflow-y:auto;">
                        <li onclick="selectPtype(0)">分类</li>
<!--
EOT;
foreach ($t_db as $key => $value) {
if ($value['upid'] == 0) {print <<<EOT
-->
                        <li onclick="selectPtype('$key')">$value[name]</li>
<!--
EOT;
}}print <<<EOT
-->
                    </ul>
                </div>
                <div class="menu_select" id="td_p_sub_type" style="display:none">
                    <div id="p_sub_type_v" onclick="showPsubtypeSelect();">分类</div>
                    <ul id="menu_p_sub_type" style="max-height:150px;overflow:hidden;overflow-y:auto;"></ul>
                </div>
                <div class="c"></div>
<input type="hidden" name="p_type" value="" /><input type="hidden" name="p_sub_type" value="" />
<script language="JavaScript">
(function() {
var t_db = JSONParse('$tdbJson');
var t1,t2 = null;
$('td_p_type').onmouseout = function() {t1 = setTimeout(closePtypeSelect,100);}
$('td_p_type').onmouseover = function() {clearTimeout(t1);}
$('td_p_sub_type').onmouseout = function() {t2 = setTimeout(closePsubtypeSelect,100);}
$('td_p_sub_type').onmouseover = function() {clearTimeout(t2);}
showPtypeSelect = function() {
    if ($('menu_p_type').className != 'hover') {
        $('p_type_v').style.width = $('menu_p_type').offsetWidth - 27 + 'px';
        $('menu_p_type').className = 'hover';
    } else {
        closePtypeSelect();
    }
}
showPsubtypeSelect = function() {
    if ($('menu_p_sub_type').className != 'hover') {
        $('p_sub_type_v').style.width = $('menu_p_sub_type').offsetWidth - 27 + 'px';
        $('menu_p_sub_type').className = 'hover';
    } else {
        closePsubtypeSelect();
    }
}
closePtypeSelect = function() {
    $('menu_p_type').className = '';
    var v = document.FORM.p_type.value;
    $('p_type_v').innerHTML = typeof t_db[v] == 'undefined' ? '分类' : t_db[v]['name'];
}
closePsubtypeSelect = function() {
    $('menu_p_sub_type').className = '';
    var v = document.FORM.p_sub_type.value;
    $('p_sub_type_v').innerHTML = typeof t_db[v] == 'undefined' ? '分类' : t_db[v]['name'];
}
selectPtype = function(v) {
    if (typeof t_db[v] == 'undefined') {
        document.FORM.p_type.value = 0;
    } else {
        document.FORM.p_type.value = v;
        if (typeof t_db[v]['sub'] != 'undefined') {
            $('td_p_sub_type').style.display = '';
            var sub = t_db[v]['sub'];
            var html = '<li onclick="selectPsubtype(0)">分类</li>';
            for (var i = 0; i < sub.length; i++) {
                html += "<li onclick=\"selectPsubtype('" + sub[i] + "')\">" + t_db[sub[i]]['name'] + '</li>';
            }
            $('menu_p_sub_type').innerHTML = html;
            showPsubtypeSelect();
        } else {
            $('td_p_sub_type').style.display = 'none';
        }
        selectPsubtype(0);
    }
    closePtypeSelect();
    try{event.cancelBubble = true;}catch(e){}
}
selectPsubtype = function (v) {
    document.FORM.p_sub_type.value = typeof t_db[v] == 'undefined' ? 0 : v;
    closePsubtypeSelect();
    try{event.cancelBubble = true;}catch(e){}
}
showPtype = function(v) {
    if (typeof t_db[v] != 'undefined') {
        if (t_db[v]['upid'] == '0') {
            selectPtype(v);
        } else {
            selectPtype(t_db[v]['upid']);
            selectPsubtype(v);
        }
    }
}
})();
</script>
<!--
EOT;
if ($action == 'modify' && $atcdb['type']) {print <<<EOT
-->
<script language="JavaScript">window.onReady(function(){showPtype('$atcdb[type]');});</script>
<!--
EOT;
}}if(($action == "reply" || $action == "quote") && $tpcarray['special'] == 5){print <<<EOT
-->
				<select name="standpoint" style="width:80px;height:30px;">
<!--
EOT;
if($debatestand != 2){print <<<EOT
-->
                    <option value="1" $debate_1>正方观点</option>

<!--
EOT;
}if($debatestand != 1){print <<<EOT
-->
                    <option value="2" $debate_2>反方观点</option>
<!--
EOT;
}print <<<EOT
-->
                    <option value="0" $debate_0>闲聊一下</option>
                </select>

<!--
EOT;
}if ($modelid > 0 || $pcid > 0) {print<<<EOT
-->
				<div>$selectmodelhtml</div>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if($db_sitemsg['post']['0'] && $action == 'new'){print<<<EOT
-->
            <div class="c">&nbsp;</div><div class="fl post-tips">{$db_sitemsg['post'][array_rand($db_sitemsg['post'])]}</div>
<!--
EOT;
}if($db_sitemsg['reply']['0'] && $action == 'reply'){print<<<EOT
-->
            <div class="c">&nbsp;</div><div class="fl post-tips">{$db_sitemsg['reply'][array_rand($db_sitemsg['reply'])]}</div>
<!--
EOT;
}print <<<EOT
-->
            </div>
<!--
EOT;
if ($special) {print <<<EOT
-->
            <div class="mb10">
<!--
EOT;
require_once PrintEot('post_special');
print <<<EOT
-->
            </div>
<!--
EOT;
}if ($topichtml) {print <<<EOT
-->
            <div class="mb10">$topichtml
<script language="javascript">
function ifalipay(value) {
if (value == 1) {
    ajax.send('pw_ajax.php?action=pcifalipay','',function(){
        var rText = ajax.request.responseText.split('\t');
        if(rText[0] == 'fail') {
            showDialog('warning','您还没有支付宝帐号，请到管理中心的<a href="profile.php?action=modify&info_type=trade" target="_blank"><span style="color:red;">账号设置</span></a>添加');
        } else {
            return false;
        }
    });
} else {
    return false;
}
}
function pcdelimg(id,fieldname,pctype) {
ajax.send('pw_ajax.php?action=pcdelimg','id='+id+'&fieldname='+fieldname+'&pctype='+pctype+'&tid='+'$tid',function(){
    var rText = ajax.request.responseText;
    if (rText == 'success') {
        showDialog('success','删除成功!',2);
        getObj('img_'+fieldname).style.display = 'none';
    } else {
        showDialog('error','非法操作',2);
        return false;
    }
});
}
</script>
            </div>
<!--
EOT;
}print<<<EOT
-->
            <div class="pr cc mb10">
<!--
EOT;
require_once PrintEot('wysiwyg_editor');
if ($db_windmagic && ($action=='new' || ($action=='modify' && $pid == 'tpc'))) {print <<<EOT
-->
<style>
.lhcl_slideImage{width:50px;height:50px;cursor:pointer;border:1px solid #fff;}
.lhcl_selectBox{width:50px;height:50px;cursor:pointer;border:1px solid #36c;}
</style>
                <div class="wy_menu" id="magicsmiliebox" style="width:76px;display:none;top:57px;left:-90px;">
                    <div class="wy_title">动漫表情</div>
                    <div class="wy_left_con">
                    <div id="menu_magicshow"></div>
                    <p><a href="javascript:;" onclick="previewMagic()">预览</a> <a id="btnc" href="javascript:;" onclick="setMagic(this.id);getObj('magicsmiliebox').style.display='none';">取消</a></p>
                    </div>
                </div>
                <div id="menu_magicsmile" class="menu" style="display:none;"></div>
<script language="javascript">var mDef = { $mDef };</script>
<script type="text/javascript" src="js/magic.js"></script>
<!--
EOT;
}print <<<EOT
-->

            </div>
<!--
EOT;
if ($isGM || $db_allowupload && $_G['allowupload']) {print <<<EOT
-->
            <div class="mb10">
                <div class="w_editor_up">
                    <div style="height:23px;">
                    <div style="line-height:18px;padding:5px 0 0 10px;*padding:3px 0 0 10px;" class="fr"></div>
                    <ul class="w_tab_a cc">
                        <li class="current" id="formUploadBtn"><a href="javascript:;" hidefocus="true">普通上传</a></li>
                        <li id="batUploadBtn"><a href="javascript:;" hidefocus="true">批量上传</a></li>
<!--
EOT;
if ($mutiupload > 0) {print <<<EOT
-->
                        <li id="flashAtt_use" class="none_css"><a href="javascript:;" onclick="flashAtt.use();" hidefocus="true" style="padding-right:0;">已有附件($mutiupload)</a></li>
                        <li id="flashAtt_clear" class="none_css"><a href="javascript:;" onclick="flashAtt.clear();" hidefocus="true">清空已有附件&nbsp;</a></li>
<!--
EOT;
}print <<<EOT
-->
						<li style="width:150px;"><table class="fl"><tr><td style="padding:5px 0 0 10px;*padding:0 0 0 10px;width:16px;"><input align="absbottom" name="atc_hideatt" type="checkbox" value="1" $htmlatt /></td><td style="padding:2px 0 0 0;">隐藏附件(回复可见)</td></tr></table></li>
						<li class="none_css"><a href="javascript:;" class="wy_tips" style="padding-right:14px;">&nbsp;可上传类型<i style="width:250px;">$uploadfilesize</i></a></li>
                    </ul>
                    </div>
<script type="text/javascript">
$('formUploadBtn').onclick = function() {
var a=$('attach').getElementsByTagName("tr");
$('batUpload').style.display='none'
a[a.length-1].style.display='';
$('batUploadBtn').className="";
this.className="current";
};
$('batUploadBtn').onclick = function() {
var a=$('attach').getElementsByTagName("tr");
$('batUpload').style.display=''
a[a.length-1].style.display='none';
$('formUploadBtn').className="";
this.className="current";
};
</script>
                    <div class="w_editor_up_con">
<!--
EOT;
if($attach){print <<<EOT
-->
						<div class="cc">该帖包含附件<span class="gray">(不想保留的附件去掉√)</span> :
							<table class="tr_p10">
								<tr class="gray">
									<td width="11"></td>
									<td width="186">附件</td>
									<td width="180">描述</td>
									<td width="65">售/密</td>
									<td width="65">积分</td>
									<td width="60">价格</td>
									<td width="100"></td>
								</tr>
								<tbody id="ajaxtable"></tbody>
							</table>
						</div>
<script language="JavaScript">
var attachs = {{$attach}};
oldAtt.init();
</script>
<!--
EOT;
}if($isGM || $db_allowupload && $_G['allowupload']){print <<<EOT
-->
                        <div class="cc">
                            <table id="uploadFileInfo" class="uploadFileInfo" style="display:none;margin-bottom:10px;">
                                <tr class="s1">
                                    <td>文件名</td><td width="15%">大小</td><td width="20%">上传进度</td><td width="5%">删</td>
                                </tr>
                                <tbody id="qlist"></tbody>
                            </table>
                            <table class="tr_p10">
                                <tr valign="top" id="formUpload" class="gray">
                                    <td width="200">上传附件 (图片、文件等)</td>
                                    <td width="180">描述</td>
                                    <td width="65">售/密</td>
                                    <td width="65">积分</td>
                                    <td width="60">价格</td>
                                    <td width="100">&nbsp;</td>
                                </tr>
                                <tbody id="attach"></tbody>
                            </table>
                            <div id="viewimg" class="menu menu_img" style="display:none;"></div>
                        </div>
                        <div id="batUpload" style="display:none;">
                            <div style="width:100%;padding:0 0 2px 10px;"><div id="flashUploadPanel" style="width:196px;height:24px;"></div></div>
                        </div>
                        <div class="c"></div>
<script language="JavaScript">
var mutiupload = '$mutiupload';
flashAtt.init();
newAtt.create();
</script>
<!--
EOT;
}print <<<EOT
-->
                    </div>
                </div>
            </div>
<!--
EOT;
}if($db_iftag && ($action=='new' || $action=='modify' && $pid=='tpc')){print <<<EOT
-->
            <div class="cc mb10">
                <script type="text/javascript" language="JavaScript" src="js/pw_tags.js"></script>
                <div><input id="atc_tags" class="input fl" name="atc_tags" size="40" value="$tags" tabindex="3" style="font:12px Tahoma;padding-left:2px;margin-right:5px;" autocomplete="off" onfocus="tag.init();" /><input type="button" class="bt fl" value="自动提取" onclick="tag.get()" /><a href="javascript:;" class="wy_tips" style="padding-right:14px;margin:3px 0 0 10px;">标签之间空格隔开，限5个。&nbsp;什么是标签<i style="width:200px;">标签是您给您的文章指定的关键字，设置适当的标签能便于他人快速的找到您的文章</i></a></div>
                <div class="c"></div>
                <fieldset id="tagmenu" style="border:1px solid $tdcolor;width:500px;padding:3px;margin:2px 0;display:none;"><legend>热门标签</legend><div style="height:80px;overflow-Y:auto;"></div></fieldset>
            </div>
<!--
EOT;
}if (($db_gdcheck & 4 && $winddb['postnum'] < $db_postgd) || $winddb['postnum'] < $postq && $db_question) {print <<<EOT
-->
            <div class="cc mb10">
                <div class="marginLeft">
<!--
EOT;
if(($db_gdcheck & 4) && $winddb['postnum'] < $db_postgd){print <<<EOT
-->
<span class="mr50"><input class="input" type="text" name="gdcode" size="8" tabindex="2" onfocus="try{opencode('menu_gd',this)}catch(e){}" /><span id="ckcode" 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></span>
<!--
EOT;
}if($winddb['postnum'] < $postq && $db_question){
$qkey = array_rand($db_question);print <<<EOT
-->
验证问题:{$db_question[$qkey]} &nbsp;答案:{$db_answer[$qkey]}&nbsp;&nbsp;<input class="input" type="text" name="qanswer" />
<input type="hidden" name="qkey" value="$qkey" />
<!--
EOT;
}print <<<EOT
-->
                </div>
            </div>
<!--
EOT;
}print <<<EOT
-->
            <div style="margin-bottom:30px;">
                <input name="Submit" type="submit" class="w_btn" value=" 发 布 " />&nbsp;
                <input type="button" onclick="gopreview();" class="w_bt" value=" 预 览 " />&nbsp;
                <input type="button" onclick="savedraft()" class="w_bt" value=" 存为草稿 " />
            </div>
         </div>
        </td>
	</tr>
</table>
</div>
<!--
EOT;
if($modelid > 0 || $pcid > 0){print<<<EOT
-->
	<script language="JavaScript">Form.validate("FORM");</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
-->
<div id="menu_face" class="menu" style="display:none;"></div>
<div id="menu_generalface" class="menu" style="display:none;"></div>

<script type="text/javascript">editor.init('$editor', IsChecked('atc_html') ? 1 : 0);</script>
<input type="hidden" value="2" name="step" />
<input type="hidden" value="$pid" name="pid" />
<input type="hidden" value="1" name="atc_convert" />
<input type="hidden" value="$action" name="action" />
<input type="hidden" value="$fid" name="fid" />
<input type="hidden" value="$tid" name="tid" />
<input type="hidden" value="$article" name="article" />
<input type="hidden" value="$special" name="special" />
<input type="hidden" value="cn0zz" name="_hexie" />
<script type="text/javascript">
<!--
EOT;
$tmpVerify = GetVerify($onlineip.$GLOBALS['winddb']['regdate'].$fid.$tid);print <<<EOT
-->
document.FORM._hexie.value='$tmpVerify';
</script>
<!--
EOT;
if($action == 'reply' || $action == 'modify' || $action == 'quote'){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;
}if($special=='1' || $special=='2' || $special=='5'){ print <<<EOT
-->
<script language="JavaScript" src="js/date.js"></script>
<!--
EOT;
}print <<<EOT
-->
</form>
<form name="preview" action="job.php?action=preview" method="post" target="preview_page">
	<input type="hidden" name="atc_content" value="" />
	<input type="hidden" name="atc_title" value="" />
	<input type="hidden" name="pcinfo" value="" />
	<input type="hidden" name="pcid" value="$pcid" />
	<input type="hidden" name="modelid" value="$modelid" />
</form>
<script language="JavaScript">
var icontab=0;
function show_icontab() {
	if (icontab <= 0) {
		getObj('icontab').style.display = '';
		icontab = 1;
	} else {
		getObj('icontab').style.display = 'none';
		icontab = 0;
	}
}
function seticonid(iconid,iconurl) {
	getObj('atc_iconid').value=iconid;
	getObj('icontab').style.display='none';
	icontab = -1;
	getObj('icon_button').innerHTML = '<img align="absmiddle" src="$imgpath/post/emotion/'+iconurl+'" />';
}
function set_ptype(id,ptype) {
	getObj('td_ptype').innerHTML = ptype + '<img align="absmiddle" src="$imgpath/menu-down.gif" />';
	getObj('p_type').value = id;
	closep();
}
var cate = '$db_forcetype'; //是否强制分类，开启设为1，关闭设为0；
var cnt  = 0;

document.FORM.Submit.disabled = false;
function checktitlelength(){
	setTimeout(function(){
	var l = strlen($('atc_title').value);
	if(l<$db_titlemax&&l>$db_titlemax-20)
	{
		$('wordtip').innerHTML='剩余'+($db_titlemax-l)+'个字';
		$('wordtip').style.backgroundColor='#fffeed';
		$('wordtip').style.display='inline';
	}
	else if(l==$db_titlemax)
	{
		$('wordtip').innerHTML='已经达到最大字数限制';
		$('wordtip').style.backgroundColor='#ffd9d9';
		$('wordtip').style.display='inline';
	}
	else if(l>=$db_titlemax)
	{
		$('wordtip').innerHTML='已经超过最大字数限制！';
		$('wordtip').style.backgroundColor='#ff9999';
		$('wordtip').style.display='inline';
	}
	else
		$('wordtip').style.display='none';
	},100);
}
function checkpost(obj) {
	if (obj.p_type != null && obj.p_type.value==0 && cate==1) {
		showDialog("error","没有选择主题分类",2);
		obj.atc_title.focus();
		return false;
	}
	if (obj.atc_title.value == "") {
		obj.atc_title.setAttribute("hasError", 1);
		showDialog("error","标题不能为空",2);
		obj.atc_title.focus();
		return false;
	} else if (strlen(obj.atc_title.value) > $db_titlemax) {
		obj.atc_title.setAttribute("hasError", 1);
		showDialog("error","标题超过最大长度 $db_titlemax 个字节",2);
		obj.atc_title.focus();
		return false;
	}
	if (strlen(obj.atc_content.value) < $db_postmin) {
		obj.atc_content.setAttribute("hasError", 1);
		showDialog("error","文章内容少于 $db_postmin 个字节",2);
		editor.focusEditor();
		return false;
	} else if (strlen(obj.atc_content.value) > $db_postmax) {
		obj.atc_content.setAttribute("hasError", 1);
		showDialog("error","文章内容大于 $db_postmax 个字节",2);
		editor.focusEditor();
		return false;
	}
	try{obj.atc_title.removeAttribute("hasError");
	obj.atc_content.removeAttribute("hasError");}catch(e){}

	document.FORM.Submit.disabled = true;
	cnt++;
	if (cnt != 1) {
		showDialog("warning","Submission Processing. Please Wait");
		return false;
	}
	return true;
}
function gopreview() {
	editor.setMode();
	document.preview.atc_content.value=document.FORM.atc_content.value;
	document.preview.atc_title.value=document.FORM.atc_title.value;
	var elements = document.FORM.elements;
	var pcinfo = '';
	for (var i = 0,len = elements.length; i < len; i++) {
		if (elements[i].type == 'radio' || elements[i].type == 'checkbox') {
			if (elements[i].checked == true) {
				pcinfo += elements[i].name + '(|)' + elements[i].value + '(|)' + elements[i].id + '{|}';
			}
		} else {
			pcinfo += elements[i].name + '(|)' + elements[i].value + '(|)' + elements[i].id + '{|}';
		}

	}
	document.preview.pcinfo.value=pcinfo;
	document.preview.submit();
}

function changeShowTip(obj) {
	if(getObj('show_tip_img').src.indexOf('showNormal')>=0) {
		setTimeout("changeShowTipImg('$imgpath/showAll.gif')", 200);
		obj.previousSibling.nextSibling.innerHTML='显示全部设置';
		showItems(0);
	}else{
		setTimeout("changeShowTipImg('$imgpath/showNormal.gif')", 200);
		obj.previousSibling.nextSibling.innerHTML='只显示常用';
		showItems(1);
	}
}
function changeShowTipImg(path) {
	getObj('show_tip_img').src = path;
}

//initCheckTextNum('atc_title','atc_title_warn',parseInt('$db_titlemax'),true);

/*增加一标识，用于ie6，在页面未记载完成时操作的判断
var IE6=navigator.userAgent.indexOf("MSIE 7.0")==-1&&navigator.userAgent.indexOf("MSIE 8.0")==-1&&navigator.userAgent.indexOf("MSIE 6.0")>0;
if(IE6) {
	var wl=window.onload;
	window.onload=function()
	{
		wl?wl():0;
		WINDOW_LOADED=1;
		$("wy_windcode")?($("wy_windcode").disabled=false)&($("wy_htmlmode").disabled=false):0;
	};
}
else
{
	WINDOW_LOADED=1;
	$("wy_windcode")?($("wy_windcode").disabled=false)&($("wy_htmlmode").disabled=false):0;
}*/
</script>
<!--
EOT;
if($action=="reply" || $action=="quote"){print <<<EOT
-->
<br /><center>主题回顾</center>$post_reply
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript" src="js/post.js"></script>
<script language="JavaScript">
var dataStorage = {
	save : function() {
		if (PwStorage.save('msg', editor._editMode == 'textmode' ? editor.getHTML() : htmltocode(editor.getHTML()))) {
			PwStorage.save('title', document.FORM.atc_title.value, 1);
			SetCookie('ds', 1);
			return true;
		}
		return false;
	},
	load : function() {
		document.FORM.atc_title.value = PwStorage.load('title') || '';
		setEditorContent(PwStorage.load('msg'));
		SetCookie('ds', 0);
	}
}
if (FetchCookie('ds') == 1) {
	try{dataStorage.load();}catch(e){}
}
</script>
<div id="previewmagic" style="position:absolute;z-index:999999;display:none;"></div>
<div class="c"></div>
<!--
EOT;
?>-->