var $j = jQuery.noConflict();

jQuery(function(){
	// cambia classe elementi del header
	jQuery('#masthead span').hover(
		function(){
		jQuery(this).addClass('hover')
		},
		function(){
		jQuery(this).removeClass('hover');
	});
});

jQuery(function(){ // canvas page di faceboo scroll UP
	jQuery('.up').click(
		function(){
		jQuery('.container-page').stop().scrollTo( {top:'-=219px', left:'0'}, 800 );
		});
});

jQuery(function(){ // canvas page di faceboo scroll Down
	jQuery('.down').click(
		function(){
		jQuery('.container-page').stop().scrollTo( {top:'+=219px', left:'0'}, 800 );
		});
});

jQuery(function(){
       //Tendina destra (icone)
	   $j('.cover').hover(function(){
	    $j(".cover", this.parent).stop().animate({top:'0px'},{queue:true,duration:100});
	    }, function() {
	    $j(".cover", this.parent).stop().delay(500).animate({top:'-50px'},{queue:true,duration:100});
	    })
});

jQuery(function(){
       //tendina sinistra (login)
	   $j('.tent').hover(function(){
		$j(".tent", this.parent).stop().animate({top:'0px'},{queue:true,duration:280});
		}, function() {
		$j(".tent", this.parent).stop().delay(500).animate({top:'-140px'},{queue:true,duration:280});
		})
});

$j(document).ready(function($) {
	$.localScroll();
	$('.no-java').hide();

	$j('.ajax-navi a').live('click', function(e){
				e.preventDefault();
				var link = jQuery(this).attr('href');
	//$('#featured').html('<span style="display:block;text-align:center;font-size:50px;padding:90px 0 0 0;"><p>Loading...</p></span>');
	
				$('#featured').fadeOut(800,function() {
					$('#featured').load(link + ' #ajax-div', function(){
						$('#featured').fadeIn(800, function() { $(this).removeAttr('style', 'filter');});
					});
				});
			});

	$j('.navi-blog a').live('click', function(e){
				e.preventDefault();
				var link = jQuery(this).attr('href');
				$j('.ajax-container').fadeTo(800,0.01, function() {
					$('.ajax-container').load(link + ' #ajax-blog', function(){
					$j('.ajax-container').fadeTo(800,1.0, function() { $(this).removeAttr('style', 'filter');});
					Shadowbox.setup();
					});
				});	
			});

});

