1//****************************************************************
2// Writes a table data element to the document. If pHRef equals
3// pCurrentPage then 'class="current"' is added to the td element.
4// For example:
5//    writeTD("a.html", "a.html", "b")
6// Would write
7//    <td class="current"><a href="a.html">b</a><td>
8//
9// @param pCurrentPage the current page. For example "index.html"
10// @param pHRef the string that should apear in the href
11// @param pValue the string that should apear as the value
12//****************************************************************
13function writeTD(pCurrentPage, pHRef, pValue)
14{
15   document.write('                <td')
16   document.write(pCurrentPage == pHRef ? ' class="current"' : '')
17   document.write('><a href="')
18   document.write(pHRef)
19   document.write('">')
20   document.write(pValue)
21   document.writeln('</a></td>')
22}
23
24//******************************************************************
25// Writes the main menu to the document.
26// @param pCurrentPage the current page. For example "index.html"
27//******************************************************************
28function displayMenu(pCurrentPage) {
29   document.writeln('<div id="topmenu">')
30   document.writeln('    <table width="100%">')
31   document.writeln('            <tr>')
32       writeTD(pCurrentPage,             "index.html", "Welcome")
33       writeTD(pCurrentPage,          "download.html", "Download")
34       writeTD(pCurrentPage,"documentation-main.html", "Documentation")
35       writeTD(pCurrentPage,         "migrating.html", "Migrating from JUnit")
36       writeTD(pCurrentPage, "../javadocs/index.html", "JavaDoc")
37       writeTD(pCurrentPage, "selenium.html", "Selenium")
38   document.writeln('            </tr>')
39   document.writeln('            <tr>')
40       writeTD(pCurrentPage,           "eclipse.html", "Eclipse")
41       writeTD(pCurrentPage,              "idea.html", "IDEA")
42       writeTD(pCurrentPage,             "maven.html", "Maven")
43       writeTD(pCurrentPage,               "ant.html", "Ant")
44       writeTD(pCurrentPage,              "misc.html", "Miscellaneous")
45       writeTD(pCurrentPage,              "book.html", "Book")
46       writeTD(pCurrentPage,              "http://beust.com/kobalt", "Kobalt")
47   document.writeln('            </tr>')
48   document.writeln('        </table>')
49   document.writeln('    </div>')
50
51}
52
53