function tblStart(){
  document.write( "<TABLE " )
  if (nTblBorder != null) {
    document.write( "BORDER=\"" + nTblBorder + "\"" );
  }
  if (nTblPadding != null) {
    document.write( "CELLPADDING=\"" + nTblPadding + "\"" );
  }
  if (nTblSpacing != null) {
    document.write( "CELLSPACING=\"" + nTblSpacing + "\"" );
  }
  if (nTblWidth != null) {
    document.write( "WIDTH=\"" + nTblWidth + "\"" );
  }
  document.write( ">" );
}

function tblEnd(){
  document.write( "</TABLE>" );
}

function rowStart(){
  document.write( "<TR>" );
}

function rowEnd(){
  document.write( "</TR>" );
}

function cellStart( nColSpan ){
  if (nColSpan != null) {
    document.write( "<TD COLSPAN=\"" + nColSpan + "\">" );
  }
  else {
    document.write( "<TD>" );
  }
}

function cellEnd(){
  document.write( "</TD>" );
}

function doc_filename(){
  var str1 = document.location.toString()
  var loc = str1.lastIndexOf( "\/" )
  var len = str1.length
  return (str1.substring( loc + 1, len ) )
}

function write_link( sMenu, sURL ){
  if (sMenu != null & sMenu != "" ) {
    if (nFontSize != null) {
      document.write( "<FONT SIZE=\"" + nFontSize + "\">" );
    }
    if (nColor != null) {
      document.write( "<FONT COLOR=\"" + nColor + "\">" );
    }
    if (bBold == TRUE) {
      sMenu = "<B>" + sMenu + "</B>";
    }
    if (doc_filename() == sURL) {
      document.write( sCurrentPageStart + sMenu + sCurrentPageEnd );
    } else {
      document.write( "<A HREF=\"" + sURL + "\">" + sMenu + "</A>" );
    }
    if (nFontSize != null) {
      document.write( "</FONT>" );
    }
  }
}

//
// Write the navigation menu
//
function show_menu(){
//
// Put the menu in a table?
if (bInTable == TRUE) {
  tblStart();
  //
  // Vertical or horizontal table?
  if (bTblVertical == FALSE) {
    var nRows = arMenuBar.length
    for ( i = 0; i < nRows; i++ ) {
      rowStart();
      var nCols = arMenuBar[i].length
      for ( j = 0; j < nCols; j++ ) {
        cellStart( arColSpan[i][j] );
        write_link( arMenuBar[i][j], arMenuBarURL[i][j] );
        cellEnd();
      }
      rowEnd();
    }
  }
  else {
    var nCols = arMenuBar.length
    var nRows = arMenuBar[0].length
    for ( i = 0; i < nRows; i++ ) {
      rowStart();
      for ( j = 0; j < nCols; j++ ) {
        cellStart( arColSpan[j][i] );
        write_link( arMenuBar[j][i], arMenuBarURL[j][i] );
        cellEnd();
      }
      rowEnd();
    }
  }
  tblEnd();
}
else {
  //
  // Vertical or horizontal list?
  if (bTblVertical == FALSE) {
    var nRows = arMenuBar.length
    var nCols = arMenuBar[0].length
    for ( i = 0; i < nRows; i++ ) {
      for ( j = 0; j < nCols; j++ ) {
        write_link( arMenuBar[i][j], arMenuBarURL[i][j] );
	document.write( "&nbsp;" );
      }
      document.write( "<BR>" );
    }
  }
  else {
    var nCols = arMenuBar.length
    var nRows = arMenuBar[0].length
    for ( i = 0; i < nRows; i++ ) {
      for ( j = 0; j < nCols; j++ ) {
        write_link( arMenuBar[j][i], arMenuBarURL[j][i] );
	document.write( "&nbsp;" );
      }
      document.write( "<BR>" );
    }
  }
}
} // Function end

