6 display a menu object. Currently only the "simple", "vertical" menu style
9 function menu_display() {
11 assert(m.style == "simple" && m.orientation == "vertical");
12 write('<div class="' + m.class + '">\n');
13 write("<i>" + m.name + "</i><br /><ul>\n");
14 for (i = 0; i < m.element.length; i++) {
16 write("<li><a href=\"" + e.link + "\">" + e.label + "</a></li>\n");
18 write("</ul></div>\n");
23 create a menu object with the defaults filled in, ready for display_menu()
25 function MenuObj(name, num_elements)
27 var i, o = new Object();
31 o.orientation = "vertical"
32 o.element = new Array(num_elements);
33 for (i in o.element) {
34 o.element[i] = new Object();
36 o.display = menu_display;
41 return a menu object created using a title, followed by
42 a set of label/link pairs
44 function simple_menu() {
45 var i, m = MenuObj(arguments[0], (arguments.length-1)/2);
46 for (i=0;i<m.element.length;i++) {
48 m.element[i].label = arguments[ndx+1];
49 m.element[i].link = arguments[ndx+2];