function aj_jQ(div, type, data, loader) {
	if (loader=='sel') var ld='<select><option>caricamento...</option></select>';
	else if (loader=='white') ld='<img src="'+DirLoader+'loader_white.gif" class="loader_white" />';
	else if (loader=='NULL') ld='';
	
	$(div).html(ld);
	
	$.ajax({
	   type: type,
	   url: DirAjFun,
	   data: data,
	   dataType: "html",
	   success: function(html){
	     $(div).html(html);
	   }
	});
}

/* /////////////////////////////////////////////////////////////////////////////////////////////////// */
function GrayBackground() { 
	var height_window = $(window).height(); 
	var width_window = $(window).width();
	$('#black_background').css({ position:'fixed', top:0, left:0, width:'3000px', height:'3000px', background:'#333', opacity:'0.7' }).fadeIn('normal');
	$('#black_background').click(function(){
		$('#black_background').fadeOut('fast'); 
	});
}


/* /////////////////////////////////////////////////////////////////////////////////////////////////// */
function PopLarge(div) {
	
	GrayBackground();
	
	if ($(window).height() < 600) $('#'+div).css('height', $(window).height()-150 );
	if ($(window).width() < 800) $('#'+div).css('width', $(window).width()-150 );
	
	$('#'+div).AbsoluteCenterDiv().show().css('z-index','10000');
	$("#black_background").click( function(){ 
		$('#'+div).hide();
		$('#black_background').fadeOut('fast');
	});
	
}

/* /////////////////////////////////////////////////////////////////////////////////////////////////// */
jQuery.fn.AbsoluteCenterDiv = function () {
    this.css("position","absolute");
    this.css("top", ( $(window).height() - this.outerHeight() ) / 2+$(window).scrollTop() + "px");
    this.css("left", ( $(window).width() - this.outerWidth() ) / 2+$(window).scrollLeft() + "px");
    return this;
}


