function drawMenu()
{
    document.write('<table cellpadding=0 cellspacing=0 border=0 width=700>');
    document.write('<tr>');
    document.write('<td align=center width="18%"><img src="/images/omr_logo_new.gif" border=0></td>');
    document.write("<td align=center nowrap><a class='menu' id='001' href='/reg/welcome.jsp'>Events</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='002' href='/reg/races.jsp'>Races</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='003' href='/reg/fields.jsp'>Fields</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='004' href='/reg/services.jsp'>Extras</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='005' href='/reg/entries.jsp'>Entries</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='006' href='/reg/offsets.jsp'>Modules</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='007' href='/reg/reports.jsp'>Reports</a></td>");
    document.write('</tr>');
    document.write('</table>');

if (TransMenu.isSupported())
{
    var ms = new TransMenuSet(TransMenu.direction.down, 0, 4, TransMenu.reference.bottomLeft);
    
    var menu1 = ms.addMenu(document.getElementById("001"));
    menu1.addItem("overview", "/reg/welcome.jsp");
    menu1.addItem("statistics", "/reg/stats.jsp");
    menu1.addItem("duplicate", "/reg/dup_event.jsp");
    menu1.addItem("page zero", "/reg/sections.jsp");
    menu1.addItem("discount codes", "/reg/discounts.jsp");
    menu1.addItem("gift certificates", "/reg/certs.jsp");
    menu1.addItem("actions", "/reg/actions.jsp");
    menu1.addItem("links", "/reg/links.jsp");
    menu1.addItem("help", "/jsp/reg/help/events.html");
    
    var menu2 = ms.addMenu(document.getElementById("002"));
    menu2.addItem("add/edit/remove", "/reg/races.jsp");
    menu2.addItem("fee schedule", "/reg/fees.jsp");
    menu2.addItem("help", "/jsp/reg/help/races.html");

    var menu3 = ms.addMenu(document.getElementById("003"));
    menu3.addItem("add/edit/remove", "/reg/fields.jsp");
    menu3.addItem("help", "/jsp/reg/help/fields.html");

    var menu4 = ms.addMenu(document.getElementById("004"));
    menu4.addItem("add/edit/remove", "/reg/services.jsp");
    menu4.addItem("help", "/jsp/reg/help/extras.html");

    var menu5 = ms.addMenu(document.getElementById("005"));
    menu5.addItem("browse", "/reg/entries.jsp");
    menu5.addItem("new entry", "/reg/entries_edit.jsp");
    menu5.addItem("upload", "/reg/uploads.jsp");
    menu5.addItem("search", "/reg/search.jsp");
    menu5.addItem("help", "/jsp/reg/help/entries.html");

    var menu6 = ms.addMenu(document.getElementById("006"));
    menu6.addItem("offsets", "/reg/offsets.jsp");
    menu6.addItem("relays", "/reg/relay_module.jsp");

    var menu7 = ms.addMenu(document.getElementById("007"));
    menu7.addItem("custom reports", "/reg/reports.jsp");
    menu7.addItem("extras", "/reg/show_services.jsp");
    menu7.addItem("age groups", "/reg/age_groups.jsp");
    menu7.addItem("pulldowns", "/reg/pulldowns.jsp");
    menu7.addItem("offsets", "/reg/show_offsets.jsp");
    menu7.addItem("relays", "/reg/relays.jsp");
    menu7.addItem("payments", "/reg/show_payments.jsp");
    menu7.addItem("balance sheet", "/reg/balance_sheet.jsp");
    menu7.addItem("cancellations", "/reg/cancellations.jsp");
    menu7.addItem("help", "/jsp/reg/help/reports.html");
    
    TransMenu.renderAll();
}
}

function createMenu()
{
  if (TransMenu.isSupported())
  {
	TransMenu.initialize();
  }
}

function footer()
{
    document.writeln('<p><table bgcolor="#000000" cellpadding=0 cellspacing=1 border=0 width="100%"><tr><td><table bgcolor="#dddddd" cellpadding=0 cellspacing=0 border=0 width="100%">');
    document.writeln('<tr>');
    document.writeln('<td align=right><div class=smtext>powered by <a target="_blank" href="http://www.onemillionrevolutions.org">One Million Revolutions</a>&nbsp;&nbsp;');
    document.writeln('</tr>');
    document.writeln('</table></td></tr></table>');
}

function footer2()
{
    document.writeln('<p><table cellpadding=2 cellspacing=2 border=0 width=500>');
    document.writeln('<tr>');
    document.writeln('<td align=left width="5%"><div class=text><a target="_blank" href="http://www.onemillionrevolutions.org"><img src="http://www.onemillionrevolutions.org/images/omr_logo_b.gif" border=0></a>');
    document.writeln('<td align=left><div class=text>registration system ');
    document.writeln('provided by ');
    document.writeln('<b>One Million Revolutions</b>');
    document.writeln('</div></td>');
    document.writeln('</tr>');
    document.writeln('</table>');
}

function help(url, x, y)
{
    window.open(url,'help is on the way...','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + y + ',height=' + x);
}

function popup(url, word)
{
    var msg = "Are you sure you want to permanently remove this " + word + "?";
    if (confirm(msg))
	location.replace(url);
}

function uh_oh(url)
{
    var msg = "Are you sure? It will overwrite your saved waves for this race.";
    if (confirm(msg))
	location.replace(url);
}
