function cmeAddComment() {
	busy.attach('cme_submit');
	new AjaxCommand('commentme').run('ajaxAddComment', $('cme_inputForm').toObject());
}

function cmeAddEditForm(commentid) {
	busy.attach('cme_add_edit_'+commentid);
	new AjaxCommand('commentme').run('ajaxGetEditForm', {'commentid' : commentid, 'activecommentid' : cme_activecommentid });
	cme_activecommentid = commentid;
}

function cmeEditComment() {
	busy.attach('cme_edit_submit');
	new AjaxCommand('commentme').run('ajaxEditComment', $('cme_editForm').toObject());
	cme_activecommentid = 0;
}

function cmeAddReplyForm(commentid) {
	busy.attach('cme_add_reply_'+commentid);
	new AjaxCommand('commentme').run('ajaxGetReplyForm', {'contentid' : $('cme_contentid').value, 'parentid' : commentid, 'activecommentid' : cme_activecommentid, 'option' : cme_option, 'task' : cme_task });
	cme_activecommentid = 0;
}

function cmeReplyComment() {
	busy.attach('cme_reply');
	new AjaxCommand('commentme').run('ajaxReplyComment', $extend($('cme_replyForm').toObject(), {'cme_linktocontent' : $('cme_linktocontent').value} ) );
}

function cmeDeleteComment(commentid) {
	busy.attach('cme_delete_'+commentid);
	new AjaxCommand('commentme').run('ajaxDeleteComment', {'commentid' : commentid});
}

function fixEntryClass(entryid) {

	var entry = $('cme_entry_'+entryid);
	if (!entry) {
		return;
	}

	var odd;
	if (entry.getPrevious()) {
		//ha van testvere, akkor a testverrel ellentetes kell legyen
		odd = entry.getPrevious().hasClass('odd');
	} else {
		//egyebkent biztos van szuloje
		odd = entry.getParent().hasClass('odd');
	}
	
	if (!odd) {
		entry.addClass('odd');
	}
}