var page=1;
$(document).ready(function() {
	load = true;	
	function updatestatus(){$('#status').text('Loading Items');}
             {
					    //page=page+1;
						var url1='new-items1.jsp?pageNumber='+page;
						var url2='new-items2.jsp?pageNumber='+page;
						var url3='new-items3.jsp?pageNumber='+page;
					if(load == true) {
			
			$.get(url1, '', function(newitems)
			{
			var timeOut = setTimeout(function() {$('#column1').append(newitems);}, 600);
			$("#status").fadeOut("slow");
			});
			
			$.get(url2, '', function(newitems2){
			var timeOut = setTimeout(function(){$('#column2').append(newitems2);}, 600);
						$("#status").fadeOut("slow");
			});			
			$.get(url3, '', function(newitems3){
			var timeOut = setTimeout(function() {$('#column3').append(newitems3);}, 600);
						$("#status").fadeOut("slow");						 
		    });	
			
		updatestatus();
            }
			}
});
$(document).ready(function() {

	var nextpage = 10;
	load = true;
	$(window).scroll(function(){
			function updatestatus(){
			$('#status').text('Loading Items');}

			if($(window).scrollTop() == $(document).height() - $(window).height()) {
				if(scroll != 1) {
					    page=page+1;
						var url1='new-items1.jsp?pageNumber='+page;
						var url2='new-items2.jsp?pageNumber='+page;
						var url3='new-items3.jsp?pageNumber='+page;
					if(load == true) {
			$.get(url1, '', function(newitems){
			var timeOut = setTimeout(function() {
						$('#column1').append(newitems);
						}, 600);
						$("#status").fadeOut("slow");
						 
			});
			$.get(url2, '', function(newitems2){
			var timeOut = setTimeout(function() {
						$('#column2').append(newitems2);
						}, 600);
						$("#status").fadeOut("slow");
						 
		});			
			$.get(url3, '', function(newitems3){
			var timeOut = setTimeout(function() {
						$('#column3').append(newitems3);
						}, 600);
						$("#status").fadeOut("slow");
						 
		});		
		updatestatus();


				
					
					}
				}
			}
	});

});
