var TITEMS = [ 
 ["Introduction", null, "1",
  ["Overview", "source/html/introduction/index.htm", "11"],
  ["System Requirements", "source/html/introduction/requirements.htm", "11"],
  ["Uninstalling the Software", "source/html/introduction/uninstalling.htm", "11"],
  ["Technical Specifications", "source/html/introduction/specifications.htm", "11"],
  ["Acknowlegements", "source/html/introduction/acknowlegements.htm", "11"],
  ["History", "source/html/introduction/history.htm", "11"]
 ],
 ["How to use Audio Tags Editor", null, "1",
  ["Using Audio Tags Editor", null, "1",
   ["Renaming Files", "source/html/how to use/using/renamingfiles.htm", "11"],
   ["Renaming Folders", "source/html/how to use/using/renamingfolder.htm", "11"],
   ["Editing Tags", "source/html/how to use/using/editingtags.htm", "11"]
  ],
  ["Dialogs", null, "1",
   ["Main Form", "source/html/how to use/dialogs/mainform.htm", "11"],
   ["About Dialog", "source/html/how to use/dialogs/aboutdialog.htm", "11"],
   ["FreeDB Dialog", "source/html/how to use/dialogs/freedbdialog.htm", "11"],
   ["Mass FreeDB Dialog", "source/html/how to use/dialogs/massfreedbdialog.htm", "11"],
   ["Tags Editor", "source/html/how to use/dialogs/tagseditor.htm", "11"],
   ["Options Dialog", "source/html/how to use/dialogs/optionsdialog.htm", "11"],
   ["Rename Files Dialog", "source/html/how to use/dialogs/renamefilesdialog.htm", "11"],
   ["Rename Folder Dialog", "source/html/how to use/dialogs/renamefolderdialog.htm", "11"],
   ["Swap Tags Frames Dialog", "source/html/how to use/dialogs/swaptagsframesdialog.htm", "11"],
   ["Search Dialog", "source/html/how to use/dialogs/searchdialog.htm", "11"]
  ],
  ["Frequently Asked Questions", "source/html/how to use/faq.htm", "11"]
 ],
 ["License and warranty", "source/html/license.htm", "11"],
 ["Ordering", "source/html/ordering.htm", "11"],
 ["Support", "source/html/support.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 "";
}

