/*function check_comments_form()
{
	var msg = "";
	
	if (jQuery.trim($("#comments_form input[name='user']").attr("value")) == "") {
		msg += "Укажите свое имя.\n";
	}
	
	if (jQuery.trim($("#comments_form textarea[name='content']").attr("value")) == "") {
		msg += "Введите текст комментария.\n";
	}
		
	if (msg != "") {
		alert(msg);
		return false;
	}
	
	return true;
}*/

function post_comment(parent_id)
{
	if (jQuery.trim($("#center_comments_form textarea[name='content[" + parent_id + "]']").attr("value")) == "") {
		alert("Введите текст комментария.");
		return;
	}
	
	$("#center_comments_form input[name='parent_id']").attr("value", parent_id);
	$("#center_comments_form").submit();
}

function process_comments(text_id, root_comment_id)
{
	$.get("/ajax/comments/" + text_id + ".html?root_comment=" + root_comment_id, function(data) {$("#center_comments_block").html(data);});
	
	return false;
}

function process_answer_form(answer_form_id)
{
	if ($("#" + answer_form_id).css("display") == "none") {
		//$("#" + answer_form_id).css({ display : "block" });
		$("div[id^=answer_form]").hide("fast");
		$("#" + answer_form_id).show("fast");
	} else {
		//$("#" + answer_form_id).css({ display : "none" });
		$("#" + answer_form_id).hide("fast");
	}
}