$( 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('border','2px #FF9900 solid');
  });
$(".text_area_base").blur( function(){
		$(this).css('background-color','#F9F9F9').css('border','1px #D7D7D7 solid');
  });

/* EFFETTO SERVIZIO NON DOSPONIBILE */
$(".link_non_disponibile").click(function(){
		$("#attesa").css("display", "none")
		$("#opaco").css("opacity", 0.7).fadeIn("slow").css("width", $(document).width()).css("height", $(document).height());
		$("#servizio_non_disponibile").fadeIn("slow").css("top",Mytopmargin($("#servizio_non_disponibile").height()) + "px").css("left", Myleftmargin($("#servizio_non_disponibile").width()) + "px");
		return false;
   });
$("#chiudi").click(function(){
		$("#servizio_non_disponibile").css("display", "none");
		$("#opaco").css("display", "none");
		$("#attesa").css("display", "none");
		return false;
   });

/* EFFETTO CARICAMENTO SCHEDA UTENTE*/
$(".link_scheda_utente").click(function(){
		$("#opaco").css("display", "block").css("opacity", 0.7).css("width", $(document).width()).css("height", $(document).height());
		$("#scheda_utente").fadeIn("slow").css("top",Mytopmargin($("#scheda_utente").height()) + "px").css("left", Myleftmargin($("#scheda_utente").width()) + "px");
		return false;
   });
/* EFFETTO CHIUSURA SCHEDA UTENTE*/
$("#chiudi_scheda").click(function(){
		$("#scheda_utente").fadeOut("slow");
		$("#opaco").fadeOut("slow");
		return false;
   });


}); /* 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;
};

