$(function(){
	if ($('#comments_content').val() == '') {$('#comments_content').val('Комментировать...');}
	$('#comments_content').focus(function () {
		if ($('#comments_content').val() == 'Комментировать...'){$('#comments_content').val('');}
	});
	$('#comments_content').blur(function () {
		if ($('#comments_content').val() == ''){$('#comments_content').val('Комментировать...');}
	});
	$("form").submit(function() {
      if ($("#comments_content").val() != "Комментировать..." && $("#comments_content").val() != "") {
        return true;
      }
      return false;
    });

	$(".answer").show();

    
	$('#comments_login_method').change(function () {
		var str = "";
		$("#comments_login_method option:selected").each(function () {
           str += $(this).text();
        });
        if (str == 'анонимного пользователя'){
			$("#comments_author").show();
			$(".comments_author").show();
			$("#comments_email").hide();
			$(".comments_email").hide();			
			$("#comments_password").hide();
			$(".comments_password").hide();			
			$(".loginza_auth").hide();
		}
        if (str == 'пользователя aradm.ru'){
			$("#comments_author").hide();
			$(".comments_author").hide();			
			$("#comments_email").show();
			$(".comments_email").show();			
			$("#comments_password").show();
			$(".comments_password").show();
			$(".loginza_auth").hide();
		}
        if (str == 'пользователя другого сайта'){
			$("#comments_author").hide();
			$(".comments_author").hide();
			$("#comments_email").hide();
			$(".comments_email").hide();
			$("#comments_password").hide();
			$(".comments_password").hide();
			$(".loginza_auth").show();
		}
        if (str == 'регистрироваться на aradm.ru'){
			$("#comments_author").show();
			$(".comments_author").show();
			$("#comments_email").show();
			$(".comments_email").show();
			$("#comments_password").show();
			$(".comments_password").show();
			$(".loginza_auth").hide();
		}				              
	}).change();

});
function answerto(parent_id,nik) {
	$('#comments_parent_id').val(parent_id);
	$('#comments_content').val(nik+', ');
}

