function InitBubbles()
{
	$('img.more').click(function() {

		if ($(this).prev().hasClass("active"))
			return;

		$('#firstBioSentence').hide();

		var shown = false;
		var title = this;

		$('div.balloon').each(function() {

			if ($(this).css('display') != 'none')
			{
				shown = true;

				$('#b' + this.id).removeClass("active")

				$(this).fadeOut(200, function() {
					$('#bb' + title.tabIndex).addClass("active");
					$('#b' + title.tabIndex).fadeIn(200);
				});

				return false;	// Interrompo loop "each"
			}
		});

		if (! shown)
		{
			$('#bb' + this.tabIndex).addClass("active");
			$('#b' + this.tabIndex).fadeIn(200);
		}
	});

	$('.closeBox').click(CloseBubble);
	$('.closeLink').click(CloseBubble);

	$('.closeBoxBlack').click(function() {
		ShowArea('grayBack')
	});

	$('.closeLinkBlack').click(function() {
		ShowArea('grayBack')
	});
};


function CloseBubble()
{
	$(this).parents(".balloon").fadeOut(200, function() {
		$('#firstBioSentence').show();
	});

	$('#b' + $(this).parents(".balloon").get(0).id).removeClass("active");
};


function ShowArea(area)
{
	var other = (area == 'blackBack' ? 'grayBack' : 'blackBack');
	$('div.balloon .' + other).hide();
	$('div.balloon .' + area).show();
}
