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);
}

function popup_black(url, x, y)
{
    window.open('/results/black.php?img=' + url,'closeup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + y + ',height=' + x);
}

function banner(x, y)
{
    document.writeln('<TABLE WIDTH=735 HEIGHT=54 BORDER=0 CELLPADDING=0 CELLSPACING=0>');
    document.writeln('<TR VALIGN=TOP>');
    document.writeln('<TD ROWSPAN=4 WIDTH=264 HEIGHT=54>');
    document.writeln('<a href="http://www.musselmantri.com">');
    document.writeln('<img src="/images/musselman_logo.gif" width=264 height=54 border=0></a></td>');
    document.writeln('<TD COLSPAN=3 WIDTH=471 HEIGHT=4>');
    document.writeln('<img src="/images/spacer.gif" width=471 height=4></td>');
    document.writeln('</TR>');
    document.writeln('<TR>');
    document.writeln('<TD COLSPAN=3 WIDTH=471 HEIGHT=22 VALIGN=BOTTOM>');
    document.writeln('<table cellpadding=0 cellspacing=0 border=0 width=100%><tr>');
    document.writeln('<TR>');
    document.writeln('<TD COLSPAN=15 WIDTH=471 HEIGHT=6>');
    document.writeln('<img src="/images/spacer.gif" width=471 height=6></td>');
    document.writeln('</TR>');
    document.writeln('<TR>');


    document.write("<td align=center nowrap><a class='menu' id='001' href='/participate/index.html'>participate</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='002' href='/races/index.html'>races</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='003' href='/before/index.html'>before & after</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='004' href='/sponsors/index.html'>sponsors</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='005' href='/region/index.html'>region</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='006' href='/media/index.html'>media</a></td>");
    document.write("<td align=center nowrap><a class='menu' id='007' href='/contact/c.html'>about</a></td>");


    document.writeln('</TR>');
    document.writeln('<TR>');
    document.writeln('<TD COLSPAN=7 WIDTH=471 HEIGHT=3>');
    document.writeln('<img src="/images/spacer.gif" width=471 height=3></td>');
    document.writeln('</TR>');
    document.writeln('</TABLE>');
    document.writeln('</TD>');
    document.writeln('</TR>');
    document.writeln('<TR>');
    document.writeln('<TD COLSPAN=3 WIDTH=471 HEIGHT=14>');
    document.writeln('<TABLE WIDTH=471 HEIGHT=14 BORDER=0 CELLPADDING=0 CELLSPACING=0>');

    document.writeln('<TR>');
    document.writeln('<TD height=11 colspan=9>');
    document.writeln('<table cellpadding=0 cellspacing=0 border=0 width=100%><tr>');

    document.writeln('<TD width="2%"><img src="/images/spacer.gif" border=0 height=4 width=10></td>');
    document.writeln('</TR></table></td></tr>');

    document.writeln('</TABLE>');
    document.writeln('</TD>');
    document.writeln('</TR>');
    document.writeln('<TR>');
    document.writeln('<TD COLSPAN=3 BGCOLOR="#ffffff" WIDTH=475 HEIGHT=10 ALIGN=LEFT>');
    document.writeln('<img src="/images/spacer.gif" width=475 height=10></td>');
    document.writeln('</TR>');
    document.writeln('</TABLE>');

    drawMenu();
}

function drawMenu()
{
  if (TransMenu.isSupported())
  {
    var ms = new TransMenuSet(TransMenu.direction.down, 0, 4, TransMenu.reference.bottomLeft);
    
    var menu1 = ms.addMenu(document.getElementById("001"));
    menu1.addItem("register", "/participate/register.html");
    menu1.addItem("volunteer", "/participate/volunteer.html");
    menu1.addItem("athlete village", "/participate/village.html");
    menu1.addItem("sustainability", "/participate/sustainable.html");
    menu1.addItem("testimonials", "/participate/testimonials.html");
    menu1.addItem("latest news", "/participate/news2010.html");
    menu1.addItem("FAQs", "/participate/faqs.html");
    menu1.addItem("participant lists", "javascript:;");
    var submenu1 = menu1.addMenu(menu1.items[7]);
    submenu1.addItem("Musselman", "http://www.onemillionrevolutions.org/reg/athletes_by_age_group_extended.jsp?eventID=135&raceTag=21910402308109");
    submenu1.addItem("mini-Mussel", "http://www.onemillionrevolutions.org/reg/athletes_by_age_group_extended.jsp?eventID=135&raceTag=21910402305809");
    submenu1.addItem("Aquabike", "http://www.onemillionrevolutions.org/reg/athletes_by_age_group_extended.jsp?eventID=135&raceTag=21910402309909");
    submenu1.addItem("DoubleMussel 88.7", "http://www.onemillionrevolutions.org/reg/athletes_by_age_group_extended.jsp?eventID=135&raceTag=21910402310709");
    submenu1.addItem("MusselKids", "http://www.onemillionrevolutions.org/reg/athletes_by_age_group.jsp?eventID=135&raceTag=21910402309109");

    menu1.addItem("participant maps", "javascript:;");
    var mapmenu = menu1.addMenu(menu1.items[8]);
    mapmenu.addItem("2010", "http://www.onemillionrevolutions.org/reg/map.jsp?eventID=135");
    mapmenu.addItem("2009", "http://www.onemillionrevolutions.org/static/participants_2009.html");
    mapmenu.addItem("2008", "http://www.onemillionrevolutions.org/static/participants_2008.html");
    mapmenu.addItem("2007", "http://www.onemillionrevolutions.org/static/participants_2007.html");
    mapmenu.addItem("2006", "http://www.onemillionrevolutions.org/static/participants_2006.html");
    mapmenu.addItem("2005", "http://www.onemillionrevolutions.org/static/participants_2005.html");
    mapmenu.addItem("2004", "http://www.onemillionrevolutions.org/static/participants_2004.html");

    var menu2 = ms.addMenu(document.getElementById("002"));
    menu2.addItem("musselman", "/races/musselman.html");
    menu2.addItem("mini-mussel", "/races/mini_mussel.html");
    menu2.addItem("&micro;Mussel", "/races/micromussel.html");
    menu2.addItem("musselkids", "/races/kids.html");
    //menu2.addItem("Hustle for Team Mussel", "/races/hustle.html");
    menu2.addItem("Best of U.S. Qualifier", "/races/best_of_us.html");
    menu2.addItem("records", "/results/records.php");
    menu2.addItem("results", "javascript:;");
    var submenu = menu2.addMenu(menu2.items[6]);
    submenu.addItem("2010", "/results/2010/index.html");
    submenu.addItem("2009", "/results/2009/index.html");
    submenu.addItem("2008", "/results/2008/index.html");
    submenu.addItem("2007", "/results/2007/index.html");
    submenu.addItem("2006", "/results/2006/index.html");
    submenu.addItem("2005", "/results/2005/index.html");
    submenu.addItem("2004", "/results/2004/2004.html");

    var menu3 = ms.addMenu(document.getElementById("003"));
    menu3.addItem("timeline", "/before/timeline.html");
    menu3.addItem("MusselFest!", "/before/musselfest.html");
    menu3.addItem("2010: <i>Frazz</i> returns", "/before/jef.html");
    menu3.addItem("MusselMural", "/before/mural.html");
    menu3.addItem("bamboo race shirts", "/before/bamboo.html");
    menu3.addItem("plant a seed", "/before/seeds.html");
    menu3.addItem("pre-race", "/before/prerace.html");
    menu3.addItem("post-race and awards", "/before/postrace.html");
    menu3.addItem("training", "/before/training.html");
    //menu3.addItem("awards", "/before/awards.html");
    menu3.addItem("pictures", "javascript:;");
    var submenu2 = menu3.addMenu(menu3.items[9]);
    submenu2.addItem("2010", "/results/2010/pictures_1.html");
    submenu2.addItem("2009", "/results/2009/pictures_1.html");
    submenu2.addItem("2008", "/results/2008/pictures_1.html");
    submenu2.addItem("2007", "/results/2007/pictures_1.html");
    submenu2.addItem("2006", "/results/2006/pictures.html");
    submenu2.addItem("2005", "/results/2005/pictures.html");
    submenu2.addItem("2004", "/results/2004/pictures2004.html");

    var menu4 = ms.addMenu(document.getElementById("004"));
    menu4.addItem("presenting sponsor", "/sponsors/presenting.html");
    menu4.addItem("featured", "/sponsors/feature.html");
    menu4.addItem("mapping", "/sponsors/mapping.html");
    menu4.addItem("wine", "/sponsors/wine.html");
    menu4.addItem("supporters", "/sponsors/supporters.html");

    var menu5 = ms.addMenu(document.getElementById("005"));
    menu5.addItem("Finger Lakes", "/region/fl.html");
    menu5.addItem("Seneca County", "/region/seneca_county.html");
    menu5.addItem("Seneca Lake State Park", "/races/venue.html");
    menu5.addItem("directions", "/region/directions.html");
    menu5.addItem("accomodations", "/region/accomodations.html");

    var menu6 = ms.addMenu(document.getElementById("006"));
    menu6.addItem("press releases", "/media/releases.html");
    menu6.addItem("in the news", "/media/in_the_news.html");
    menu6.addItem("Slowtwitch chronicles: 2010", "/media/slowtwitch.html");
    //menu6.addItem("spotlight", "/media/spotlight.html");

    var menu7 = ms.addMenu(document.getElementById("007"));
    menu7.addItem("beneficiary", "/contact/bg.html");
    menu7.addItem("committee", "/contact/committee.html");
    //menu7.addItem("team mussel", "/contact/team_mussel.html");
    menu7.addItem("Slowtwitch chronicles: 2004", "/contact/chronicles.html");
    menu7.addItem("for volunteers", "/contact/for_volunteers.html");
    menu7.addItem("contact us", "/contact/c.html");

    TransMenu.renderAll();
  }
}

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