function resizeLateral () {
	var width = $('#main').offset().left;
	var height = $('#main').height() - $('#more').height() - ($('#left').offset().top - $('#main').offset().top);
	if (height < 0) height = 0; // correção de bug, nao fazia resize quando a altura era negativa
	var offset = 14;
	$('#left').css({
		'width': width,
		'height': height,
		'left': -width
	});
	$('.data').css({
		'width': width - offset,
		'left': -width
	});
}

function closeComment () {
	$('#formComments').fadeOut(100);
	$('#layer_form').fadeOut(100);
	$('select').show();
}

function closeNotice () {
	$('#noticeActivityStream').fadeOut(100);
	$('#layer_form').fadeOut(100);
	$('select').show();
}

$(window)
	.resize(function () { resizeLateral(); })
	.load(function () {
		resizeLateral();
		$('#layer_form')
			.click(function () { closeComment(); closeNotice(); })
			.css('filter', 'alpha(opacity=40)');
	});
