var TITEMS = [ 
 ["Welcome", null, "1",
  ["Welcome", "html/help_welcome.htm", "11"],
  ["Getting Help Online", "html/get_help_online.htm", "11"],
  ["The work areas", "html/work_areas.htm", "11"]
 ],
 ["Working in The View &amp; Edit Area", null, "1",
  ["Introduction", "html/edit_index.htm", "11"],
  ["Opening &amp; Saving Images", "html/open_save_images.htm", "11"],
  ["About File Formats", "html/file_formats.htm", "11"],
  ["Viewing Images", "html/view_images.htm", "11"],
  ["Working With Image Selections", "html/image_selection.htm", "11"],
  ["Cropping Images", "html/crop_image.htm", "11"],
  ["Adding Text to The Image", "html/add_text.htm", "11"],
  ["Adding File Comments", "html/file_comments.htm", "11"],
  ["Resizing Image &amp; Canvas", "html/resize_image.htm", "11"],
  ["Rotating Images", "html/rotate_images.htm", "11"],
  ["Keyboard Shortcuts", "html/edit_shortcuts.htm", "11"]
 ],
 ["Fixing Photos", null, "1",
  ["Sharpening Blurry Images", "html/sharpen_image.htm", "11"],
  ["Adjusting Brightness &amp; Contrast", "html/brightness_contrast.htm", "11"],
  ["Removing Red Eyes", "html/red_eye_removal.htm", "11"]
 ],
 ["Adding Image Effects", null, "1",
  ["Blur Effect", "html/blur_effect.htm", "11"],
  ["Emboss Effect", "html/emboss_effect.htm", "11"],
  ["Drop Shadow Effect", "html/drop_shadow_effect.htm", "11"],
  ["Sepia Effect", "html/sepia_effect.htm", "11"]
 ],
 ["Working With Animations", null, "1",
  ["Introduction", "html/animation.htm", "11"],
  ["Importing a File Sequence", "html/import_seq_of_files.htm", "11"],
  ["Importing a Multiburst Image", "html/multiburst_import.htm", "11"],
  ["Changing Frame Properties", "html/frame_properties.htm", "11"],
  ["Optimizing &amp; Expanding Animation Frames", "html/optimize_animation.htm", "11"]
 ],
 ["Working in The Browse Area", null, "1",
  ["Introduction", "html/browse_index.htm", "11"],
  ["Displaying File Properties", "html/display_file_properties.htm", "11"],
  ["Browsing a Digital Camera", "html/browse_digital_camera.htm", "11"],
  ["Using The Batch Processing Wizard", "html/batch_process_wizard.htm", "11"],
  ["Emailing Photos", "html/email_photos.htm", "11"],
  ["Publishing to Web", "html/publish_to_web.htm", "11"],
  ["Generating an HTML Album", "html/generate_html_album.htm", "11"],
  ["Displaying Pictures As a Slide Show", "html/slide_show.htm", "11"],
  ["Keyboard Shortcuts", "html/browse_shortcuts.htm", "11"]
 ],
 ["Printing", null, "1",
  ["Printing a Photo", "html/print_photo.htm", "11"],
  ["Printing an Animation", "html/print_animation.htm", "11"],
  ["Printing a Contact Sheet", "html/print_contact_sheet.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 "";
}
