function SidebarHighlight(){
  var id;
  id=0;
  while (window.onIdName[id] && window.onClassName[id])
  {
    var e=document.getElementsByName(onIdName[id]);
    for(var i=0;i<e.length;i++)
    {
       e[i].className = onClassName[id];
    }
    id++;
  }
}

function doSwitchHighlight(curElement){
  var curSwitchIdName;
  var id;
  
  //curSwitchIdName = curElement.parentElement.id; //only works in IE
  curSwitchIdName = curElement.parentNode.id;
  id=0;
  //Loops thru all parent switch structures
  while (window.SwitchIdName[id] && window.SwitchClassNameOn[id] && window.SwitchClassNameOff[id])
  {
    //Finds current parent element structure
    if(curSwitchIdName == window.SwitchIdName[id]) {

      //Turn all switch elements of current (type) off
      var e=document.getElementsByName(SwitchIdName[id]);
      for(var i=0;i<e.length;i++)
      {
         e[i].className = SwitchClassNameOff[id];
      }
      
      //Turn current switch element on
      //curElement.parentElement.className = window.SwitchClassNameOn[id]; //only works in IE
      curElement.parentNode.className = window.SwitchClassNameOn[id];
    }
    id++;
  }
}
