var TITEMS = [ 
 ["Tito Web Studio Manual", "source/index.html", "11"],
 ["Installation", "source/setup.html", "11"],
 ["License", "source/license.html", "11"],
 ["Getting Started", "source/getstart/ide.html", "1",
  ["Key Concept", "source/getstart/keyconcepts.html", "11"],
  ["Starting With the Basic IDE Tasks", "source/getstart/howto.html", "11"]
 ],
 ["IDE User Interface", "source/ui/index.html", "1",
  ["Managing Window", "source/ui/window.html", "11"],
  ["Using Spreadsheet", "source/ui/spreadsheet.html", "11"],
  ["Special IDE Windows", "source/ui/ide/index.html", "1",
   ["Log Window", "source/ui/ide/log.html", "11"],
   ["Running Document Window", "source/ui/ide/source.html", "11"],
   ["Cache Explorer", "source/ui/ide/cache.html", "11"],
   ["Welcome Window", "source/ui/ide/welcome.html", "11"],
   ["Property WIndow", "source/ui/ide/property.html", "11"]
  ],
  ["Keyboard Shortcut", "source/ui/shortcut.html", "11"]
 ],
 ["Projects in the IDE", "source/projects/index.html", "1",
  ["Configuring a Project", "source/projects/setting.html", "11"],
  ["Creating a New Project", "source/projects/creating.html", "11"],
  ["Switching to a Different Project", "source/projects/switching.html", "11"]
 ],
 ["Connection to Internet Explorer", "source/connection/index.html", "11"],
 ["Source View Window", "source/sourceview/index.html", "1",
  ["Opening a File in the Source View Window", "source/sourceview/opening.html", "11"],
  ["Finding Text", "source/sourceview/findandreplace.html", "11"],
  ["Debug Support", "source/sourceview/debug.html", "11"]
 ],
 ["Profiler", "source/profiler/index.html", "1",
  ["Snapshot", "source/profiler/snapshot.html", "11"],
  ["Trigger", "source/profiler/trigger.html", "11"]
 ],
 ["Debugger", "source/debugger/index.html", "1",
  ["Start and Stop a Debugging Session", "source/debugger/startandstop.html", "11"],
  ["Controlling Program Execution", "source/debugger/control.html", "11"],
  ["Managing Breakpoints", "source/debugger/breakpoint.html", "11"],
  ["Debugger Windows and Commands", "source/debugger/ui/index.html", "1",
   ["Debug Menu", "source/debugger/ui/menu.html", "11"],
   ["Breakpoints Window", "source/debugger/ui/breakpoint.html", "11"],
   ["Call Stack Window", "source/debugger/ui/callstack.html", "11"],
   ["Variant Window", "source/debugger/ui/variable.html", "11"],
   ["Watches Window", "source/debugger/ui/watch.html", "11"],
   ["Command Window", "source/debugger/ui/command.html", "11"]
  ]
 ],
 ["IDE Options", "source/options/index.html", "1",
  ["Environment Option", "source/options/environment.html", "11"],
  ["Debug Option", "source/options/debug.html", "11"],
  ["Profile Option", "source/options/profile.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 "";
}

