addLoadEvent(callback(addRowEventHandlers, {args: ['typ']}));
//jumpToParentAnchor('subnav');

function addRowEventHandlers(name)
{
  var checkboxes = document.getElementsByName(name);
  for( var index = 0; index < checkboxes.length; index++)
  {
    checkboxes[index].className = "invisible";
    
    var value = checkboxes[index].value;
        
    var row = document.getElementById(value);
    
    checkboxes[index].parentNode.className = "pseudo_checkbox checkbox";
    
    if(checkboxes[index].checked == true)
    {
      row.className = "selected";
    }


    row.onclick = callback(checkOption, {args: [name, value]});
  
    row.onmouseover = callback(highlightRow, {args: [row]});
    row.onmouseout = callback(lowlightRow, {args: [row]});
  }
}

function highlightRow(row)
{
  if(row.className != 'selected')
  {
    row.className = 'highlight';
  }  
}

function lowlightRow(row)
{
  if(row.className != 'selected')
  {
    row.className = '';
  }  
}

function checkOption(name, value)
{
  
  var checkboxes = document.getElementsByName(name);
  for(var index = 0; index < checkboxes.length; index++)
  {
    var row = document.getElementById(checkboxes[index].value);
    if(row)
    {
      if(row.id == value)
      {
        row.className = "selected";
      }
      else
      {
        row.className = "";
      } 
    }
    
    if(checkboxes[index].value == value)
    {
      checkboxes[index].checked = true;
    }
    else
    {
      // checkboxes[index].checked = false;
    }
  }
}
