function pop_buttons(button, number, operation) {
  button.on("click", function() {
    // hides last divs
    for (let i = 0; i < ArrPages[nPage].divName.length; i++) {
      $("#" + ArrPages[nPage].divName[i]).css("display", "none");
    }
    // changes page counter
    // if the operation is to add, the number is added to page counter
    if (operation === "add"){
      nPage = nPage + eval(number);
    }
    // if the operation is to equal, page counter is compared to the number 
    else if (operation === "equal") {
      nPage = eval(number);
    }
    // shows next page
    movePage();     
  })
}
// function that adds events listeners to buttons that affects the page's display- called only one time for each button
function that adds events listeners to buttons that affects the page's display- called only one time for each button
function that adds events listeners to buttons that affects the page ' s display - called only one time for each button
function pop_buttons(button, number, operation) {
  button.on("click", function() {
    for (let i = 0; i < ArrPages[nPage].divName.length; i++) {
      $("#" + ArrPages[nPage].divName[i]).css("display", "none");
    }
    if (operation === "add"){
      nPage = nPage + eval(number);
    }
    else if (operation === "equal") {
      nPage = eval(number);
    }
    movePage();     
  })
}
function pop_buttons ( button , number , operation ) { button . on ( "click" , function ( ) { for ( let i = 0 ; i < ArrPages [ nPage ] . divName . length ; i ++ ) { $ ( "#" + ArrPages [ nPage ] . divName [ i ] ) . css ( "display" , "none" ) ; } if ( operation === "add" ) { nPage = nPage + eval ( number ) ; } else if ( operation === "equal" ) { nPage = eval ( number ) ; } movePage ( ) ; } ) }
function that adds events listeners to buttons that affects the page's display- called only one time for each button
function that adds events listeners to buttons that affects the page ' s display - called only one time for each button
// hides last divs // changes page counter // if the operation is to add, the number is added to page counter // if the operation is to equal, page counter is compared to the number  // shows next page