$.fn.loadingBox = function(){
	
	//alert($(this).attr('id'));
	
	$(this).css('position','relative');
	
	var box = '<div id="loading" style="display:none; z-index:1000;">'
		+'	<div class="ui-overlay">'
		//+'		<div class="ui-widget-overlay"></div>'
		+'		<div class="ui-widget-shadow ui-corner-all" style="width: 100%; height: 100%; position: absolute; left: 0px; top: 0px;">'
		+'		</div>'
		+'	</div>'
		+'	<div class="ui-widget ui-widget-content ui-corner-all" style="padding: 0px; position: absolute; width: 200px; height: 60px;">'
		+'		<table style="width:100%;height:100%;" cellspacing="0" cellpadding="0">'
		+'			<tr>'
		+'				<td align="center" valign="middle">'
		+'					<img src="/img/loading.gif" style="vertical-align:middle"/>Caricamento dati'
		+'				</td>'
		+'			</tr>'
		+'		</table>'
		+'	</div>'
		+'</div>';
	$(this).append(box);
	
	var left = ($(this).children().eq(1).outerWidth(true)/2) - 100;
	var top = ($(this).children().eq(1).outerHeight(true)/2) - 30;
	
	$('.ui-widget',$(this)).css('left',left+'px');
	$('.ui-widget',$(this)).css('top',top+'px');
	
}

$.fn.loadingBox2 = function(id_box){
	
	//alert($(this).attr('id'));
	
	$(this).css('position','relative');
	
	var box = '<div id="loading" style="display:none; z-index:1000;">'
		+'	<div class="ui-overlay">'
		//+'		<div class="ui-widget-overlay"></div>'
		+'		<div class="ui-widget-shadow ui-corner-all" style="width: 100%; height: 100%; position: absolute; left: 0px; top: 0px;">'
		+'		</div>'
		+'	</div>'
		+'	<div class="ui-widget ui-widget-content ui-corner-all" style="padding: 0px; position: absolute; width: 200px; height: 60px;">'
		+'		<table style="width:100%;height:100%;" cellspacing="0" cellpadding="0">'
		+'			<tr>'
		+'				<td align="center" valign="middle">'
		+'					<img src="/img/loading.gif" style="vertical-align:middle"/>Caricamento dati'
		+'				</td>'
		+'			</tr>'
		+'		</table>'
		+'	</div>'
		+'</div>';
	$(this).append(box);
	
	var left = ($(this).outerWidth(true)/2) - 200;
	var top = ($(this).outerHeight(true)/2) - 30;
	
	$('.ui-widget',$(this)).css('left',left+'px');
	$('.ui-widget',$(this)).css('top',top+'px');
	
}