  // --------
  // buttons parameters
  // --------
  var linkClass1 = "link1";
  var linkClass2 = "link2";
  var buttonClasses = new Array("button", "bigbutton", "tinybutton", "video", "button3", "button30");
  var colorOffsets = new Array(16, 16, 16, 0, 0, 0);
  var bgColors = new Array( 
    "#000000", "#040004", "#080008", "#0c000c",
    "#100010", "#140014", "#180018", "#1c001c",
    "#200020", "#240024", "#280028", "#2c002c",
    "#300030", "#340034", "#380038", "#3c003c",
    "#400040", "#440044", "#480048", "#4c004c",
    "#500050", "#540054", "#580058", "#5c005c",
    "#600060", "#640064", "#680068", "#6c006c",
    "#700070", "#740074", "#780078", "#7c007c",
    "#800080", "#840084", "#880088", "#8c008c",
    "#900090", "#940094", "#980098", "#9c009c",
    "#a000a0", "#a400a4", "#a800a8", "#ac00ac",
    "#b000b0", "#b400b4", "#b800b8", "#bc00bc",
    "#c000c0");
  var fgColors = new Array(
    "#ff9000", "#ff9400", "#ff9800", "#ff9c00", 
    "#ffa000", "#ffa400", "#ffa800", "#ffac00",
    "#ffb000", "#ffb400", "#ffb800", "#ffbc00",
    "#ffc000", "#ffc400", "#ffc800", "#ffcc00",
    "#ffd000", "#ffd400", "#ffd800", "#ffdc00",
    "#ffe000", "#ffe400", "#ffe800", "#ffec00",
    "#fff000");
  var buttonClass2 = "button2";
  var bgColors2 = new Array(
    "#100010", "#140014", "#180018", "#1c001c",
    "#200020", "#240024", "#280028", "#2c002c",
    "#300430", "#340434", "#380438", "#3c043c",
    "#400840", "#440844", "#480848", "#4c084c",
    "#500c50", "#540c54", "#580c58", "#5c0c5c",
    "#601060", "#641064", "#681068", "#6c106c",
    "#701470", "#741474", "#781478", "#7c147c",
    "#801880", "#841884", "#881888", "#8c188c",
    "#901c90", "#941c94", "#981c98", "#9c1c9c",
    "#a020a0", "#a420a4", "#a820a8", "#ac20ac",
    "#b024b0", "#b424b4", "#b824b8", "#bc24bc",
    "#c028c0", "#c428c4", "#c828c8", "#cc28cc",
    "#d02cd0", "#d42cd4", "#d82cd8", "#dc2cdc",
    "#e030e0", "#e430e4", "#e830e8", "#ec30ec",
    "#f034f0", "#f434f4", "#f834f8", "#fc34fc",
    "#ff38ff");
  var fgColors2 = new Array(
    "#ff7000", "#ff7800", "#ff8000", "#ff8800",
    "#ff9000", "#ff9800", "#ffa000", "#ffa800",
    "#ffb000", "#ffb800", "#ffc000", "#ffc800",
    "#ffd000", "#ffd800", "#ffe000", "#ffe800",
    "#fff000");
  // --------
  // marquee parameters
  // --------
  var marqueeId = "marquee";
  var time1 = 75;
  var time2 = 2000;
  // --------
  // make "link" nodes able to signal their state
  // turn "button" nodes & their child link into buttons
  // start a marquee
  // --------
  window.onload = function ()
  {
    var buttons = new Array();
    var id2 = 0;
    // check all link for a button parent or child
    for (var i = 0; i < document.links.length; i++)
    {
      var ol = document.links[i];
      var op = ol.parentNode;
      if (ol.className == linkClass1)
      {
        op.classOut = op.className;
        op.onmouseover = function () 
        { this.className = this.classOut + "_over"; };
        op.onmouseout = function () 
        { this.className = this.classOut; };  
      }
      if (ol.className == linkClass2)
      {
        var oc = ol.firstChild;
        oc.classOut = oc.className;
        oc.onmouseover = function () 
        { this.className = this.classOut + "_over"; };
        oc.onmouseout = function () 
        { this.className = this.classOut; };  
      }
      var bflag = 0;
      for (var k = 0; k < buttonClasses.length; k++)
      { 
        if (buttonClasses[k] == op.className) 
        { bflag = 1; op.offset = colorOffsets[k]; } 
      }
      if (bflag == 1)
      {
        // turn the parent node and its children into a button
        op.onmouseover = Over;
        op.onmouseout = Out;
        op.onclick = Click;
        op.style.color = op.style.borderColor = fgColors[0];
        op.style.backgroundColor = bgColors[op.offset];
        op.href = ol.href;
        for (var j = 0; j < ol.childNodes.length; j++)
        { op.appendChild(ol.childNodes[j].cloneNode(true)); }
        buttons[buttons.length] = ol;
      }
      if (op.className == buttonClass2)
      {
        // turn the parent node and its child link into a button
        op.id = id2;
        op.onmouseover = Over2;
        op.onmouseout = Out2;
        op.onclick = Click2;
        op.style.backgroundColor = bgColors2[id2*6];
        op.style.color = op.style.borderColor = fgColors2[0];
        op.href = ol.href;
        for (var j = 0; j < ol.childNodes.length; j++)
        { op.appendChild(ol.childNodes[j].cloneNode(true)) }
        // register the old link
        buttons[buttons.length] = ol;
        id2++;
      }
    }
    // remove unused links
    for (var i = 0; i < buttons.length; i++)
    {
      var ol = buttons[i];
      ol.parentNode.removeChild(ol);
    }
    // set a marquee
    var marquee = document.getElementById(marqueeId);
    if (marquee != null) { Marquee(marquee) }
    // activate content if needed
    //var content = document.getElementById('content');
    //if (content != null) { content.focus(); }
  }
  // --------
  //  the button was entered, change its aspect
  // --------
  function Over() 
  { 
    window.status = this.href;
    Light(this, 1);
  }
  // --------
  //  the button was left, change its aspect
  // --------
  function Out()  
  { 
    window.status = "";
    Light(this, -1);
  }
  // --------
  //  the button was clicked, change the document location
  // --------
  function Click() 
  { 
    var href = this.href;
    if (href == "javascript:history.back()") { history.back() }
    else { window.open(this.href, "_self") }
  }
  // --------
  //  light/unlight a button
  // --------
  function Light(node, incr) 
  { 
    var step = (incr == -1 ? 24 : 0);
    var count = 24;
    setTimeout(_light, 15);
    function _light()
    {
      node.style.backgroundColor = bgColors[node.offset + step];
      node.style.color = node.style.borderColor = fgColors[step];
      step += incr;
      if (--count > -1) { setTimeout(_light, 15) }
    }
  }
  // --------
  //  the button2 was entered, change its aspect
  // --------
  function Over2()
  {
    window.status = this.href;
    Light2(this, 1);
  }
  // --------
  //  the button2 was left, change its aspect
  // --------
  function Out2()
  {
    window.status = "";
    Light2(this, -1);
  }
  // --------
  //  the button2 was clicked, change the document location
  // --------
  function Click2() 
  { 
    window.open(this.href, "_self");
  }
  // --------
  //  enlighten a button2
  // --------
  function Light2(node, incr)
  {
    var offset = node.id * 6;
    var current = (incr == -1 ? 16 : 0);
    var count = 16;
    setTimeout(_light, 20);
    function _light()
    {
      current += incr;
      node.style.backgroundColor = bgColors2[offset + current];
      node.style.borderColor = node.style.color = fgColors2[current];
      if (--count > 0) { setTimeout(_light, 20) }
    }
  }
  // --------
  //  animate a marquee
  // --------
  function Marquee (node)
  {  
    var child = node.firstChild; 
    var text = child.data;
    var max = text.length;
    var current = 0;
    setTimeout(_marquee, time1);
    function _marquee()
    {
      var time = time1;
      child.data = text.substring(0, ++current);
      if (current == max) { current = 0; time = time2 }
      setTimeout(_marquee, time);
    }
  }
