var pagenumb = 0
function pagecount(){
pagenumb = pagenumb + max_paper_list
nextpage()
}


function pagecountback(){
pagenumb = pagenumb - (max_paper_list)
if (pagenumb <= 0){
    pagenumb = -1
}
nextpage()   
}


var nextpage = function() {
    // $.getJSON("./content/content.json", function (result) {
    //     stuff = result;
    //     var new_row = document.getElementById("row_main")
    //     new_row.innerHTML = "";
    //     var arrayLength = stuff.length;
    //     for (var i = 0; i < arrayLength; i++) {
    //         addcontent(stuff[i]);
    //         //Do something
    //     }
    // });


    // get paper from the Sabo result
    stuff_paper = jsonContent;
    var new_row = document.getElementById("cont_paper")
    new_row.innerHTML = "";
    var arrayLength = stuff_paper.length;
    for (var i = 0; i < arrayLength; i++) {
        if (i > pagenumb && i <= (pagenumb + max_paper_list) && i<= arrayLength){
            // if (Math.abs(arrayLength - i) <= (max_paper_list)) {
            console.log("close to " + i)
            addpaper(stuff_paper[i]);
        // }   
    }

        //Do something
    }

    json_to_bib(stuff_paper)
}