// for MCE Editor
function toggleEditor(id) {
	if (!tinyMCE.getInstanceById(id))
		tinyMCE.execCommand('mceAddControl', false, id);
	else
		tinyMCE.execCommand('mceRemoveControl', false, id);
}

/* For threaded comment reply */
var current_reply = '0';
function reply(reply_post) {
	reply_form = $('#reply-' + current_reply).html();
	$('#reply-' + current_reply).html('<a class="reply" href="#reply-' + current_reply + '" onclick="reply(' + current_reply + ')">reply</a>');
	$('#reply-' + reply_post).html(reply_form);
	$('#parent').val(reply_post);
	current_reply = reply_post;
}