// Performs an Ajax request with the stuff entered by the user.
function comment(newsid) {
    var comment = $("Comment").value.toString().stripTags().stripScripts(); // Don't think there isn't server-side validation.
    var name = $("Name").value.toString().stripTags().stripScripts();
    var id = $("id").value.toString().stripTags().stripScripts();
    var url = 'ajax_newscomments.asp?newsid=' + newsid + '&name=' + name + '&id=' + id + '&comment=' + comment;
    //alert(url);
	new Ajax.Request(url, {
        method: 'get',
        onSuccess: function(transport) {
            $("success").innerHTML = transport.responseText;
		}
    });
    $("Comment").value = "";
}

// Displays comments associated with this news articles, in bunches of 10. The 'pageno' variable decides which batch.
function populateComments(newsid, pageno) {
    var url = 'ajax_populatecomments.asp?newsid=' + newsid + '&pageno=' + pageno;
    //alert(url);
    new Ajax.Request(url, {
        method: 'get',
        onSuccess: function(transport) {
            $("comments").innerHTML = transport.responseText;
            $("success").innerHTML = "";
		}
    });
}