  // * * * * * * * *
$(document).ready(function($) {
// * * * * * * * * * * * * * * * *
$.fn.localScroll = function () {
 target = $(this).length ? $(this) : $('body');
 var targetOffset = target.offset().top;
	$('html,body').animate({scrollTop: targetOffset}, 1000);
}
// * * * * * * * * * * * * * * * *
$('.unhide').css('cursor','help').siblings(':not(.unhide)').addClass('hidden');
// * * * * * * * * * * * * * * * *
 $('.hidden').hide();
// * * * * * * * * * * * * * * * *
$("a.external,a[href*='http://']:not([href*='"+location.hostname+"'])").attr('target','_blank').attr('rel','nofollow');
// * * * * * * * * * * * * * * * *
 $('#ajaxSearch_input').focus(function(e) {$(this).addClass('focus');}).blur(function(e) {$(this).removeClass('focus');});
// * * * * * * * * * * * * * * * *
if (MODX_OP_STATUS) {
	$.gritter.add({
			title: MODX_OP_TITLE,
			text: MODX_OP_TEXT,
			sticky: true,
			class_name: MODX_OP_STATUS
		})
 };
// * * * * * * * * * * * * * * * *
$('.unhide').click(function(){
 $(this).nextAll(' .hidden').fadeIn();
 $(this).remove();
});
// * * * * * * * * * * * * * * * *
$('.nyroModal').nyroModal();
// * * * * * * * * * * * * * * * *
if (location.hash!='#login') $('#login').hide();
if (location.hash!='#signup') $('#signup').hide();
$(location.hash).localScroll();
// * * * * * * * * * * * * * * * *
$('.go-login').click(function(e){
 e.preventDefault();
 $('#signup').fadeOut();
 $('#login').fadeIn().localScroll();
 return false;
});
// * * * * * * * * * * * * * * * *
$('.go-signup').click(function(e){
 e.preventDefault();
 $('#login').fadeOut();
 $('#signup').fadeIn().localScroll();
 return false;
});
// * * * * * * * * * * * * * * * *
$('a[href=#][class*=protect]').click(function(e) {
 e.preventDefault();
 alert("Queste risorse sono disponibili solamente per gli utenti autorizzati...");
 return false;
});
// * * * * * * * * * * * * * * * *
$(".a-panel").each(function() {
 $(this).buildMbExtruder({
          position:"top", // left, right, bottom
          textOrientation:"bt", // or "tb" (top-bottom or bottom-top)
          fromRight: 40,
          positionFixed:false,
          sensibility:800,
          extruderOpacity:1,
          onExtOpen:function(){},
          onExtContentLoad:function(){},
          onExtClose:function(){},
          hidePanelsOnClose:true,
          autoCloseTime:0, // 0=never
          slideTimer:300
//
	});
});
// * * * * * * * * * * * * * * * *
// * * * * * * * *
}); // END READY
 // * * * * * * * *

