
  function fnRandomColourName()
  {
    var iRandom;
    var sReturn;
    var aaColourNames = new Array
      ("blue", "green", "orange", "red", "lightgreen", "lightblue");
    iRandom = Math.round(Math.random() * 5);
    return aaColourNames[iRandom];
  } // fnRandomColourName

  //** DATE:
  //**  March 2002
  //** DESCRIPTION:
  //**  Creates a grid of coloured cells using html
  //**  tables and the background colour ('bgcolor' attribute)
  //**  of the table cell tag ('<td>'). This is a decorative
  //**  function.
  function fnHtmlColourGrid(iRows, iColumns, sText)
  {
    var iCenterRow;       //-- The middle row where the text will go
    var iStartTextColumn  //-- The column where the 1st letter will go
    var iCharacterCounter //--

    var sReturn = "";
    if (sText == null)
      { sText = ""; }

    iCharacterCounter = 0;
    iCenterRow = Math.round(iRows / 2);

    sReturn = "<table>";
    for (var jj = 0; jj < iRows; jj++)
    {
      sReturn += "<tr>";
      for (var ii = 0; ii < iColumns; ii++)
      {
        if (iCharacterCounter < sText.length)
        {
          sReturn +=
            "<td bgcolor = '" + fnRandomColourName() +
            "'>" + sText.charAt(iCharacterCounter) + "</td>";
        }
        else
        {
          sReturn +=
            "<td bgcolor = '" + fnRandomColourName() + "'>&nbsp;</td>";
        } /* if, else */

        iCharacterCounter++;
      } /* for ii */
      sReturn += "</tr>";
    } /* for jj */
    sReturn += "</table>";

    return sReturn;
  } // fnHtmlColourGrid()



