function yanzheng(domId,msgId,maxNum){
	$('#'+domId).keyup(function(event){	
		var strtxtcount= $('#'+domId).val().length;
		if(strtxtcount<maxNum){
			$('#'+msgId).text('已输入 '+strtxtcount+' 字');
			$('#'+msgId).removeClass('msgred');
		}else{
			$('#'+msgId).text('已经超出 '+maxNum+' 个字！'); 
			$('#'+msgId).addClass('msgred');
			newStr = $('#'+domId).val().substr(0,maxNum);
			$('#'+domId).val(newStr);
			return false;
		}
	});
}

