var commentcontainer="commentscontent";

function postcomment(id,cid) {
	var el=document.commentform.elements;
	//el.submit.disabled=true;
	swapout("posten");
	swapin("postresult");
	var qstr="?module=commentajax&id="+id+"&action=postcomment&commentsys="+cid;
	var i=0;
	for(el[i];i<el.length;i++) {
		qstr+="&"+el[i].name+"="+el[i].value;
	}
	sendRequest( qstr, null, null, 'postresult', 'refreshcomments("last",'+id+','+cid+')' );

}

function refreshcomments(page,id,cid) {
	var strURL = "?module=commentajax&id="+id+"&action=display&commentsys="+cid+"&c_site=" + page;
	sendRequest( strURL, null, null, commentcontainer, '' );
}

function editcomment(comment,page,id,cid) {
	var strURL = "?module=commentajax&id="+id+"&action=commentedit&commentsys="+cid+"&c_site="+page+"&commentid="+comment;
	sendRequest( strURL, null, null, commentcontainer, '' );
}

function updatecomment(id,cid) {
	var el=document.editcommentform.elements;
	//el.submit.disabled=true;
	var qstr="?module=commentajax&id="+id+"&action=commentupdate&commentsys="+cid;
	var i=0;
	for(el[i];i<el.length;i++) {
		qstr+="&"+el[i].name+"="+el[i].value;
	}
	sendRequest( qstr, null, null, commentcontainer, '');
	//sendRequest( qstr, null, null, "postresult", 'refreshcomments('+page+','+id+','+cid+')' );
}

function deletecomment(comment,page,id,cid) {
	var strURL = "?module=commentajax&id="+id+"&action=commentdelete&commentsys="+cid+"&c_site="+page+"&commentid="+comment;
	sendRequest( strURL, null, null, commentcontainer, '' );
}
