var successMsg = "发表成功!!";
var isShowMsgLink = true;

function fillHTML(el,HTMLString) {
	if (!el) return;
	if (window.ActiveXObject) { //For IE
		el.innerHTML = HTMLString.replace(/<script([^>]*)>/ig, '<script$1 defer>');
	} else { //For Mozilla,Opare
		var nSibling = el.nextSibling;
		var pNode = el.parentNode;
		pNode.removeChild(el);
		el.innerHTML = HTMLString;
		pNode.insertBefore(el,nSibling)
	}
}

function Trim(str){
	return RTrim(LTrim(str));
}

function LTrim(str){
	var whitespace = new String(" \t\n\r");
	var s = new String(str);
	if (whitespace.indexOf(s.charAt(0)) != -1)
	{
	     var j=0, i = s.length;
	     while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
	     {
	         j++;
	      }
	      s = s.substring(j, i);
	 }
	 return s;
}

function RTrim(str){
	var whitespace = new String(" \t\n\r");
	var s = new String(str);
	if (whitespace.indexOf(s.charAt(s.length-1)) != -1)
	{
	     var i = s.length - 1;
	     while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
	     {
	         i--;
	      }
	      s = s.substring(0, i+1);
	 }
	 return s;
}

function strLength(str)
{
	var l=str.length;
	var n=l
	for (var i=0;i<l;i++)
	{
		if (str.charCodeAt(i)<0||str.charCodeAt(i)>255) n++
	}
	return n		
}

function charReplace( content ){
      content = content.replace(/\&/g,"amp;");
	  content = content.replace(/\%/g,"ame;");
	  content = content.replace(/\#/g,"amx;");
	  content = content.replace(/\'/g,"amy;");
	  content = content.replace(/\?/g,"amk;");
	  content = content.replace(/\"/g,"amz;");
	  return content;
}

//替换HTML标签
function replaceHTML( str ){
	str = str.replace(/<a.*?>(.*?)<\/a>/g,"");
	str = str.replace(/<img.*?>(.*?)<\/img>/g,"");
	str = str.replace(/<IMG.*?>(.*?)<\/IMG>/g,"");
	str = str.replace(/<script.*?>(.*?)<\/script>/g,"");
	str = str.replace(/<iframe.*?>(.*?)<\/iframe>/g,"");
	str = str.replace(/\bhttp\:\/\/www(\.[\w+\.\:\/\_]+)/gi,"");
	str = str.replace(/\b(http\:\/\/\w+\.[\w+\.\:\/\_]+)/gi,"");
	str = str.replace(/\b(www\.[\w+\.\:\/\_]+)/gi, "");
	str = str.replace("<","&lt;");
	str = str.replace(">","&gt;");
	return str;
}
var _comTitle2 = "";

function getCommentInfo(id,articleid,aType){
	if( id <= 1 ){
		return false;
	}
	
	if((typeof(_comTitle) != "undefined")){
		_comTitle2 = _comTitle;
	}
	var url = '/commenton/getcommentinfo.jsp';
	if($('tmpNewComm') != null){
		url = '/commenton/showcomment.jsp';
	}
	
	var pars = "id="+id + "&articleid=" + articleid + "&aType=" + aType;
	var myAjax = new Ajax.Request(url, {asynchronous:'false',encoding:'UTF-8',method: 'post',parameters: pars,onComplete:returnCommentList});
}

//发表评论
function addCommentInfo(){
	
	var revertId = $('revertId').value;
	if( revertId == -1 ){
		alert("该文章不能进行评论");
		return false;
	}
	var url = '/portal/commment.do';
	var isNewComm = 1;
	if($('tmpNewComm') != null){
		isNewComm = -1;
	}
	var nickname = "";
	var reurl = "";
	if(isNewComm == 1){
		nickname = Trim($('nickname').value);
		
	}else{
		
		reurl = "showNewCom";
	}
	var commentContent = Trim($('commentContent').value);
	var groupid = $('groupid').value;
	if(groupid == 1){
		alert("该文章不能进行评论");
		return false;
	}
	var method = Trim($('method').value);
	
	var articleid = Trim($('articleid').value);
	
	if( isNewComm== 1 && nickname == "" ){
		alert("请输入昵称");
		//$('addComment' ).disabled = false;
		return false;
	}
	commentContent = replaceHTML( commentContent );
	commentContent = charReplace( commentContent );
	
	//--------去除前面的"回复":字符
	var tmpcontent = commentContent.substring(0,3);
	var length = strLength( commentContent );
	if( tmpcontent == "回复：" || tmpcontent == "回复:" ){
		commentContent = commentContent.substring(3,length);
	}
	
	if( commentContent == "" ){
		alert( "请输入内容" );
		//$('addComment' ).disabled = false;
		return false;
	}else if( length > 5000  ){	
		alert( "评论不能超过5000个字" );
		//$('addComment' ).disabled = false;
		return false;
	}
	
	nickname = replaceHTML(nickname);
	nickname = charReplace(nickname);
	var aType = $('aType').value;
	
	var pars = "nickname=" + nickname + "" 
				+ "&commentContent=" + commentContent + "&groupid=" + groupid
				+ "&revertId=" + revertId
				+ "&articleid=" + articleid
				+ "&aType=" + aType
				+ "&reurl=" + reurl
				+ "&method=" + method;
if(isNewComm == 1){

	$('nickname').value = "";

}else{

$('newCommcon1').value = "";
$('newCommcon2').value = "";
}
	$('commentContent').value = "";
	$('revertId').value = 0;
	var myAjax = new Ajax.Request(url, {asynchronous:'false',encoding:'UTF-8',method: 'post',parameters: pars,onComplete:returnCommentList});
	
}

//增加支持数
function updateSupport( commentId,groupid ){
	var url = '/portal/commment.do';
	var articleid = Trim($('articleid').value);
	var aType = $('aType').value;
	var pars = "commentId=" + commentId 
			+ "&groupid=" + groupid
			+ "&articleid=" + articleid
			+ "&aType=" + aType
			+ "&method=updateSupport";
	
	var myAjax = new Ajax.Request(url, {asynchronous:'false',encoding:'UTF-8',method: 'post',parameters: pars,onComplete:returnCommentList});
}

//增加反对数
function updateOupport( commentId,groupid ){
	var url = '/portal/commment.do';
	var articleid = Trim($('articleid').value);
	var aType = $('aType').value;
	var pars = "commentId=" + commentId
			+ "&method=updateoppose"
			+ "&articleid=" + articleid
			+ "&aType=" + aType
			+ "&groupid=" + groupid;
	var myAjax = new Ajax.Request(url, {asynchronous:'false',encoding:'UTF-8',method: 'post',parameters: pars,onComplete:returnCommentList});
}

//回复
function revertComment( commentId ){
	$('revertId').value = commentId;
	//$('addComment' ).disabled = false;
	$('nickname').focus();
	$('nickname').value = "";
	$('commentContent').value = "回复:";
}

//获得评论
function returnCommentList(response){

	 fillHTML($('commentDiv'),response.responseText);
	 if((typeof($('allCommnetA')) != "undefined")){
		$('allCommnetA').href = $('allCommnetA').href + _comTitle2;
		}
	var isNewComm = 1;
	if((typeof($('tmpNewComm')) != "undefined")){
		isNewComm = -1;
	}
	 //$('addComment' ).disabled = false;
	 if(isNewComm == 1){
		// $('nickname').value = "";
	 }
	 $('commentContent').value = "";
}

//清空内容
function resetComment(){
	$('nickname').value = "";
	$('commentContent').value = "";
	return false;
}

//选择表情
function repacleImg( img ){
	var commentContent = $('commentContent').value;
	$('commentContent').value = commentContent + img;
}

//分页效果图
function get_desProd(url){
    if(document.referrer.indexOf("http://pub")>=0){
      return false;
    }else{
	var myAjax = new Ajax.Request(url, {encoding:'UTF-8',method: 'post',onComplete:returnget_desProd});
	}
}

function returnget_desProd(response){
	 $('effect').innerHTML = response.responseText;
}

function get_effect(url){
    if(document.referrer.indexOf("http://pub")>=0){
      return false;
    }else{
	var myAjax = new Ajax.Request(url, {encoding:'UTF-8',method: 'post',onComplete:returnget_effect});
	}
}

function returnget_effect(response){
	 $('effect').innerHTML = response.responseText;
}

//分页作品图
function get_comCase(url){
    if(document.referrer.indexOf("http://pub")>=0){
      return false;
    }else{
	var myAjax = new Ajax.Request(url, {encoding:'UTF-8',method: 'post',onComplete:returnget_comCase});
	}
}

function returnget_comCase(response){
	 $('case').innerHTML = response.responseText;
}

function get_desCase(url){
    if(document.referrer.indexOf("http://pub")>=0){
      return false;
    }else{
	var myAjax = new Ajax.Request(url, {encoding:'UTF-8',method: 'post',onComplete:returnget_desCase});
	}
}

function returnget_desCase(response){
	 $('case').innerHTML = response.responseText;
}

function addNewComme1(groudId){
	$('groupid').value = groudId;
	$('commentContent').value = $('newCommcon1').value;
	addCommentInfo();
}

function addNewComme2(groudId){
	$('groupid').value = groudId;
	$('commentContent').value = $('newCommcon2').value;
	addCommentInfo();
}


// -------------   专题评论     -----------------
var commentObj = {
	"commentSize":0,
	"commentList":[{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}],
	"commentLink":"",
	"groupId":0,
	"articleid":0,
	"aType":0,
	"revertId":0,
	"pageCount":0,
	"nextPage":0,
	"lastPage":0,
	"beginIdx":0,
	"pageId":0,
	"browsecount":0
}

function changeNickName(){
	var isDefaultName = $('isDefaultName');
	if(isDefaultName.checked){
		$('defaultNameSpan').innerHTML = "<input type='text' id='nickname' name='nickname' value='居无忧网游客' />";
		$('defaultNameSpan').style.display = "none";
	}else{
		CommentCGI.getNickNameByCookie(returnNickNameMsg);
		//$('defaultNameSpan').innerHTML = "";
	}
	
}

var returnNickNameMsg = function(data){
	var nickName = data;
	$('defaultNameSpan').innerHTML = "网友笔名：<input type='text' id='nickname' name='nickname' value='"+nickName+"' />";
	$('defaultNameSpan').style.display = "block";
}

//发表评论
function addComment(){
	var revertId = commentObj.revertId;
	if( revertId == -1 ){
		alert("该文章不能进行评论");
		return false;
	}
	var url = '/portal/commment.do';
	var nickname = "";
	var reurl = "showCommentMsg";
	var commentContent = Trim($('commentContent').value);
	var groupid = commentObj.groupId;
	if(groupid == 1){
		alert("该文章不能进行评论");
		return false;
	}
	
	var method = "addCommentInfo";
	nickname = Trim($('nickname').value);
	var isDefaultName;
	if($('isDefaultName') != "" && $('isDefaultName') != null){
		isDefaultName = $('isDefaultName');
		if(isDefaultName.checked){
			nickname = "居无忧网游客";
		}
	}
	var articleid = Trim(commentObj.articleid);
	if(nickname == ""){
		alert("请输入昵称");
		//$('addComment' ).disabled = false;
		return false;
	}
	commentContent = replaceHTML( commentContent );
	commentContent = charReplace( commentContent );
	
	//--------去除前面的"回复":字符
	var tmpcontent = commentContent.substring(0,3);
	var length = strLength( commentContent );
	if( tmpcontent == "回复：" || tmpcontent == "回复:" ){
		commentContent = commentContent.substring(3,length);
	}
	
	if( commentContent == "" ){
		alert( "请输入内容" );
		//$('addComment' ).disabled = false;
		return false;
	}else if( length > 5000  ){	
		alert( "评论不能超过5000个字" );
		//$('addComment' ).disabled = false;
		return false;
	}
	
	nickname = replaceHTML(nickname);
	nickname = charReplace(nickname);
	var aType = commentObj.aType;
	
	var pars = "nickname=" + nickname + "" 
				+ "&commentContent=" + commentContent + "&groupid=" + groupid
				+ "&revertId=" + revertId
				+ "&articleid=" + articleid
				+ "&aType=" + aType
				+ "&reurl=" + reurl
				+ "&method=" + method;
	
	CommentCGI.addCommentInfo(groupid,revertId,nickname,commentContent,returnCommentMsg);
	//var myAjax = new Ajax.Request(url, {asynchronous:'false',encoding:'UTF-8',method: 'post',parameters: pars,onComplete:returnCommentList2});
	
}

function returnCommentList2(response){
	document.location = commentObj.commentLink;
	//fillHTML($('commentDiv'),response.responseText);
}


//回复
function revertComment( commentId ){
	commentObj.revertId = commentId;
	//$('addComment' ).disabled = false;
	//$('nickname').focus();
	//$('nickname').value = "";
	$('commentContent').value = "回复:";
}

function allCommentList(){
	window.open(commentObj.commentLink,'','');
}


function getCookie(name){
     var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     if(arr != null) {  
        return decodeURI(arr[2]); 
      }
     return null;
} 

//发表评论
function addCorComment(){
	var revertId = commentObj.revertId;
	if( revertId == -1 ){
		alert("该文章不能进行评论");
		return false;
	}
	var url = '/portal/commment.do';
	var nickname = "";
	var reurl = "showCommentMsg";
	var commentContent = Trim($('commentContent').value);
	var groupid = commentObj.groupId;
	if(groupid == 1){
		alert("该文章不能进行评论");
		return false;
	}
	
	var method = "addCommentInfo";
	nickname = Trim($('nickname').value);
	var isDefaultName;
	if($('isDefaultName') != "" && $('isDefaultName') != null){
		isDefaultName = $('isDefaultName');
		if(isDefaultName.checked){
			nickname = "居无忧网游客";
		}
	}
	var articleid = Trim(commentObj.articleid);
	if(nickname == ""){
		alert("请输入笔名");
		//$('addComment' ).disabled = false;
		return false;
	}
	commentContent = replaceHTML( commentContent );
	commentContent = charReplace( commentContent );
	
	//--------去除前面的"回复":字符
	var tmpcontent = commentContent.substring(0,3);
	var length = strLength( commentContent );
	if( tmpcontent == "回复：" || tmpcontent == "回复:" ){
		commentContent = commentContent.substring(3,length);
	}
	
	if( commentContent == "" ){
		alert( "请输入内容" );
		//$('addComment' ).disabled = false;
		return false;
	}else if( length > 5000  ){	
		alert( "评论不能超过5000个字" );
		//$('addComment' ).disabled = false;
		return false;
	}
	
	nickname = replaceHTML(nickname);
	nickname = charReplace(nickname);
	var aType = commentObj.aType;
	if((typeof(_reContentFirst) != "undefined")&&(typeof(_reContentEnd) != "undefined")&&$('reContent') != null){
		if($('reContent').value == ""){
			alert(_reContentMsg);
			return null;
		}
		commentContent = _reContentFirst+$('reContent').value+_reContentEnd+commentContent;
	}
	var pars = "nickname=" + nickname + "" 
				+ "&commentContent=" + commentContent + "&groupid=" + groupid
				+ "&revertId=" + revertId
				+ "&articleid=" + articleid
				+ "&aType=" + aType
				+ "&reurl=" + reurl
				+ "&method=" + method;
	
	CommentCGI.addCorCommentInfo(groupid,nickname,commentContent,returnCommentMsg);
	//var myAjax = new Ajax.Request(url, {asynchronous:'false',encoding:'UTF-8',method: 'post',parameters: pars,onComplete:returnCommentList2});
	
}

function changeNickName2(){
	var isDefaultName = $('isDefaultName');
	if(isDefaultName.checked){
		$('defaultNameSpan').innerHTML = "<input type='text' id='nickname' name='nickname' value='居无忧网游客' />";
		$('defaultNameSpan').style.display = "none";
	}else{
		CommentCGI.getNickNameByCookie(returnNickNameMsg2);
		//$('defaultNameSpan').innerHTML = "";
	}
	
}

var returnNickNameMsg2 = function(data){
	var nickName = data;
	$('defaultNameSpan').innerHTML = "   用户名 <input id='nickname' name='nickname' value='"+nickName+"' type='text'  style='border:#999 1px solid'/> ";
	$('defaultNameSpan').style.display = "";
}

var returnCommentMsg = function(data){
	if(data == 0){
		alert("请稍后再发表评论");
		return false;
	}else{
		alert(successMsg);
	}
	if((typeof(_reContentFirst) != "undefined")){
		CommentCGI.getReplyTable(commentObj.groupId,commentObj.articleid,commentObj.aType,returnReplyTableMsg);
		return false;
	}
	$('commentContent').value = "";
	$('nickname').value = "";
	if((typeof(commentDiv) != "undefined")){
		getCommentDiv(commentObj.groupId,commentDiv);
	}else{
		window.location = window.location.href +"#rcomment";
	 	window.location.reload();
	}
}

var returnReplyTableMsg = function(data){
	$('replyDiv').innerHTML = data;
}

function getCommentTable(groupId,id,pageId){
	CommentCGI.getCommentTable(groupId,id,pageId,returnCommentTableMsg);
}

var returnCommentTableMsg = function(data){
	//alert(data);
	$('commentDiv').innerHTML = data;
}

function goCommentTable(){
	var pageId = $('pageNum').value;
	CommentCGI.getCommentTable(commentObj.groupId,commentObj.articleid,pageId,returnCommentTableMsg);
}

function resetCorComment(){
	$('commentContent').value = "";
	return false;
}

var supportType = 0;
var supportCommeId = 0;

function updateSupportCount(commid,typeId){
	supportType = typeId;
	supportCommeId = commid;
	var url = '/portal/commment.do';
	var pars = "commentId=" + commid
				+ "&typeId=" + typeId
				+ "&method=updateSupportCount";
	var myAjax = new Ajax.Request(url, {asynchronous:'false',encoding:'UTF-8',method: 'post',parameters: pars,onComplete:returnSupportMsg});
}

function returnSupportMsg(response){
	if(Trim(response.responseText) > 0){
		if(supportType == 1){
			var supSpans = document.getElementsByName('supSpan'+supportCommeId);
			for(var i=0;i<supSpans.length;i++){
				supSpans[i].innerHTML = "<span class='cRed02'>已支持</span>["+Trim(response.responseText)+"]";
			}
		}else if(supportType == 2){
			var oppSpans = document.getElementsByName('oppSpan'+supportCommeId);
			for(var i=0;i<oppSpans.length;i++){
				oppSpans[i].innerHTML = "已反对["+Trim(response.responseText)+"]";
			}
		}
	}	
}

function revertReply(){
	var groudId = $('groupid').value;
		if(groudId == 1){
			return false;
		}
		var revertId = $('revertId').value;
		var nickname = Trim($('renickname').value);
		var commentContent = Trim($('recommentContent').value);
		if( nickname == "" ){
			alert("请输入笔名");
			
			return false;
		}
		
		nickname = replaceHTML(nickname);
		nickname = charReplace(nickname);
		commentContent = replaceHTML( commentContent );
		commentContent = charReplace( commentContent );
		var length = strLength( commentContent );
		
		if( commentContent == "" ){
			alert( "请输入内容" );
			return false;
		}else if( length > 5000  ){
			alert( "评论不能超过5000个字" );
			
			return false;
		}
		$('renickname').value = nickname;
		var tmpcontent = commentContent.substring(0,3);
		var length = strLength( commentContent );
		if( tmpcontent == "回复：" || tmpcontent == "回复:" ){
			commentContent = commentContent.substring(3,length);
		}
		var url = '/portal/commment.do';
		$('recommentContent').value = commentContent;
		var aType = $('aType').value;
		var articleid = Trim($('articleid').value);
		var linkUrl = $('linkUrl').value;
		var pars = "nickname=" + nickname
				+ "&commentContent=" + commentContent
				+ "&groupid=" + groudId
				+ "&revertId=" + revertId
				+ "&articleid=" + articleid
				+ "&aType=" + aType
				+ "&linkUrl=" + linkUrl
				+ "&method=addRevertComment";
		
		var myAjax = new Ajax.Request(url, {asynchronous:'false',encoding:'UTF-8',method: 'post',parameters: pars,onComplete:returnRevertCommentList});
}

function returnRevertCommentList(response){
	var addsuccess = response.responseText;
	if(addsuccess > 0){
		alert("回复成功,感谢你的支持");
		var title = $('title2').value;
		var groupid = $('groupid').value;
		var articleid = $('articleid').value;
		var aType = $('aType').value;
		var linkUrl = $('linkUrl').value;
		document.location = "/commenton/allCommentInfo.jsp?id="+groupid+"&articleid="+articleid+"&aType="+aType+"&title2="+title+"&linkUrl="+linkUrl;
	}
}

function resetRevertComment(){
	$('renickname').value = "";
	$('recommentContent').value = "";
	return false;
}

function hidRevertDiv(){
	$('revertDiv').style.display = "none";
	$('recommentContent').value = '';
	$('renickname').value = '';
}

function repacleRevertImg( img ){
	var commentContent = $('recommentContent').value;
	$('recommentContent').value = commentContent + img;
}

var replyCount = 20;

var returnCommentDivMsg = function(data){
	$('replyDiv').innerHTML = data;
}

function getCommentDiv(groupId,commentDiv){
	CommentCGI.getCommentCount(groupId,returnCommentCountMsg);
	
	if( isShowMsgLink ){
		if((typeof(isShowAllInfo) != "undefined")){
			CommentCGI.getCommentListDiv(groupId,replyCount,commentDiv,'',className,returnCommentDivMsg);
		}else{
			CommentCGI.getCommentListDiv(groupId,replyCount,commentDiv,commentObj.commentLink,className,returnCommentDivMsg);
		}
	}else{
		CommentCGI.getCommentListDiv2(groupId,replyCount,commentDiv,className,returnCommentDivMsg);
	}
	
}

var returnCommentCountMsg = function(data){
	$('commentCount').innerHTML = data;
}



function showComment(id){
	CommentCGI.getCommentBean(id,showCommentDiv,returnShowCommentMsg);
}

var returnShowCommentMsg = function(data){
	$('showCommenDiv').innerHTML = data;
}

var returnReplyTableMsg = function(data){
	$('replyDiv').innerHTML = data;
}

function setTargetXY(target){
		
		if(!target) return;
		var de = document.documentElement;
		var db = document.body;
		
		var clientWidth = de.clientWidth != 0 ? Math.min(de.clientWidth, db.clientWidth) : db.clientWidth;
		var clientHeight = de.clientHeight != 0 ? Math.min(de.clientHeight, db.clientHeight) : db.clientHeight;
			
		var scrollLeft =  de.scrollLeft ? de.scrollLeft : db.scrollLeft;
		var scrollTop =  de.scrollTop ? de.scrollTop : db.scrollTop;
		
		var targetWidth = target.style.width ? target.style.width.replace("px","") : target.clientWidth;
		var targetHeight = target.style.height ? target.style.height.replace("px","") : target.clientHeight;
		target.style.left = ((clientWidth-targetWidth)/2+scrollLeft)+"px";
		target.style.top = ((clientHeight-targetHeight)/2+scrollTop)+"px";
		
}

function showCommentInfo(id){
	$('commentInfoDiv').style.display = "none";
	CommentCGI.getCommentBean(id,replyInfoDiv,returnReplyInfoMsg);
}

var returnReplyInfoMsg = function(data){
	$('commentInfoDiv').innerHTML = data;
	$('commentInfoDiv').style.position = "absolute";
	$('commentInfoDiv').style.display = "";
	setTargetXY($('commentInfoDiv'));
}

function hiddeCommentInfo(){
	$('commentInfoDiv').style.display = "none";
}

function updateCommentSupport(id,typeId){
	supportType = typeId;
	supportCommeId = id;
	CommentCGI.updateSupport(id,typeId,returnCommentSupMsg);
}

function returnSupportMsg(response){
	if(Trim(response.responseText) > 0){
		if(supportType == 1){
			var supSpans = document.getElementsByName('supSpan'+supportCommeId);
			for(var i=0;i<supSpans.length;i++){
				supSpans[i].innerHTML = "<span class='cRed02'>已支持</span>["+Trim(response.responseText)+"]";
			}
		}else if(supportType == 2){
			var oppSpans = document.getElementsByName('oppSpan'+supportCommeId);
			for(var i=0;i<oppSpans.length;i++){
				oppSpans[i].innerHTML = "已反对["+Trim(response.responseText)+"]";
			}
		}
	}	
}

var returnCommentSupMsg = function(data){
	if(data > 0){
		if(supportType == 1){
			var supSpans = document.getElementsByName('supSpan'+supportCommeId);
			for(var i=0;i<supSpans.length;i++){
				supSpans[i].innerHTML = "<span style='color: red'>已支持</span>["+data+"]";
			}
		}else if(supportType == 2){
			var oppSpans = document.getElementsByName('oppSpan'+supportCommeId);
			for(var i=0;i<oppSpans.length;i++){
				oppSpans[i].innerHTML = "<span style='color: #1D529E'>已反对</span>["+data+"]";
			}
		}
	}
}