addOnDomLoadHandler(side_nav_class_adj);

function side_nav_class_adj()
{
    if (document.all&&document.getElementById)
    {
        navRoot = document.getElementById("category_list");
        if(navRoot)
        {

        for (i=0; i<navRoot.childNodes.length; i++)
        {
            node = navRoot.childNodes[i];
            if (node.nodeName=="LI")
            {
                node.onmouseover=function()
                {
                    this.className+=" over";
                }
                node.onmouseout=function()
                {
                    this.className=this.className.replace(" over", "");
                }
                /*
                Don't think the rest of this is necessary
                */
                for (j=0; j<node.childNodes.length; j++)
                {
                    bobnode = node.childNodes[j];
                    for (k=0; k<bobnode.childNodes.length; k++)
                    {
                        childnode = bobnode.childNodes[k];
                        if (childnode.nodeName=="LI")
                        {
                            childnode.onmouseover=function()
                            {
                                this.className+=" over";
                            }
                            childnode.onmouseout=function()
                            {
                                this.className=this.className.replace(" over", "");
                            }
                        }
                    }
                }
            }
        }
        }
    }
}

var lastOver;

function initSetHover()
{
//if((compat.isie)&&(compat.dom))  // IE 5.0 or later
//{
//  document.body.onmouseover=doSetHoverMouseOver;
//  document.body.onmouseout=doSetHoverMouseOut;
//}
}

function doSetHoverMouseOut(e)
{
  if(!e) var e=window.event;
  // setHoverClear();
  t=getTarget(e);
  debug_log("got mouse out on "+t.id);

  var text_element=document.getElementById("hidden_"+t.id);
  if(text_element)
  {
     this.className=this.className.replace(" reveal", "");
     //modClassName(text_element,'reveal','');
  }

  // t.style.color='black'
  // setHoverClear();
  // t=getParentNode(t);
  // t=getParentNode(t);
  // var children=t.childNodes;
  // c=children[1];
  // modClassName(c,'activate','');
}

function doSetHoverMouseOver(e)
{
  if(!e) var e=window.event;
  // setHoverClear();
  t=getTarget(e);
  debug_log("got mouse over on " +t+":::"+t.id);
  // alert("got event on node "+t.nodeName);

  var text_element=document.getElementById("hidden_"+t.id);
  if(text_element)
  {
     this.className+=" reveal";
     //modClassName(text_element,'','reveal');
  }

  // t.style.color='red'
  // t=getParentNode(t);
  // t=getParentNode(t);
  // var children=t.childNodes;
  // c=children[1];
  // alert("change class name of node "+c.nodeName);
  // modClassName(c,'','activate');
  /*
  lastOver=t;
  while(t)
  {
    modClassName(t,'','hover');
    t=getParentNode(t);
  }
  */
}

function setHoverClear()
{
  var t=lastOver;
  lastOver=null;
  while(t)
  {
    modClassName(t,'hover','');
    t=getParentNode(t);
  }
}


