var TITEMS = [ 
 ["About Office Portal", "about.html", "9"],
 ["Home Page", "HomePage.html", "2",
  ["About Home Page", "op-about.html", "9"],
  ["Using the Home Page", "usingHomePage.html", "2",
   ["Accesing Home Page", "op-accessing.html", "11"],
   ["What's New", "op-whatsnew.html", "11"],
   ["Upcoming Events", "op-upcomingevents.html", "11"],
   ["Business Center", "op-businesscenter.html", "11"],
   ["Search", "op-search.html", "11"],
   ["Polls", "op-polls.html", "11"],
   ["Announcements", "op-announce.html", "11"],
   ["Tasks Portlet", "op-tasks.htm", "11"],
   ["My Newsfeeds", "op-newsfeed.html", "11"],
   ["Group Bookmarks", "op-grpbookmarks.html", "11"]
  ],
  ["My Account", "account.html", "2",
   ["Deactivate Application", "account-deactivate.html", "11"],
   ["Change Logo and Banner", "ChangeLogoBanner.html", "11"],
   ["Grant or Revoke Administrative Privileges", "account-admin.html", "11"],
   ["Become Admin in Group", "account-become-admin.html", "11"],
   ["Create Letterhead", "account-letterhead.html", "11"],
   ["Create System Email Template", "account-emailtemplate.html", "11"]
  ],
  ["My Profile", "hp-myprofile.html", "2",
   ["Change Password", "op-password.html", "11"],
   ["Setup Pin for Mobile", "setuppin.html", "11"],
   ["Change Preferences", "op-preferences.html", "11"],
   ["Change User Info", "op-userinfo.html", "11"]
  ],
  ["Add Members", "op-addmembers.html", "2"],
  ["Privileges", "op-privileges.html", "2"],
  ["Audit", "op-audit.html", "2"],
  ["Admin", "HomepageAdmin.html", "2",
   ["Group Admin", "hp-groupadmin.html", "2",
    ["Application Management", "op-appmanagement.html", "11"],
    ["Create a New Group", "op-newgroup.html", "11"],
    ["Change Group Timezone", "op-grouptimezone.html", "11"],
    ["Remove Group", "op-deletegroup.html", "11"],
    ["Manage Departments", "op-departments.html", "11"],
    ["Change Group Name", "op-changegroupname.html", "11"],
    ["Web Content Menu", "op-webcontentmenu.html", "11"]
   ],
   ["Member Admin", "hp-memberadmin.html", "2",
    ["Grant Admin Privileges", "op-grantadminpriv.html", "11"],
    ["Revoke Admin Privileges", "op-revokeadminpriv.html", "11"],
    ["Import Members", "op-importmembers.html", "11"],
    ["Reset Member Password", "op-resetmemberpassword.html", "11"],
    ["Modify Member Details", "op-modifymemberdetails.html", "11"],
    ["Add/Remove Members", "op-addmembers-madmin.html", "11"]
   ]
  ]
 ],
 ["Alerts", "Alerts.html", "2",
  ["About Alerts", "a-about.html", "9"],
  ["Using Alerts", "usingAlerts.html", "2",
   ["Accessing Alerts", "a-accessing.html", "11"],
   ["View an Alert", "a-view.html", "11"],
   ["Accepts an Alert", "a-accept.html", "11"],
   ["Create a New Alert", "a-newalert.html", "11"],
   ["Archive an Alert", "a-archive.html", "11"]
  ]
 ],
 ["Email", "Email.html", "2",
  ["About Email", "email_about.html", "9"],
  ["Using Email", "UsingEmail.html", "2",
   ["Mailing Lists", "email_list.html", "11"],
   ["Compose Email", "email_compose.html", "11"],
   ["Setup Accounts", "email_account.html", "11"],
   ["Mail Folders", "email_folders.html", "11"],
   ["Search", "email_search.html", "11"],
   ["Options", "email_options.html", "11"]
  ]
 ],
 ["User Manager", "UserManager.html", "2",
  ["About User Manager", "oa-about.html", "9"],
  ["Using the User Manager", "usingUserManager.html", "2",
   ["Accessing the User Manager", "oa-accessing.html", "11"],
   ["Sending a Message", "oa-message.html", "11"],
   ["Sending a Group Message", "oa-groupmessage.html", "11"],
   ["Creating a New Group", "op-newgroup.html", "11"],
   ["Searching", "oa-search.html", "11"],
   ["Contacts", "oa-contacts.html", "11"],
   ["Setting a Notice", "oa-notice.html", "11"],
   ["Viewing/Modifying Details", "oa-details.html", "11"],
   ["Sync", "UM-Sync.html", "11"]
  ]
 ],
 ["My Reminders", "myReminders.html", "2",
  ["About My Reminders", "rem-about.html", "9"],
  ["Using My Reminders", "usingMyReminders.html", "2",
   ["Accessing My Reminders", "rem-accessing.html", "11"],
   ["Setting a Reminder", "rem-fillout.html", "11"],
   ["Repeating a Reminder", "rem-repeating.html", "11"],
   ["Viewing Saved Reminders", "rem-myreminders.html", "11"]
  ]
 ],
 ["Bulletin Board", "BulletinBoard.html", "2",
  ["About the Bulletin Board", "bb-about.html", "9"],
  ["Using Bulletin Board", "usingBulletinBoard.html", "2",
   ["Accessing the Bulletin Board", "bb-accessing.html", "11"],
   ["Creating a New Forum", "bb-newforum.html", "11"],
   ["Creating a New Topic", "bb-newtopic.html", "11"],
   ["Posting a Reply", "bb-reply.html", "11"],
   ["Searching", "bb-search.html", "11"]
  ]
 ],
 ["Photos", "Photos.html", "2",
  ["About Photos", "p-about.html", "9"],
  ["Using Photos", "usingPhotos.html", "2",
   ["Accessing Photos", "p-accessing.html", "11"],
   ["Creating a New Album", "p-newalbum.html", "11"],
   ["Add New Photos", "p-newphoto.html", "11"]
  ]
 ],
 ["Notes", "Notes.html", "2",
  ["Accessing Notes", "AccessNotes.html", "11"],
  ["Create Notes", "CreateNote.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 "";
}
