function c_reply(comm_id, username) {

	$('#comm_answer').html(
		'ответ на комментарий от <b>' + username + '</b> <a href="javascript:void(0);" onclick="doReset(); return false;">отменить</a>'
	);

	if ($('#parent_id').length == 0) {
		var new_input = document.createElement("input");
		new_input.setAttribute('type', 'hidden');
		new_input.setAttribute('name', 'parent_id');
		new_input.setAttribute('id', 'parent_id');
		new_input.setAttribute('value', comm_id);
		$('#dle-comments-form').append(new_input);
	}

	$('#parent_id').val(comm_id);
	var top = $('#dle-comments-form').css('top');
	$('html,body').animate( {
		scrollTop : top
	}, 0);

	return false;
}

function doReset() {
	$('#comm_answer').html('');
	$('#parent_id').value('0');
	return false;
}

$(document).ready(function(){
	$("#dim").css("height", $(document).height());
    $(".regLink").click(function(){
		$('html,body').animate({scrollTop:0}, 0);
    	$("body").css("overflow", "hidden");
		$("#dim").fadeIn();
		return false;
	});
    
    $("#close").click(function(){
		$("#dim").fadeOut();
    	$("body").css("overflow", "auto");
    	return false;
	});
	
	$(window).bind("resize", function(){
	 	$("#dim").css("height", $(window).height());
	});
});  
