var TITEMS = [ 
 ["Help System.", null, "1",
  ["What's new", "what's new.htm", "11"],
  ["What is it", "what is.htm", "17"],
  ["System Requirements", "system requirements.htm", "17"],
  ["Before You Begin", null, "1",
   ["How it's works", "how it's works.htm", "17"]
  ],
  ["Work With the Program", null, "1",
   ["Common options", "common-options.htm", "11"],
   ["Memory options", "memory-options.htm", "11"],
   ["Disk options", "disk-options.htm", "11"],
   ["CPU options", "cpu-options.htm", "11"],
   ["Processes options", "processes-options.htm", "11"],
   ["Network sessions options", "netsessions-options.htm", "11"],
   ["Connected users options", "connected-users-options.htm", "11"],
   ["Connected computers options", "connected-computers-options.htm", "11"],
   ["Computers near me options", "computers-near-me-options.htm", "11"],
   ["Network traffic options", "traffic-options.htm", "11"],
   ["Network Connections", "net-connections.htm", "11"]
  ],
  ["Contacts", null, "1",
   ["Company", "company.htm", "15"],
   ["Support", "support.htm", "11"],
   ["Report a bug", "report a bug.htm", "24"]
  ],
  ["License Agreement and Registration", null, "1",
   ["END-USER LICENSE AGREEMENT FOR THIS SOFTWARE", "end-user license agreement for this software.htm", "11"],
   ["Distribution of Evaluation Version", "distribution of evaluation version.htm", "11"],
   ["Why Register?", "why register.htm", "11"],
   ["Unregistered version limitations", "unregistered version limitations.htm", "11"],
   ["Register Online", "register online.htm", "11"],
   ["Enter Registration Code", "enter registration code.htm", "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 "";
}
