/* Author: 

*/

$('ul#imagelist').infinitescroll({
 
  navSelector  : "div#pagenav",           
 
  nextSelector : "div#pagenav a:first",
  itemSelector : "ul#imagelist li",          
  debug        : true,                        
  loadingImg   : "http://www.infinite-scroll.com/loading.gif",          
  loadingText  : "Loading more images...",      
  animate      : false,      
  extraScrollPx: 50,      
  donetext     : "No mas" ,
  bufferPx     : 40,
  errorCallback: function(){},
  localMode    : true
                   // 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){
   
       // optional callback when new content is successfully loaded in.
   
       // keyword `this` will refer to the new DOM content that was just added.
       // as of 1.5, `this` matches the element you called the plugin on (e.g. #content)
       //                   all the new elements that were found are passed in as an array
   		var viewportHeight = $(window).height()*.98;
   		$('#imagelist li img').css("max-height", viewportHeight);
  });  

$(document).ready(function(){
		var viewportHeight = $(window).height()*.98;
		$('#imagelist li img').css("max-height", viewportHeight);


});


$(window).resize(function() {
	var viewportHeight = $(window).height()*.98;
	$('#imagelist li img').css("max-height", viewportHeight);

});











