$(document).ready(function() {

	$("#fancybox").fancybox({
		'frameWidth'		: 660,
		'overlayShow'		: false
	});

	$('#tabs_area1 div').click(function(){ //When any link is clicked
		$('#tabs_area1 div').removeClass('active'); // Remove active class from all links
		$(this).addClass('active'); //Set clicked link class to active
		var currentTab = $(this).attr('id'); // Set variable currentTab to value of href attribute of clicked link
		//alert(currentTab);
		return false;
	});

	$('#tabs_area1 div').mouseover(function() {
		
		$(this).stop();
		$(this).addClass('mouseover');
		
		}).mouseout(function() {

			$(this).stop();
			$(this).removeClass('mouseover');
		
	});

	

	$('#tabs_area2 div').click(function(){ //When any link is clicked
		$('#tabs_area2 div').removeClass('active'); // Remove active class from all links
		$(this).addClass('active'); //Set clicked link class to active
		var currentTab = $(this).attr('id'); // Set variable currentTab to value of href attribute of clicked link
		//alert(currentTab);
		richiudi_news();
		return false;
	});

	$('#tabs_area2 div').mouseover(function() {
		
		$(this).stop();
		$(this).addClass('mouseover');
		
		}).mouseout(function() {

			$(this).stop();
			$(this).removeClass('mouseover');
		
	});
	
	
	
	$('#tabs_area3 div').click(function(){ //When any link is clicked
		$('#tabs_area3 div').removeClass('active'); // Remove active class from all links
		$(this).addClass('active'); //Set clicked link class to active
		var currentTab = $(this).attr('id'); // Set variable currentTab to value of href attribute of clicked link
		//alert(currentTab);
		richiudi_news();
		return false;
	});

	$('#tabs_area3 div').mouseover(function() {
		
		$(this).stop();
		$(this).addClass('mouseover');
		
		}).mouseout(function() {

			$(this).stop();
			$(this).removeClass('mouseover');
		
	});
	
	
	
});


	function scegli_tab_palinsesto () {
		$('#tabs_area1 div').removeClass('active'); // Remove active class from all links
		$('#tab_palinsesto').addClass('active'); //Set clicked link class to active
	}
	
	function scegli_tab_correlati () {
		$('#tabs_area1 div').removeClass('active'); // Remove active class from all links
		$('#tab_correlati').addClass('active'); //Set clicked link class to active
	}
	
	function scegli_tab_ricerca () {
		$('#tabs_area1 div').removeClass('active'); // Remove active class from all links
		$('#tab_ricerca').addClass('active'); //Set clicked link class to active
	}
	

	function scegli_tab_infovideo () {
		$('#tabs_area2 div').removeClass('active'); // Remove active class from all links
		$('#tab_infovideo').addClass('active'); //Set clicked link class to active
		richiudi_news();
	}
	
	function scegli_tab_commenti () {
		$('#tabs_area2 div').removeClass('active'); // Remove active class from all links
		$('#tab_commenti').addClass('active'); //Set clicked link class to active
		richiudi_news();
	}
	
	
/*
	function allarga_news() {
	
			$("#ajaxcontentarea2").animate({ 
				height: "0px"
			}, 900,function() {
				
				$("#area_news").animate({ 
					top: "70px"
				}, 900, function() {

					$("#ajaxcontentarea3").animate({ 
						height: "462px"
					}, 900 );
				
				} );
			
			} );	
	
	}
	
	function richiudi_news() {
	
			$("#ajaxcontentarea2").animate({ 
				height: "284px"
			}, 900,function() {
				
				$("#area_news").animate({ 
					top: "352px"
				}, 900, function() {

					$("#ajaxcontentarea3").animate({ 
						height: "180px"
					}, 900 );
				
				} );
			
			} );	
	
	}
*/
	