function addReview(){
	var content = document.add_review.content.value;
	var to_type = document.add_review.to_type.value;
	var to_id = document.add_review.to_id.value;
	
	if (content.length==0){
		alert("您还没有填写评论内容!");
		return false;
	}
	if (content.length>600){
		alert("您的评论内容大于了600个字!");
		return false;
	}
}

function sendmsg(){
	var msg = document.getElementById("msg").value;
	var to_userid = document.getElementById("to_userid").value;
	if(msg == "" || msg.length >300){
		alert('没有消息内容，或者超过了300个字符！');
		return false;
	}else{
		var addnew = datexml("/add.do","?method=add_msg&to_userid=" + to_userid + "&msg=" + escape(msg));
		if (addnew.Trim()=='success'){
			alert('发送消息成功！');
		}else{
			alert('发送消息失败，请稍候再试，或联系网站管理员！');
		}
		document.getElementById("sendmsg").style.display='none';
	}
}
String.prototype.Trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
}
function   Trim1(m){   
	  while((m.length>0)&&(m.charAt(0)==' '))   
	  m   =   m.substring(1, m.length);   
	  while((m.length>0)&&(m.charAt(m.length-1)==' '))   
	  m = m.substring(0, m.length-1);   
	  return m;   
	  } 
