function addClassSwitcherToProducts () {
  if (document.getElementById && document.createTextNode) {
    var productsBlock = document.getElementById('lProducts');
    if (productsBlock) {
      var divs=productsBlock.getElementsByTagName('div');
      for (var i=0; i<divs.length; i++) {
        divs[i].onmouseover = function () {addClass(this, 'selected')};
        divs[i].onmouseout = function () {removeClass(this, 'selected')};
      }
    }
  }
}

function CollapseExpand() {
  if (document.getElementById && document.createTextNode) {
    var distr = document.getElementById('distributions');
    if (distr) {
      var el=distr.getElementsByTagName('caption');
      for (var i=0; i<el.length; i++) {
        el[i].onclick = function () {
          if (hasClass(this, 'collapsed')) {
            removeClass(this, 'collapsed');
            this.parentNode.getElementsByTagName('tbody')[0].style.display = '';
          }
          else {
            addClass(this, 'collapsed');
            this.parentNode.getElementsByTagName('tbody')[0].style.display = 'none';
          }
        }
      }
      var tr=distr.getElementsByTagName('tr');
      for (var i=0; i<tr.length; i++) {
        tr[i].onmouseover = function () {addClass(this, 'highlight');}
        tr[i].onmouseout = function () {removeClass(this, 'highlight');}
      }
    }
  }
}