/*
* This script contains Javascript that will finish off the bottom of all pages
* that are part of the BSM Development site.
*/

/*****************************************************************************/

// If the page format is one of our standard formats, we can close off
// the text block.
if (typeof(PageFormat) == 'string')
  {
  if ((PageFormat == 'Standard') || (PageFormat == 'Reference'))
    {
    document.write(
        '</td></tr>' +
      '</table>');
    }
  }

// Finish off the content and begin drawing the righthand menu column.
document.write(
      '<img style="display: block;" height='+ContentPad+' width=1 ' +
        'src="/Page/OneByOne.gif" alt="">' +
    '</td>' +
    '<td width='+ContentPad+'>&nbsp;</td>');

// Draw the righthand menu.
document.write(
    '<td class=RightMenuColor width='+RightMenuWidth+' valign=top>' +
      '<table style="margin-top: '+MenuRightTop+'px;" ' +
        'cols=3 width=100% border=0 cellpadding=0 cellspacing=0>');

// If there are any, draw the bingo buttons (really just a bunch of links).
if (typeof(BingoButtons) == 'object')
  {
  var CurrButton;

  for (CurrButton = 0; CurrButton < BingoButtons.length; CurrButton++)
    {
    document.write(
        '<tr><td class=RightMenuColor width='+MenuRightLeft+'>&nbsp</td>' +
        '<td class=RightMenuBlock align=center>' +
          '<a class=RightMenuText ' +
              'href="'+BingoButtons[CurrButton][1]+'" border=0>' +
            BingoButtons[CurrButton][0]+'</a></td>' +
        '<td class=RightMenuColor width='+MenuRightLeft+'>&nbsp</td></tr>' +
        '<tr><td class=RightMenuColor colspan=3 height='+MenuRightPad+'>' +
          '<img style="display: block;" height='+MenuRightPad+' width=1 ' +
            'src="/Page/OneByOne.gif" alt="">' +
          '</td></tr>');
    }
  }
else { document.write('<tr><td colspan=3>&nbsp;</td></tr>'); }

// Finish off the righthand menu.
document.write(
        '<tr><td colspan=3 height='+MenuRightTop+'>&nbsp;</td></tr>' +
      '</table>' +
    '</td></tr>');

// Draw the page menu.
document.write(
  '<table class=PageFrame style="border-top: none;" cols=3 width=100% ' +
    'border=0 cellpadding=0 cellspacing=0>' +
    '<tr><td colspan=3 height='+MenuPagePad+'>' +
      '<img style="display: block;" height='+MenuPagePad+' width=1 ' +
        'src="/Page/OneByOne.gif" alt="">' +
      '</td></tr>' +
    '<tr><td width='+LeftMenuWidth+'>&nbsp;</td>' +
    '<td align=center valign=middle>');

PgMenuFont = 'PageMenu';
DisplayPageMenu(PageMenu, PageMenuPath, true);

document.write(
    '</td>' +
    '<td width='+RightMenuWidth+'>&nbsp;</td></tr>' +
    '<tr><td colspan=3 height='+MenuPagePad+'>' +
      '<img style="display: block;" height='+MenuPagePad+' width=1 ' +
        'src="/Page/OneByOne.gif" alt="">' +
      '</td></tr>' +
  '</table>');

// Finish the bottom of the page.
document.write(
  '<table class=PageFrame style="border-style: none;" cols=1 width=100% ' +
        'border=0 cellpadding=0 cellspacing=0>' +
    '<tr><td>&nbsp;</td></tr>' +
  '</table>');

// If it is defined, display the bar menu.  Otherwise, all we see is the empty
// bar.
//
// We draw the menu here because there are a bunch of timing glitches that can
// cause the menu to disappear or even cause Mickeysoft d.s. (a.k.a. IE) to
// crash inexplicably, if it is drawn at the top of the page.  Who needs that
// goat rope?
//
// But, as a bonus, building the menu here causes the page to load faster.  So,
// its a great day for everyone.
if (typeof(BarMenu) != 'undefined')
  {
  DisplayBlockMenu('BarMenu', BarMenu, MenuBarTop, MenuBarLeft, 19, 79, 0,
    true);
  }
