  var menu = 
    [ 
     "index.html", "kap1.html", "kap1-1.html", "kap1-2.html",
     "kap1-3.html", "kap1-4.html", "kap1-5.html", "kap1-6.html",
     "kap1-7.html", "kap1-7-1.html", "kap1-7-2.html", "kap1-8.html", 
     "kap2.html", "kap2-1.html", "kap2-2.html", "kap2-2-1.html", 
     "kap2-2-2.html", "kap2-2-3.html", "kap2-2-4.html", "kap2-3.html",
     "kap2-3-1.html", "kap2-3-2.html", "kap3.html", "kap3-1.html", 
     "kap3-2.html", "kap3-3.html",
     "kap4.html", "kap4-1.html", "kap4-2.html",
     "exercises.html", 
     "exercise1.html", "solution1.html",
     "exercise2.html", "solution2.html",
     "exercise3.html", "solution3.html",
     "exercise4.html", "solution4.html",
     "exercise5.html", "solution5.html",
     "exercise6.html", "solution6.html",
     "exercise7.html", "solution7.html",
     "exercise8.html", "solution8.html",
     "exercise9.html", "solution9.html",
     "exercise10.html", "solution10.html",
     "exercise11.html", "solution11.html",
     "exercise12.html", "solution12.html",
     "exercise13.html", "solution13.html",
     "exercise14.html", "solution14.html",
     "exercise15.html", "solution15.html",
     "exercise16.html", "solution16.html",
     "exercise17.html", "solution17.html",
     "appendix.html", "app-herl.html",
     "tables.html", "table1.html", "table2.html", 
     "table3.html", "table4.html", "table5.html",
     "table6.html", "app-a.html", "app-b.html"
     ];

  var pageindex;

  function initIndex() {
    myname = window.location.href;
    for (i=0; i < menu.length; i++) {
      if (myname.indexOf(menu[i]) != -1) {
	pageindex = i;
	return;
      }
    }
  }

  function setIndex(i) {
    pageindex = i;
    displayit();
  }

  function increment() {
    if (pageindex < menu.length - 1) {
      pageindex++;
    }
    displayit();
  }

  function decrement() {
    if (pageindex > 0) {
      pageindex--;
    }
    displayit();
  }

  function displayit() {
    window.location.href = menu[pageindex];
  }
