function drawMenu(i)
{
    document.write('<table cellpadding=0 cellspacing=0 border=0 width=640 align=center>');
    document.write('<tr>');

    if (i != 0)
      document.write('<td align=center><a href="http://www.onemillionrevolutions.org/index.html"><img src="http://www.onemillionrevolutions.org/images/omr_logo_new.gif" border=0></a></td>');

    document.write('<td align=center nowrap width="16%"><a class="menu" id="001" href="http://www.onemillionrevolutions.org/index.html">Welcome</a></td>');
    document.write('<td align=center nowrap width="16%"><a class="menu" id="002" href="http://www.onemillionrevolutions.org/registration.html">Technology</a></td>');
    document.write('<td align=center nowrap width="16%"><a class="menu" id="003" href="http://www.onemillionrevolutions.org/maps/trial.php">Race Maps</a></td>');
    document.write('<td align=center nowrap width="16%"><a class="menu" id="004" href="http://www.onemillionrevolutions.org/triathlon.html">Triathlon</a></td>');
    document.write('<td align=center nowrap width="16%"><a class="menu" id="005" href="http://www.onemillionrevolutions.org/contact.html">About</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("home", "http://www.onemillionrevolutions.org/index.html");
    
    var menu2 = ms.addMenu(document.getElementById("002"));
    menu2.addItem("event registration", "http://www.onemillionrevolutions.org/registration.html");
    menu2.addItem("live race viewer", "http://www.onemillionrevolutions.org/viewer.html");

    var menu3 = ms.addMenu(document.getElementById("003"));
    menu3.addItem("map your course", "http://www.onemillionrevolutions.org/maps/trial.php");
    menu3.addItem("account login", "http://maps.onemillionrevolutions.org/birdseye.jsp");
    menu3.addItem("USAT race finder (2010)", "http://www.onemillionrevolutions.org/maps/usat.php?year=2010");
    menu3.addItem("USAT race finder (2009)", "http://www.onemillionrevolutions.org/maps/usat.php?year=2009");
    menu3.addItem("USAT race finder (2008)", "http://www.onemillionrevolutions.org/maps/usat.php?year=2008");
    menu3.addItem("USAT race finder (2007)", "http://www.onemillionrevolutions.org/maps/usat.php?year=2007");
    menu3.addItem("USAT race finder (2006)", "http://www.onemillionrevolutions.org/maps/usat.php?year=2006");

    var menu4 = ms.addMenu(document.getElementById("004"));
    menu4.addItem("events", "http://www.onemillionrevolutions.org/triathlon.html");
    menu4.addItem("writing", "http://www.onemillionrevolutions.org/writing.html");
    menu4.addItem("Musselman Triathlon", "http://www.musselmantri.com");
    menu4.addItem("Freshwater Trust Portland Triathlon", "http://www.portlandtri.com");
    menu4.addItem("Fly by Night Duathlon", "http://www.flybynightdu.com");
    menu4.addItem("gift certificates", "http://www.onemillionrevolutions.org/reg/buycert_step1.jsp?l=9DL68rzz4VyN");

    var menu5 = ms.addMenu(document.getElementById("005"));
    menu5.addItem("Council for Responsible Sport", "http://www.resport.org");
    menu5.addItem("across America by bike", "http://www.onemillionrevolutions.org/coast2coast/index.html");
    menu5.addItem("across Europe by bike", "http://www.triathloninformer.com/roadtrip/uk/uk_one.html");
    menu5.addItem("contact us", "http://www.onemillionrevolutions.org/contact.html");

    TransMenu.renderAll();
  }
}

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

function banner(which)
{
    var LIMIT = 7;
    var sections = new Array(LIMIT);

    for (var i=0; i < sections.length; i++)
    {
	sections[i] = 'bannerthere';
    }
    if (which >= 0 && which <= LIMIT)
	sections[which] = 'bannerhere';

    document.writeln('<div align=center>');
    document.writeln('<table cellpadding=0 cellspacing=0 border=0 width=520">');
    document.writeln('<tr>');
    document.writeln('<td align=center><a class=' + sections[1] + ' href="/index.html">Welcome</a></td>');
    document.writeln('<td align=center><a class=' + sections[2] + ' href="/viewer.html">Race Viewer</a></td>');
    document.writeln('<td align=center><a class=' + sections[3] + ' href="/maps/birdseye.php">Race Maps</a></td>');
    document.writeln('<td align=center><a class=' + sections[2] + ' href="/triathlon.html">Triathlon</a></td>');
    document.writeln('<td align=center><a class=' + sections[3] + ' href="/touring.html">Touring</a></td>');
    document.writeln('<td align=center><a class=' + sections[4] + ' href="/contact.html">Contact</a></td>');
    document.writeln('</tr></table>');
    document.writeln('</div>');
}

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