/* This functions generates the navigation panel which will be
   displayed on the top of the pages. This will make inserting new
   pages into the panel easier and less of a chore.

   To insert a new page, just add the name of the panel label to the
   panelElements array.
   Note: The name of the page file should match, and must reside in
   the pages directory 'pageDir'.

   Written by: G. Yaikhom
*/
var NavigationPanel = {
    insertPanel: function (page) {
        /* Please change the following information. */
        var elementSeparator = "|";
        var panelElements = "About|Activities|Announcements|Constitution|Contacts|Gatherings|Home";
        var pageDir = "";

        /* Please leave the following untouched. */
        var panelArray = panelElements.split(elementSeparator);
        var tdWidth = 700 / panelArray.length;
        var panel = "<table class='panel' cellpadding='0' cellspacing='0'><tbody><tr>";
        for (i = 0; i < panelArray.length; i++) {
            if (page != panelArray[i]) {
                panel += "<td class='panel' style='width:" + tdWidth +
                ";'><a class='panel' href='" + pageDir +
				panelArray[i] + ".html'>" + panelArray[i] + "</a></td>";
            } else {
                panel += "<td class='panel-selected' style='width:" + tdWidth +
                ";'>" + panelArray[i] + "</td>";
            }

        }
        panel += "</tr></tbody></table>";
        document.write(panel);
    }
}
