/**
 * @author Bruno
 */
$(document).ready(function()
{
	$('.ajaxlink').mb_ajaxbox({
		fnCallBack: function () {
			//inizializza i link ajx
			$('.ajaxlink, [rel=bookmark]').mb_ajaxbox();
		},
		contentSelector:'#pagina',
		backOnClose:false,
		fadeDuration:100
	});
	
	$('#corpo').infinitescroll({
	 
	  navSelector  : "div#navigazione",            
	                 // selector for the paged navigation (it will be hidden)
	  nextSelector : "div#navigazione a:first",    
	                 // selector for the NEXT link (to page 2)
	 
	  itemSelector : "#corpo div.modulo",          
	                 // selector for all items you'll retrieve
	 
	  debug        : true,                        
	                 // enable debug messaging ( to console.log )
	 
	  loadingImg   : "http://www.campivisivi.net/wp-content/themes/campivisivi/img/bg.png",          
	                 // loading image.
	                 // default: "http://www.infinite-scroll.com/loading.gif"
	 
	  loadingText  : " ",      
	                 // text accompanying loading image
	                 // default: "<em>Loading the next set of posts...</em>"
	 
	  animate      : false,      
	                 // boolean, if the page will do an animated scroll when new content loads
	                 // default: false
	 
	  extraScrollPx: 0,      
	                 // number of additonal pixels that the page will scroll 
	                 // (in addition to the height of the loading div)
	                 // animate must be true for this to matter
	                 // default: 150
	 
	  donetext     : "" ,
	                 // text displayed when all items have been retrieved
	                 // default: "<em>Congratulations, you've reached the end of the internet.</em>"
	 
	  bufferPx     : 100,
	                 // increase this number if you want infscroll to fire quicker
	                 // (a high number means a user will not see the loading message)
	                 // new in 1.2
	                 // default: 40
	 
	  errorCallback: null,
	                 // called when a requested page 404's or when there is no more content
	                 // new in 1.2                   
	 
	  localMode    : false
	                 // enable an overflow:auto box to have the same functionality
	                 // demo: http://paulirish.com/demo/infscr
	                 // instead of watching the entire window scrolling the element this plugin
	                 //   was called on will be watched
	                 // new in 1.2
	                 // default: false
	 
	 
	    },function(arrayOfNewElems){
	 
			$('.ajaxlink').mb_ajaxbox({
					fnCallBack: function () {
						//inizializza i link ajx
						$('.ajaxlink, [rel=bookmark]').mb_ajaxbox();
					},
					contentSelector:'#pagina',
					backOnClose:false,
					fadeDuration:100
				})	 
	});	
	$('#attesa').hide();
})

