var req,commentId,newsTypeId;
var maxLen=250;
function addSupportCnt(id) {
  commentId=id;
  newsTypeId=document.getElementById("ModifyForm:newsTypeId").value;
	var url="/djnews/asych/act?addType=support&commentId="+commentId+"&newsTypeId="+newsTypeId;
	if(window.XMLHttpRequest) {
		req=new XMLHttpRequest(); 
	} else if(window.ActiveXObject) {
		req=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if(req) {
		req.open("GET", url, true);
		req.onreadystatechange=SupportCallback;
		req.send(null);
	}
}

function SupportCallback() {
	if(req.readyState == 4) {
		if(req.status == 200) {
		  ReflashSupportMsg();
		} else {
		//document.getElementById("search-message").innerHTML="服务器处理异常！";
		}
	} else {
		//document.getElementById("search-message").innerHTML="正在加载机型...";
	}
}

function ReflashSupportMsg() {
  var digs=document.getElementById("support"+commentId);
  digs.innerHTML=parseInt(digs.innerHTML)+1;
}


function commentfor(commentid){
	var name=document.getElementById("name"+commentid).innerHTML;
	document.getElementById("comment").focus();
	document.getElementById("comment").value="对　"+name+" 说：";
	
}

function checkMaxInput(txt){
	if (txt.value.length > maxLen){
		alert("最多输入250个字符，超出将被截断！");
		txt.value = txt.value.substring(0, maxLen);
	}
     
}

function logOut(){
	deleteCookie('userName',null,null);
	setCookie('userName', '', null, null, null, null );
	window.location.reload();
}



