<!--<?php
print <<<EOT
-->
<style type="text/css" media="screen">
@import url(images/post/c_editor/editor.css);
</style>
<div class="mb10"><!--编辑器开始-->
<div class="pr cc mb10">
<div class="wind_editor_con cc mb10">
<div id="w_editor_but" class="w_editor_but">
<ul class="cc fl">
	<li>
	<div id="wy_fontname" style="width: 77px;" class="wy_select">字体</div>
	<div id="wy_fontsize" style="width: 15px;" class="wy_select">2</div>
	<div class="c">&nbsp;</div>
	<a title="粗体" id="wy_bold" href="javascript:">粗体</a> <a title="斜体"
		id="wy_italic" href="javascript:">斜体</a> <a title="下划线"
		id="wy_underline" href="javascript:">下划线</a> <a title="删除线"
		id="wy_strikethrough" href="javascript:">删除线</a> <a title="字体颜色"
		id="wy_forecolor" href="javascript:">字体颜色</a> <a title="背景颜色"
		id="wy_hilitecolor" href="javascript:">背景颜色</a></li>
	<li>
	<div class="cc fl"><a title="对齐" id="wy_justify"
		href="javascript:">对齐</a> <a title="列表" id="wy_insertlist"
		href="javascript:">列表</a> <a title="缩进" id="wy_indent"
		href="javascript:">缩进</a> <a title="水平线" id="wy_inserthorizontalrule"
		href="javascript:">水平线</a> <a title="引用" id="wy_quote"
		href="javascript:">引用</a>
	<div class="c">&nbsp;</div>
	<a title="去除字体格式" id="wy_removeformat" href="javascript:">去除字体格式</a> <a
		title="插入链接" id="wy_createlink" href="javascript:">插入链接</a> <a
		title="清除链接" id="wy_unlink" href="javascript:">清除链接</a> <a title="表格"
		id="wy_inserttable" href="javascript:">表格</a> <a title="代码"
		id="wy_code" href="javascript:">代码</a></div>
	</li>
	<li class="li_icon_big">
	<div><a title="图片" id="wy_insertimage" href="javascript:">图片</a>
	<a title="多媒体" id="wy_media" href="javascript:">多媒体</a> <a
		onclick="return showEmotion();" unselectable="on" href="javascript:"
		title="表情" id="td_face">表情</a></div>
	<div class="c"></div>
	</li>
	<a style="display: none;" title="自定义代码" id="wy_pwcode"
		href="javascript:">自定义代码</a> <a style="display: none;" title="帖子格式"
		id="wy_setform" href="javascript:">帖子格式</a>
	<div class="c">&nbsp;</div>
	</li>
</ul>
<div class="fr windcode"><input id="wy_windcode" type="checkbox" />Wind代码</div>
</div>
<textarea id="textarea" name="atc_content" style="height: 280px;">{$_viewer->dianpuContent[contents]}</textarea>
<div class="wy_menu_B" id="menu_editor" style="display: none;"></div>
<div style="display: none"><span id="autosave"></span></div>
<div class="c"></div>
<div class="pr" style="height: 12px;" onmousedown="editor.flex(event);">
<div
	style="cursor: s-resize; position: absolute; bottom: -10px; height: 12px; width: 100%; padding-bottom: 10px;"
	class="cc">
<div class="post-flex">拉动</div>
</div>
</div>
</div>
</div>
</div>
<div id="menu_face" class="menu" style="display: none;"></div>
<!--编辑器结束--></div>
<script type="text/javascript" src="js/post.js"></script>
<script type="text/javascript" src="js/lang/zh_cn.js"></script>
<script type="text/javascript" src="data/bbscache/face.js"></script>
<script type="text/javascript" src="js/wind_c_editor.js"></script>
<script type="text/javascript">
var editor = null,charset = 'gbk';
function WysiwygConfig() {
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:[ true, editorcode, false ],
	bold: [ true, editorcode, true ],
	italic: [ true, editorcode, true ],
	underline: [ true, editorcode, true ],
	strikethrough: [ true, editorcode, true ],
	justify : [true, showJustify, false],
	insertlist : [true, showList, false],
	indent: [ true, showDent, 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 ],
	music: [ true, insertMusic, false ],
	inserttable: [ true, showTable, false ],
	windcode: [ true, editorcode, false ],
	undo: [ true, editorcode, false ],
	redo: [ true, editorcode, false ],
	media: [ true, rming, false ],
	quote: [ true, code, false ],
	code: [ true, code, 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": "2",
	"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'];
};
editor = new WYSIWYD();
editor.config = new WysiwygConfig();
editor.init('textmode', 0);
var maxLength=200;
function wordlength(target)
{
	var val = target.value;
	var n = 2*val.length-val.replace(/[\u4e00-\u9fa5]/g,'').length;
	var val=target.value;
	while(n>maxLength)
	{
		var key = val.substr(-1);
		target.value=val.substr(0,val.length-1);
		val = target.value;
		n -= /[\u4e00-\u9fa5]/.test(key)?2:1;
	}
	str='('+n+'/'+maxLength+')';
	var next = target.nextSibling;
	next.innerHTML=str;
	if(n==maxLength){
		next.className='s3';
		target.maxLength = val.length;
	}else{
		next.className="s6";
		target.maxLength = maxLength;
	}
}
function addcols(mode,ft){
	var s = getObj(mode).firstChild.cloneNode(true);
	getObj(ft).appendChild(s);
}
function removecols(obj){
	var o = obj.parentNode.parentNode;
	o.parentNode.removeChild(o);
}

function getSourceData(id) {
	id = id - 0;
	resetFormOnSubmit(false);
	if (!id) return false;
	var sourceType = getObj('sourcetype').value;
	window.location.href = "{$basename}q=post&sourcetype="+sourceType+"&sourceid="+id+"&cid={$cid}";
}

function resetFormOnSubmit(status){
	var aform = document.FORM;
	if(aform == null) return false;
	if(status==true) {
		aform.onsubmit = function(){return false};
	}else{
		aform.onsubmit = '';
	}
}

function getSourceDataByEnter(event,id){
	event = event ? event : (window.event ? window.event : null);
	if(event.keyCode == '13'){
		getSourceData(id);
	}
}
</script>
<!--
EOT;
?>
