$( function() {

/* EFFETTO CARICAMENTO PAGINA */
$("#nav1 a, #contenitore_oggetti a, .link_container a, #colonna_centrale a").click(function(){
		$("#opaco").css("display", "block").css("opacity", 0.7).css("width", $(document).width()).css("height", $(document).height());
		$("#attesa").css("opacity", 0.85).fadeIn("slow").css("top",Mytopmargin($("#attesa").height()) + "px").css("left", Myleftmargin($("#attesa").width()) + "px");
		return true;
   });

/*EFFETTO FADE SULLA STESSA PAGINA */
$("#barra_filtri a, .barra_navigazione a, .titolo_sezione a").click(function(){
		$("#contenitore_oggetti").fadeTo("fast",0.01);
		return true;
   });

/*EFFETTO FADE SULLA STESSA PAGINA */
$("a.nav2").click(function(){
		$("#content").fadeTo("fast",0.01);
		return true;
   });

/*EFFETTO ENFASI SULLE TEXT BOX E TEXT AREA */
$(".text_input_base").focus( function(){
		$(this).css('background-color','white').css('border','2px #FF9900 solid');
  });
$(".text_input_base").blur( function(){
		$(this).css('background-color','#F9F9F9').css('border','1px #D7D7D7 solid');
  });

$(".text_area_base").focus( function(){
		$(this).css('background-color','white').css('height','500px').css('border','2px #FF9900 solid');
  });
$(".text_area_base").blur( function(){
		$(this).css('background-color','#F9F9F9').css('height','150px').css('border','1px #D7D7D7 solid');
  });

$("#chiudi").click(function(){
		$("#servizio_non_disponibile").css("display", "none");
		$("#opaco").css("display", "none");
		$("#attesa").css("display", "none");
		return false;
   });


/* EFFETTO SULLE IMMAGINETTE DEL NAVIGATORE */
$(".navigatore_preview_immagine_box").css("opacity", 0.6);
$(".navigatore_preview_immagine_box").hover( function(){
							$(this).css("border-color", "red").css("border-width", "1px");
							$(this).css("opacity", 1);
						}, function(){
							$(this).css("border-color", "#CCCCCC").css("border-width", "1px");
							$(this).css("opacity", 0.6);
						}
						);

/* EFFETTO TOOLTIP SCHEDA UTENTE DESTRA */
$(".link_scheda_utente").tooltip({
	tip: '#scheda_utente',
	offset: [100,250],
	delay: 700,
});
/* EFFETTO TOOLTIP SCHEDA UTENTE SINISTRA */
$(".link_scheda_utente_sx").tooltip({
	tip: '#scheda_utente',
	offset: [150,-235],
	delay: 700,
});
/* EFFETTO TOOLTIP SUL BOX DI LOGIN */
$(".login_tooltip").tooltip({
	tip: '#tooltip',
	offset: [-10,30],
	delay: 100,
});
$(".login_link_tooltip").tooltip({
	tip: '#tooltip',
	offset: [5,0],
	delay: 100,
});
			
$(".close_button").click(function(){
	$(".tooltip").fadeOut("fast");
	return false;
});

/* EFFETTO TOOLTIP DOWNLOAD FILE */
$(".download_tooltip").tooltip('#tooltip');


});
/* FINE FUNZIONI EFFETTI */

function Mytopmargin(AltezzaOggetto) {
	var x = Math.round(($(window).height()-AltezzaOggetto)/2+$(document).scrollTop());
	return x;
};
function Myleftmargin(LarghezzaOggetto) {
	var x = Math.round(($(window).width()-LarghezzaOggetto)/2+$(document).scrollLeft());
	return x;
};

