function viewComment() {
var nodeid=0;
var nsid=0;
try{
nodeid=document.forms["myform"].nodeid.value;
nsid=document.forms["myform"].nsid.value;
}catch(e){}
    document.forms["myform"].action = "http://comments.china.org.cn/comments/servlet/DisplayComments?nodeid="+nodeid+"&nsid="+nsid;
    document.forms["myform"].submit();
}

function submitCheck() {
    if (document.forms["myform"].content.value.length > 1000) {
        alert("Comment is too long!");
        return false;
    }
    if (document.forms["myform"].content.value.indexOf("<script") != -1 || document.forms["myform"].content.value.indexOf("</") != -1) {
        alert("Comment should not contain script!");
        return false;
    }
    if (trim(document.forms["myform"].content.value) == "") {
        alert("Comment should not be empty!");
        return false;
    }
    if(trim(document.forms["myform"].author.value) == ""){
        alert("Please fill in your nickname!");
        return false;
    }
	var reg = /^[\u4e00-\u9fa5]/;
  	if(trim(document.forms["myform"].author.value).match(reg)){
      	alert("Please submit your comment with an English user name.");
	  	return false;
  	}
    document.forms["myform"].action = "http://comments.china.org.cn/comments/do/AddNrCommentAction";
    document.forms["myform"].submit();
	alert("Thank you for replying and using of the service provided by China.org.cn!");
	document.location.href=document.location.href ;
    return true;
}

function trim(s) {
    if (s == null || s == "") {
        return "";
    }
    var Str = new String(s);
    var newstr = Str.replace(/^\s*/, "");
    return (newstr.replace(/\s*$/, ""));
}

function loadContent() {
    var nodeid = 0;
    var nsid = 0;
    try {
        nodeid = document.forms["myform"].nodeid.value;
        nsid = document.forms["myform"].nsid.value;
    }
    catch (e) {
    }
    var s = document.createElement("script");
    s.src = "http://comments.china.org.cn/comments/servlet/ViewPartialCommentServlet?nodeid=" + nodeid + "&nsid=" + nsid + "&fcount=10000&itemcount=20&"+Math.random();
    document.body.appendChild(s);
	
}
loadContent();

function showid(){
var count = document.getElementById("pinglun").innerHTML;
document.getElementById("pinglunbottom").innerHTML = count;
}
function stopid(){
    window.clearInterval(sh);
}
var sh = setInterval("showid()",50);
setTimeout("stopid()",5000);


