var page = 2;
var runs = 2;

function ScrollExecute() {
    scrollNode = $('#more-gore').last();    
    scrollURL = $('#more-gore p a').last().attr("href");
    if(scrollNode.length > 0) {
      $.ajax({
        type: 'GET',
        url: '/?page=' + page,
        beforeSend: function() {
 	        scrollNode.hide();
        },
        success: function(data) {
	        page += 1;
            var filteredData = $(data).find(".product");
            filteredData.appendTo( ".product-list" );
            runs -= 1;
            if (runs > 0) {
                ScrollExecute();
            }
        },
        dataType: "html"
      });
    }
}

$(document).ready(function () {
    setTimeout(function () {
      ScrollExecute();
    }, 3000);
});
