function $(id){
	return document.getElementById(id);
}
function fly_leftload()
	{
		var oMsg = document.getElementById("msg");
		oMsg.style.display = "block";
		oMsg.style.top = (document.body.scrollTop + document.documentElement.scrollTop + document.body.clientHeight-iHeight/2)-(document.body.offsetHeight)/2;
		oMsg.style.left = (document.body.clientWidth-iWidth/2)/2;
		oMsg.style.width = iWidth;
		oMsg.style.height = iHeight;
		timeId1 = setTimeout("fly_leftload();",5);
	}
function handlesubmit(){
		var oForm = $('postform');
		var oMsg = $('msg');
		var oIframe = $('msgFrame');
		var oPostsubmit = $('postsubmit');
		var oMessage = $('message');
		if ((postminchars != 0 && oMessage.value.length < postminchars) || (postmaxchars != 0 && oMessage.value.length > postmaxchars)) {
			//alert("您发表的评论内容长度不符合要求。\n\n当前长度: "+oMessage.value.length+" 字节\n系统限制: "+postminchars+" 到 "+postmaxchars+" 字节");
			alert("您发表的评论内容长度不符合要求。\n\n评论内容长度应该: "+postminchars+" 到 "+postmaxchars+" 字");
			return false;
		}
		fly_leftload();
		//var oIframe = document.createElement("iframe");
		oIframe.setAttribute("name","msgFrame");
		oIframe.setAttribute("width",iWidth);
		oIframe.setAttribute("height",iHeight);
		oIframe.setAttribute("src","");
		oIframe.style.border = "0px";
		oMsg.appendChild(oIframe);
		oMsg.style.width = iWidth;
		oMsg.style.height = iHeight;
		oMsg.style.display = "block";
		oForm.setAttribute("action","http://groups.nddaily.com/comment.php");
		oForm.setAttribute("target","msgFrame");
		oForm.submit();
		oPostsubmit.disabled = true;
		setTimeout("closeMsg()",5000);
		return false;
	}
	function closeMsg(){
		var oForm = $('postform');
		var oMsg = $('msg');
		var oIframe = $('msgFrame');
		oIframe.setAttribute("src","");
		oMsg.style.display = "none";
		clearTimeout(timeId1);
		return false;
	}
	function addQuote(id){
		var oauthor = $('author_'+id);
		var oip = $('ip_'+id);
		var otime = $('time_'+id);
		var omessage = $('message_'+id);
		var nmessage = $('message');
		var tempmess = "";
		if(omessage.firstChild.className == "quote"){
			omessage.removeChild(omessage.firstChild);
		}
		tempmess+='[quote]';
		//tempmess+='原帖由[i]'+oauthor.innerText+'[/i]';
		tempmess+='[i]'+oauthor.innerText+'[/i]';
		//tempmess+='于 '+otime.innerText+' 发表';
		tempmess+="\n"+omessage.innerText;
		tempmess+='[/quote]';
		try{
			nmessage.innerHTML = tempmess;
		}catch(e){}
		return false;
	}
var postminchars = parseInt('4');
var postmaxchars = parseInt('10000');
var iWidth=280; //窗口宽度
var iHeight=125;//窗口高度
var timeId1 = 0;
