﻿var mm_tName;

function mm_listMenu(mN)
{
  var j, iN;

  _iwd.write("<ul>");

  for (j=0; j<_m[mN][0].length; j++)
  {
    iN = _m[mN][0][j];

    _iwd.write("<li>");

    if (_mi[iN][2] != null) _iwd.write('<a href="' + _mi[iN][2] + '" target="' + mm_tName  + '">');
    _iwd.write(_mi[iN][1]);
    if (_mi[iN][2] != null) _iwd.write('</a>');

    if (_mi[iN][3] != null) mm_listMenu(getMenuByName(_mi[iN][3]));

    _iwd.write("</li>");
  }

  _iwd.write("</ul>");
}

function mm_siteIndex(windowAttributes, indexHeading) // , cssFile)
{
  var attr = "toolbar=no,scrollbars=yes,resizable=yes,status=yes";
  if (windowAttributes.length > 0) attr += "," + windowAttributes;
  _iWin = window.open("", "Site_Index", attr);

  _iwd = _iWin.document;

  if (_iWin.window.opener.name.length == 0) {
    _iWin.window.opener.name = "parentwin";
  }
  mm_tName = _iWin.window.opener.name;

  _iwd.open();
  _iwd.write("<html><head><title>Site Index</title>");

  if (arguments.length > 2) _iwd.write('<link rel="stylesheet" type="text/css" href="' + arguments[2] + '">');

  _iwd.write("</head>");
  _iwd.write("<body>");
  _iwd.write("<h1>" + indexHeading + '</h1>');
//  _iwd.write('<h1><div style=""><input type="button" value="< Back" onclick="window.opener.history.back()"><input type="button" value="Next >" onclick="window.opener.history.forward()"></div>' + indexHeading + '</h1>');
//  _iwd.write('<p class="toolbar"><input type="button" value="< Back" onclick="window.opener.history.back()"><input type="button" value="Next >" onclick="window.opener.history.forward()">');

  for (i=0; i<_m.length; i++)
  {
    if (_m[i][7])
    {
      mm_listMenu(i);
    }
  }

  _iwd.write("</body></html>");

  _iwd.close();
}

