var min_height_post = 250;
var max_height_post = 0;
var is_post_full = false;
obj_full_post = $('#full_post');

function height_post_all() {
	var temp = obj_full_post.clone().css({
		width: '480px',
		height: 'auto',
		visibility: 'hidden',
		position: 'absolute'
	});
	temp.attr('id', 'full_post_removable');
	obj_full_post.after(temp);
	max_height_post = temp.height();
	temp = null;
	$('#full_post_removable').remove();
}

function show_all_post(x) {
	if (is_post_full === false) {
		obj_full_post.animate({
			height: max_height_post
		}, function() {
			$(this).css('height', 'auto');
			$('#button_show_all_post').text('свернуть запись');
			$('#button_show_all_post_div').removeClass('dis_white').find('.imgs').removeClass('i_v_down').addClass('i_v_up');
		});
		is_post_full = true;
	} else {
		obj_full_post.animate({
			height: min_height_post
		}, function() {
			$(this).css('height', min_height_post + 'px');
			$('#button_show_all_post').text('развернуть запись');
			$('#button_show_all_post_div').addClass('dis_white').find('.imgs').removeClass('i_v_up').addClass('i_v_down');
		});
		is_post_full = false;
	}
}

height_post_all();

if (max_height_post > min_height_post) {
	$('#button_show_all_post_div').show();
}
