var _baloonCounter = 0;
var _baloonDelay = 6000;
var _baloonAttivi = 0;

function Baloon(title, message, fisso) {
	if(fisso == null || fisso == false) fisso = false;
	else fisso = true;
	
	var id = ++_baloonCounter;
	
	var html = "";
	html += '<div id="baloon-'+id+'" style="position: absolute; z-index: '+(id+1000)+'; bottom: '+(10+_baloonAttivi*100)+'px; right: 10px; display: none; width: 280px; height: 70px; padding: 6px; border: 1px solid silver; background: white url(images/bg-silver.gif) repeat-x bottom; text-align: left;">';
	html += 	'<a class="ball" href="javascript:void(0);" onclick="$(this).parent().slideUp();" style="float: right; font-size: 10px; color: white;" title="Chiudi">X</a>'
	html += 	'<div style="margin-bottom: 6px; font-weight: bold;" class="color-blue">' + title + '</div>';
	html +=		'<div>' + message + '</div>';
	html += '</div>';
	
	$(function(){
		$("body").prepend(html);
		$("#baloon-"+id).slideDown();
		_baloonAttivi++;
		if(!fisso) {
			setTimeout(function() {
				$("#baloon-"+id).slideUp("slow");
				_baloonAttivi--;
			}, _baloonDelay);
		}
	});
}