(function ($) {
	// $('#rotator').cycle({});/
	
	if($('#fascia_home').length > 0)
	{
		$('#fascia_home').animate({
			opacity: 0.7
		});
	}
	
	// nascondo il rotator
	$('#rotator').hide();
	
	if($('#rotator img').length > 0)
	{
		$('#rotator img').slideshowify();
	}

	$('#mainx').css('height',$(window).height() + 'px');
	$('#contenitore').animate({opacity: 0.92},1);
	$('#innerCorpo').jScrollPane({scrollbarPadding: 10});

	// BUTTONS
	if($('.fg-button').length > 0)
	{
		$('.fg-button').hover(
			function(){ $(this).removeClass('ui-state-default').addClass('ui-state-focus'); },
			function(){ $(this).removeClass('ui-state-focus').addClass('ui-state-default'); }
		);	
	}

	if($('#hierarchy').length > 0)
	{
		$('#hierarchy').menu({
			// content: $('#hierarchy').next().html(),
			content: $('#news-items').html(),
			crumbDefaultText: ' '
		});
	}
	
	$('#positionHelper').ready(function()
	{
		// mostra
		$('#contenitore').bind('mouseenter',function()
		{
			$('#dragbar').clearQueue().delay(500).animate({'left':5,opacity:0});
			$('#contenitore').clearQueue().animate(
				{'width':690},
				{
					duration: 500,
					easing: 'swing',
					complete: function()
					{
						$('#riquadro_sx,#briciole,#newfooter,#positionHelper').clearQueue().animate({'opacity':1});
					}
				}
			);
		});

		// nascondi
		$('#contenitore').bind('mouseleave',function()
		{
			$('#dragbar').clearQueue().animate({'left':5,opacity:1});
			$('#contenitore').clearQueue().delay(900).animate(
				{'width':20},
				{
					duration: 500,
					easing: 'swing',
					complete: function()
					{
						$('#riquadro_sx,#briciole,#newfooter,#positionHelper').clearQueue().animate({'opacity':0});
					}
				}
			);
			
			// mah...
			$('#riquadro_sx,#briciole,#newfooter,#positionHelper').clearQueue().animate({'opacity':0});
		});

	});

	// uniform
	$("select, input:checkbox, input:radio, input:file, input:submit").uniform();

})(jQuery);
