var TITEMS = [ 
 ["About Issue Tracker", "t-about.html", "9"],
 ["Using the Issue tracker", "using.html", "2",
  ["Access Project Tracker", "t-accessing.html", "11"],
  ["Show List of Issues", "caselist.html", "11"],
  ["New Case", "t-newcase.html", "11"],
  ["New Project", "t-newproject.html", "11"],
  ["Reports", "t-reports.html", "11"],
  ["Sync", "t-sync.html", "11"],
  ["Track Time", "TrackTime.html", "11"],
  ["Search, Advanced Search, and Filter", "t-newfilter.html", "11"],
  ["Edit a Case", "t-editcase.html", "11"]
 ],
 ["Administration of the Issue Tracker", "admin.html", "2",
  ["Configure Fields, Options, and Rules", "t-configureproject.html", "11"],
  ["Publish Input Form", "t-publish.html", "11"],
  ["Publish Knowledge Base", "t-kb.html", "11"],
  ["Email Capture", "emailcapture.html", "11"]
 ]
];


function arr_flatten (x) {
   var y = []; if (x == null) return y;
   for (var i=0; i<x.length; i++) {
      if (typeof(x[i]) == "object") {
         var flat = arr_flatten(x[i]);
         for (var j=0; j<flat.length; j++)
             y[y.length]=flat[j];
      } else {
         if ((i%3==0) && (x[i+1] != null))
          y[y.length]=x[i+1];
      }
   }
   return y;
}

function arr_findNext (url, cnt)
{
   var y = arr_flatten(TITEMS);
   for (var i = 0; i<y.length; i++) {
     if (y[i] == url) {
       ni = i + cnt;
       if (ni < 0) ni = 0;
       if (ni > y.length-1) ni = y.length-1;

       return y[ni];
     }
   }
   return "";
}

