<!--<?php
$class1 = $editor == 'wysiwyg' ? 'buttonPressed' : '';
$class2 = $editor == 'wysiwyg' ? '' : 'buttonPressed';
$style1 = $db_pwcode ? '' : 'none';
$style2 = $db_setform ? '' : 'none';
print <<<EOT
-->
<style type="text/css">
#editor-content{width:100%;border:1px solid $tablecolor;margin-top:28px;position:relative;}
#editor-tab{position:absolute;margin:-22px 0 0 0;}
#editor-tab span{font-family:verdana;border:1px solid $tdcolor;height:20px;border-bottom:0;margin-left:5px;float:left;width:130px;text-align:center;line-height:22px;overflow:hidden;cursor:pointer; background:$forumcolorone}
#editor-tab span.buttonHover{border-color:$tablecolor;}
#editor-tab span.buttonPressed{height:21px;background:$forumcolortwo;font-weight:bold;border-color:$tablecolor;border-right-width:2px;}
#editor-button{width:100%;padding:.6em 0 .5em;float:left;border-bottom:1px solid $tdcolor;background:$forumcolortwo;position:relative}
.c{clear:both;height:0;font:0/0 A;}
#editor-tool{position:absolute;right:0;margin-top:-22px;margin-left:270px;}
#editor-tool span{height:18px;float:left;padding:0 .5em;line-height:19px;border:1px solid $tdcolor;overflow:hidden;margin-left:.2em;cursor:pointer}
#editor-tool span a{color:}
.editor-button span{width:18px;height:18px;border:1px solid $forumcolortwo;background:url($imgpath/post/c_editor/editor-icon.gif);margin-left:1px;float:left;overflow:hidden;text-indent:-2000em}
.editor-button span.separator{background-position:0 -720px; width:14px}
#wy_bold{background-position:0 0;}
#wy_italic{background-position:0 -20px}
#wy_underline{background-position:0 -40px}
#wy_strikethrough{background-position:0 -60px}
#wy_subscript{background-position:0 -80px}
#wy_superscript{background-position:0 -100px}
#wy_copy{background-position:0 -120px;}
#wy_cut{background-position:0 -140px}
#wy_paste{background-position:0 -160px}
#wy_removeformat{background-position:0 -180px}
#wy_undo{background-position:0 -200px}
#wy_redo{background-position:0 -220px}
#wy_quote{background-position:0 -240px}
#wy_code{background-position:0 -260px}
#wy_post{background-position:0 -280px}
#wy_sell{background-position:0 -300px}
#wy_inserthorizontalrule{background-position:0 -320px}
#wy_br{background-position:0 -340px}
#wy_justifyleft{background-position:0 -360px}
#wy_justifycenter{background-position:0 -380px}
#wy_justifyright{background-position:0 -400px}
#wy_justifyfull{background-position:0 -420px}
#wy_forecolor{background-position:0 -440px}
#wy_hilitecolor{background-position:0 -460px}
#wy_insertorderedlist{background-position:0 -480px}
#wy_insertunorderedlist{background-position:0 -500px}
#wy_outdent{background-position:0 -520px}
#wy_indent{background-position:0 -540px}
#wy_createlink{background-position:0 -560px}
#wy_unlink{background-position:0 -580px}
#wy_insertimage{background-position:0 -600px}
#wy_media{background-position:0 -620px}
#wy_sale{background-position:0 -640px}
#wy_inserttable{background-position:0 -660px}
#wy_pwcode{background-position:0 -680px}
#wy_setform{background-position:0 -700px}

#colorbox{width:91px;height:78px;padding:3px 0 0 3px;overflow:hidden;}
#colorbox div{cursor:pointer;width:8px;height:8px;float:left;margin:0 3px 3px 0;border:1px #000 solid;font:0/8px arial}
.wysiwyg{padding-right:7px;_padding-right:0px;_width:99%;}
@media all and (min-width: 0px){.wysiwyg {padding-right:0px;}}
/*\*//*/
.wysiwyg { padding-right:5px;}
/**/
.htmlarea{background:$forumcolorone;}
.editor-button span.buttonHover{padding:0;border:1px solid #F0F0EE;border-color:ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;}
.editor-button span.buttonActive, .editor-button span.buttonPressed{padding:0;border:1px solid #ccc;background-color:#fff;border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;}
.editor-button span.buttonPressed{padding:0}
.indicator{padding:0px;overflow:hidden;width:18px;text-align:center;cursor:default;border:1px solid ButtonShadow;}
.buttonDisabled{filter: alpha(opacity = 25);opacity: 0.25;}
.select{margin:0;cursor:pointer;width:45px;line-height:16px;float:left}
.textareaie6{width:100%;}
</style>

<div id="editor-content">
	<div id="editor-tab"><span id="wy_windcode" class="$class2" onclick="ajax.send('pw_ajax.php?action=changeeditor&editor=0&');" >WindCode</span><span id="wy_htmlmode" class="$class1" onclick="ajax.send('pw_ajax.php?action=changeeditor&editor=1&');">所见即所得</span>
		<div class="c" style="width:540px"></div>
	</div>
	<div id="editor-tool"> <span><a onClick="checklength(document.FORM,'$db_postmax');">字数检查</a></span><span><a onClick="loadData('msg');">恢复数据</a></span><span><a onClick="savedraft();">存为草稿</a></span><span><a onClick="opendraft(this.id);" id="newdraft">草稿箱</a></span></div>
	<div class="c"></div>
	<div id="editor-button">
		<div style="position:absolute; right:.2em; bottom:.2em"><img onClick="flex(0);" align="absmiddle" src="$imgpath/post/c_editor/resize_0.gif" style="cursor:pointer;padding:5px 0; border:$tablecolor 1px solid "/><img onClick="flex(1);" align="absmiddle" src="$imgpath/post/c_editor/resize_1.gif" style="cursor:pointer;padding:5px 0; border:$tablecolor 1px solid ; margin:0 0 0 .2em"/></div>
		<div class="c"></div>
		<div style="padding:0 0 0 .3em;">
			<div class="fl" style=" width:178px;padding:0 1px 0 6px;height:20px;overflow:hidden; vertical-align:text-bottom;">
			<span class="select" id="wy_fontname" style="*padding-top:2px;width:82px; line-height:16px"><span unselectable="on" style="float:left; background:url($imgpath/wind/menu-down.gif) right 3px no-repeat; padding-right:10px; margin-right:3px">字体</span></span>
			<span class="select" id="wy_fontsize"><span unselectable="on">字号</span><img src="$imgpath/wind/menu-down.gif" /></span>
			<span class="select" id="wy_formatblock"><span unselectable="on">格式</span><img src="$imgpath/wind/menu-down.gif" /></span> </div>
			<span class="editor-button"><span id="wy_undo" title="撤消">撤消</span> <span id="wy_redo" title="恢复">恢复</span> <span class="separator"></span> <span id="wy_copy" title="复制">复制</span> <span id="wy_cut" title="剪切">剪切</span> <span id="wy_paste" title="粘贴">粘贴</span> <span id="wy_removeformat" title="去除字体格式">去除字体格式</span> <span class="separator"></span> <span id="wy_insertimage" title="插入图片">插入图片</span> <span id="wy_media" title="插入多媒体">插入多媒体</span> <span id="wy_sale" title="发表交易帖">发表交易帖</span> <span id="wy_inserttable" title="插入表格">插入表格</span> <span class="separator"></span> <span id="wy_quote" title="插入引用">插入引用</span> <span id="wy_code" title="插入代码">插入代码</span> <span id="wy_post" title="隐藏内容,回复可见">隐藏内容,回复可见</span> <span id="wy_sell" title="出售内容">出售内容</span>
			<div class="c" style="height:2px"></div>
			<span id="wy_bold" title="粗体">粗体</span> <span id="wy_italic" title="斜体">斜体</span> <span id="wy_underline" title="下划线">下划线</span> <span id="wy_strikethrough" title="删除线">删除线</span> <span id="wy_inserthorizontalrule" title="插入水平线">插入水平线</span> <span id="wy_br" title="换行">换行</span> <span class="separator"></span> <span id="wy_justifyleft" title="左对齐">左对齐</span> <span id="wy_justifycenter" title="居中">居中</span> <span id="wy_justifyright" title="右对齐">右对齐</span> <span id="wy_justifyfull" title="左右平等">左右平等</span> <span class="separator"></span> <span id="wy_forecolor" title="字体颜色">字体颜色</span> <span id="wy_hilitecolor" title="背景颜色">背景颜色</span><span id="wy_createlink" title="插入url链接">插入url链接</span> <span id="wy_unlink" title="删除链接">删除链接</span> <span class="separator"></span> <span id="wy_insertorderedlist" title="有序列表">有序列表</span> <span id="wy_insertunorderedlist" title="无序列表">无序列表</span> <span id="wy_outdent" title="取消缩进">取消缩进</span> <span id="wy_indent" title="缩进">缩进</span> <span class="separator"></span> <span id="wy_pwcode" title="自定义代码" style="display:$style1">自定义代码</span> <span id="wy_setform" title="帖子格式" style="display:$style2">帖子格式</span><div style="float:left;width:90px"> <span id="wy_subscript" title="下标">下标</span> <span id="wy_superscript" title="上标">上标</span> </div>
			</span></div>
		<div class="c"></div>
	</div>
	<div class="c"></div>
	<div class="wysiwyg">
		<div class="menu" id="menu_editor" style="display:none;"></div>
		<textarea id="textarea" name="atc_content" class="textareaie6" style="margin:0;border:none;height:300px;">{$atc_content}</textarea>
	</div>
</div>
<div class="fr gray" id="textarea_warn">
<!--
EOT;
if ($db_postmax) {print <<<EOT
-->
限 $db_postmax 字节
<!--
EOT;
}print <<<EOT
-->
</div>
<script language="JavaScript" src="js/wind_c_editor.js"></script>
<script type="text/javascript">
var charset='$db_charset';
var editor = null;
var bbsurl ="{$B_url}";
var postmax = '$db_postmax';
WYSIWYD.Config = function () {
	this.baseURL = document.baseURI || document.URL;
	if(this.baseURL && this.baseURL.match(/(.*)\/([^\/]?)/)){
		this.baseURL = RegExp.$1 + "/";
	}
	this.imgURL = imgpath + "/post/c_editor/";
	
	this.btnList = {
		removeformat:[ false, editorcode, false ],
		bold: [ true, editorcode, true ],
		italic: [ true, editorcode, true ],
		underline: [ true, editorcode, true ],
		strikethrough: [ true, editorcode, true ],
		subscript: [ true, editorcode, true ],
		superscript: [ true, editorcode, true ],
		justifyleft: [ true, editorcode, true ],
		justifycenter: [ true, editorcode, true ],
		justifyright: [ true, editorcode, true ],
		justifyfull: [ true, editorcode, true ],
		insertorderedlist: [ true, editorcode, true ],
		insertunorderedlist: [ true, editorcode, true ],
		outdent: [ true, editorcode, false ],
		indent: [ true, editorcode, false ],
		forecolor: [ true, showcolor, false ],
		hilitecolor: [ true, showcolor, false ],
		inserthorizontalrule: [ true, editorcode, false ],
		createlink: [ true, showcreatelink, false ],
		unlink: [ true, editorcode, false ],
		insertimage: [ true, insertImage, false ],
		inserttable: [ false, showTable, false ],
		windcode: [ true, editorcode, false ],
		htmlmode: [ true, editorcode, false ],
		undo: [ false, editorcode, false ],
		redo: [ false, editorcode, false ],
		cut: [ false, editorcode, false ],
		copy: [ false, editorcode, false ],
		paste: [ false, editorcode, false ],
		media: [ true, rming, false ],
		quote: [ true, code, false ],
		code: [ true, code, false ],
		post: [ true, code, false ],
		sell: [true, sell, false ],
		br: [ false, br, false ],
		sale: [ true, showsale, false ],
		pwcode: [true, extend , false ],
		setform: [true, extend , false ]
	};
	this.fontname = {
		"default": "字体",
		"宋体":	'宋体',
		"新宋体":	'新宋体',
		"楷体_GB2312":	'楷体_GB2312',
		"黑体":	'黑体',
		"Arial":	   'arial,helvetica,sans-serif',
		"Courier New":	   'courier new,courier,monospace',
		"Georgia":	   'georgia,times new roman,times,serif',
		"Tahoma":	   'tahoma,arial,helvetica,sans-serif',
		"Times New Roman": 'times new roman,times,serif',
		"Verdana":	   'verdana,arial,helvetica,sans-serif',
		"impact":	   'impact'
	};
	this.fontsize = {
		"default": "字号",
		"1":  "1",
		"2": "2",
		"3": "3",
		"4": "4",
		"5": "5",
		"6": "6",
		"7": "7"
	};
	this.formatblock = {
		"default": "格式",
		"普通": "p",
		"标题一": "h1",
		"标题二": "h2",
		"标题三": "h3",
		"标题四": "h4",
		"标题五": "h5",
		"标题六": "h6"
	};
	this.selList = ['fontname','fontsize','formatblock'];
};
editor = new WYSIWYD("$editor");
</script>
<!--
EOT;
?>