HD.show({
	id : 'content',
	minHeight:200,
	skinType : 'editor2', 
	cssPath : 'skins/content.css',
	id_container:'hd_container',
	id_toolbar:'hd_container',
	position_toolbar:'position_toolbar',
	position_content:'hd_content',
	items : ['undo','redo','fontsize','innerlink', 'face','urlimage'],
	suitsize: 0,
	filterExternal: 0
});
var focusfirst = document.getElementById('first');
if(focusfirst != null){
	focusfirst.focus();
}
//function getcontent(postid){
//	var content = document.getElementById(postid).innerHTML;
//	editor.focusEditor();
//	content='<p class="bor-ccc"><strong>QUOTE:</strong>原帖由' +content+'</p>';
//	editor.setHTML(content);
//}
function setCookie()
{
	var date=new Date();
	date.setTime(date.getTime()+24*3600*1000);
	document.cookie="nextURL="+document.location.href+";expire="+date.toGMTString()+";path=/;domain=.hudong.com;";
}
setCookie();

function doPostEditSubmit(){
	var post_title=document.getElementById('post_title');
	if(post_title.value.trim().length>38){
		alert('标题不能过长！');
		post_title.focus();
		return false;
	}
	var topic_content=HD.util.getData('content');//取编辑器内容	
	if(topic_content == "" || topic_content=="<p>&nbsp;</p>"){
		alert('内容不能为空！');
 		return false;
 	}
	if(topic_content.length>10000){
		alert('内容不能超过1万字!');
 		return false;
 	}
 	post_title.value = KillSpace(post_title.value.trim());
	HD.$('content').value=HD.util.getData('content');
	document.form2.submit();
}
function KillSpace(text){

	var i=0;
	var len=0;
	var lentmp=0;
	var a=0;
	var b=0;
	while (i==0)
	{
		lentmp = text.length;
		text = text.replace(/(^\s*)|(\s*$)/g,"");
		len = text.length;
		if(lentmp==len){
			a=0;
		}else{
			a=1;
		}
		lentmp = text.length;
		text = text.replace(/(^\u3000*)|(\u3000*$)/g,"");
		text = text.replace(/(^\ue4c6*)|(\ue4c6*$)/g,"");
		len = text.length;
		if(lentmp==len){
			b=0;
		}else{
			b=1;
		}
		if (a==0 && b==0){
			i = 1;
		}else{
			i = 0;
		}
	}
	return text;
}