function face(facenum){
 var ToAdd = "[Face" + facenum + "]";
 if($('txt_content').value=='评论内容不超过200字')$('txt_content').value='';
 $("txt_content").value += ToAdd;
 $("txt_content").focus();
}
function quoteComments(userid,name,date,content_id)//引用
{				
	if(userid>0){
	name="<a href=\"http://blog.soufun.com/blog_"+userid+".htm\" class=\"pl_01\">"+name+"</a>";
	}
	else {
	name = name+'(过客)';
	} 
	var body= document.getElementById('body_'+content_id).innerHTML;	
	var quote= "<div class=\"pl_adduction_top\">引用："+name+"   <span class=\"pl_date\">"+date+"</span></div><p>"+body+"</p>";				
	document.getElementById('lab_quote').innerHTML =quote
	
}	
function authorComments(id,content_id)//直接引用
{	
	document.getElementById('id').value = id;
	document.forms['commentsave'].id.value=id;
	var quote= document.getElementById('body_'+content_id).innerHTML;				
	document.getElementById('lab_quote').innerHTML =quote+"\r\n";
}
function alertMessage(message)
{		
	alert(message);
}	
function comment_save(id,type)
{	
	if(id>0){
		document.getElementById('id').value=id;
		document.forms['commentsave'].id.value=id;
	}
	document.forms['commentsave'].type.value=type;	
	if(type=='add'){
		document.forms['commentsave'].quote.value=document.getElementById('lab_quote').innerHTML;
		document.forms['commentsave'].vcode.value=document.getElementById('txt_vcode').value;
		document.forms['commentsave'].content.value=document.getElementById('txt_content').value;		
		document.forms['commentsave'].username.value=document.getElementById('txt_username').value;
		if(document.forms['commentsave'].username.value == '') 
		{
			alert('用户名称不能为空！');
			return;
		}
		if(trim(document.forms['commentsave'].content.value)==''){
			alert('内容不能为空！');
			return;
		}
	}
	if(type=='del'){
		if(!confirm("真的删除吗?")){
			return;
		}
	}
	document.commentsave.submit();
}
function trim(value){return value.replace(/(^\s+)|(\s+$)/g,"");}
//页面不会刷，删除参数
function param_del()
{
	if(document.getElementById('lab_quote')!=null)
	{
		document.getElementById('lab_quote').innerHTML='';
		document.getElementById('txt_vcode').value='';
		document.getElementById('txt_content').value='';
	}
	document.forms['commentsave'].id.value=0;	
}