// JavaScript Document
$(document).ready(function(){
//prima di tutto carico i contenuti
	$(window).load(function(){
	//faccio comparire i tweet
	$('#twitter_div').fadeIn(500);
	$('#searchPath').fadeIn(500);
	//barra di ricerca
	$('#advancedBtn').click(function(){
		$('#searchBar').animate({
			width:'928px'},500),
		$('#advancedBox').animate({
			width:'410px'},500);
	return false;
	});
	
$('#closeBox').click(function(){
	$('#articles,#noResult').hide();
	return false;		
});

$('#left , #right').scrollToFixed({
		marginTop: $('#header').outerHeight(true) - 0,
		limit: $('#footer').offset().top - $('#left').outerHeight(true) - 50,
		zIndex: 9,
		fixed: function() {},
	});

$('#anchorNav').scrollToFixed({
		marginTop: $('#header').outerHeight(true) + 10,
		limit: $('#footer').offset().top - $('#anchorNav').outerHeight(true) - 0,
		zIndex: 9,
		fixed: function() {  },
	});

});

	$('#newsContainer').cycle({ 
		fx:      'scrollHorz', 
		speed:   500, 
		timeout: 0,
		next:   '#next', 
		prev:   '#prev',
		pager:  '#pager',
		height: 'auto',
		activePagerClass: 'active' 
	});
	$('#advBox').cycle({ 
		fx:      'scrollHorz', 
		speed:   600, 
		timeout: 5000,
		pager: '#pageradv',
		activePagerClass: 'active' 	
});});
