function menuheader_mouseout(oElm) {
  /*var mg = _currentMenuGroup;
  if (mg != null) {
    if (mg.timeoutId != null) {
      window.clearTimeout(mg.timeoutId);
    }
  }
  var rows = oElm.parentNode.parentNode.getElementsByTagName('tr');
  var item;
  var c = 0;
  for (var i=0; i<rows.length; i++) {
    item = rows[i].getElementsByTagName('td')[0];
    if (item != null) {
      c = item.getAttribute('subitems');
      if (c > 0) {
        menugroup_showHide(item, c, 'hide');
      }
    }
  }*/
}

function menu_click(oElm) {
  var href = oElm.getAttribute('href');
  if (href != null) {
    window.location.href = href;
  }
}

function menuitem_mouseover(oElm) {
  oElm.className = 'menuitem-over';
  oElm.focus();
}

function menuitem_mouseout(oElm) {
  oElm.className = 'menuitem';
}

function menugroup_click(oElm) {
  var href = oElm.getAttribute('href');
  if (href != null) {
    window.location.href = href;
    oElm.className = "menugroup-open";
  }else{
      if (oElm.expanded == true) {
        menugroup_collapse(oElm);
      }else{
        menugroup_expand(oElm);
    }
  }
}

function menugroup_mouseover(oElm) {
  if (oElm.expanded == null) {
    oElm.expanded = false;
  }
  var img = oElm.getElementsByTagName('img');
  if (img[0]) {
    if (oElm.expanded == true) {
      img[0].setAttribute('src', _path + '/images/redminus.gif');
    }else{
      img[0].setAttribute('src', _path + '/images/redplus.gif');
    }
  }
  oElm.className = "menugroup-over";
  oElm.focus();
  if (oElm.expanded == false) {
    oElm.timeoutId = setTimeout( function() { menugroup_expand(oElm); },1000);
  }
}

function menugroup_mouseout(oElm) {
  if (oElm.timeoutId != null) {
    window.clearTimeout(oElm.timeoutId);
    oElm.timeoutId = null;
  }
  var img = oElm.getElementsByTagName('img');
  if (img[0]) {
    if (oElm.expanded == true) {
      img[0].setAttribute('src', _path + '/images/blueminus.gif');
    }else{
      img[0].setAttribute('src', _path + '/images/blueplus.gif');
    }
  }
  if (oElm.expanded == false) {
    oElm.className = "menugroup";
  }else{
    /*oElm.className = "menugroup-expanded";*/
    oElm.timeoutId = setTimeout( function() { menugroup_collapse(oElm); },1000);
    oElm.className = "menugroup";
  }
}

function menugroup_expand(oElm) {
  if (oElm != null) {
    if (oElm.timeoutId != null) {
      window.clearTimeout(oElm.timeoutId);
      oElm.timeoutId = null;
    }
    var c = oElm.getAttribute('subitems');
    var img = oElm.getElementsByTagName('img');
    if (img[0]) {
      img[0].setAttribute('src', _path + '/images/redminus.gif');
    }
    menugroup_showHide(oElm, c, 'show');
    oElm.expanded = true;
  }
}

function menugroup_collapse(oElm) {
  if (ex != oElm.id){
      if (oElm != null) {
        var c = oElm.getAttribute('subitems');
        menugroup_showHide(oElm, c, 'hide');
        var img = oElm.getElementsByTagName('img');
        if (img[0]) {
          img[0].setAttribute('src', _path + '/images/blueplus.gif');
        }
        oElm.expanded = false;
      }
  }
}

function menugroup_showHide(oElm, c, sh) {
  var oRow = oElm.parentNode;
  var tid = oRow.getElementsByTagName('td')[0].id;
  for (var i=0; i<c; i++) {
    do {
      oRow = oRow.nextSibling;
    } while ((oRow && (oRow.nodeType != 1)) || (oRow && (oRow.nodeType == 1) &&  (oRow.getElementsByTagName('td')[0].id != tid)))
    if (oRow) {
      if (sh == 'show') {
        oRow.getElementsByTagName('td')[0].style.display = '';
      }else{
        oRow.getElementsByTagName('td')[0].style.display = 'none';
      }
    }else{
      break;
    }
  }
}

function menusubgroup_click(oElm) {
  var href = oElm.getAttribute('href');
  if (href != null) {
    window.location.href = href;
  }else{
      if (oElm.expanded == true) {
        menugroup_collapse(oElm);
      }else{
        menugroup_expand(oElm);
    }
  }
}

function menusubgroup_mouseover(oElm, target_id) {
  if (oElm.expanded == null) {
    oElm.expanded = false;
  }
  var img = oElm.getElementsByTagName('img');
  if (img[0]) {
    if (oElm.expanded == true) {
      img[0].setAttribute('src', _path + '/images/redminus.gif');
    }else{
      img[0].setAttribute('src', _path + '/images/redplus.gif');
    }
  }
  oElm.className = "menusubgroup-over";
  oElm.focus();
  if (oElm.expanded == false) {
    oElm.timeoutId = setTimeout( function() { menusubgroup_expand(oElm, target_id); },1000);
  }
}

function menusubgroup_mouseout(oElm, target_id) {
  if (oElm.timeoutId != null) {
    window.clearTimeout(oElm.timeoutId);
    oElm.timeoutId = null;
  }
  var img = oElm.getElementsByTagName('img');
  if (img[0]) {
    if (oElm.expanded == true) {
      img[0].setAttribute('src', _path + '/images/blueminus.gif');
    }else{
      img[0].setAttribute('src', _path + '/images/blueplus.gif');
    }
  }
  if (oElm.expanded == false) {
    oElm.className = "menusubgroup";
  }else{
    /*oElm.className = "menugroup-expanded";*/
    oElm.timeoutId = setTimeout( function() { menusubgroup_collapse(oElm, target_id); },1000);
    oElm.className = "menusubgroup";
  }
}

function menusubgroup_expand(oElm, target_id) {
  if (oElm != null) {
    if (oElm.timeoutId != null) {
      window.clearTimeout(oElm.timeoutId);
      oElm.timeoutId = null;
    }
    var c = oElm.getAttribute('sub2items');
    var img = oElm.getElementsByTagName('img');
    if (img[0]) {
      img[0].setAttribute('src', _path + '/images/redminus.gif');
    }
    menusubgroup_showHide(oElm, c, 'show', target_id);
    oElm.expanded = true;
  }
}

function menusubgroup_collapse(oElm, target_id) {
  if (ex != oElm.id){
      if (oElm != null) {
        var c = oElm.getAttribute('sub2items');
        menusubgroup_showHide(oElm, c, 'hide', target_id);
        var img = oElm.getElementsByTagName('img');
        if (img[0]) {
          img[0].setAttribute('src', _path + '/images/blueplus.gif');
        }
        oElm.expanded = false;
      }
  }
}

function menusubgroup_showHide(oElm, c, sh, target_id) {
  var oRow = oElm.parentNode;
  var tid = oRow.getElementsByTagName('td')[0].id;
  tid = target_id + tid;
  for (var i=0; i<c; i++) {
    do {
      oRow = oRow.nextSibling;
    } while ((oRow && (oRow.nodeType != 1)) || (oRow && (oRow.nodeType == 1) &&  (oRow.getElementsByTagName('td')[0].id != tid)))
    if (oRow) {
      if (sh == 'show') {
        oRow.getElementsByTagName('td')[0].style.display = '';
      }else{
        oRow.getElementsByTagName('td')[0].style.display = 'none';
      }
    }else{
      break;
    }
  }
}

function menusubitem_mouseover(oElm) {
  var img = oElm.getElementsByTagName('img');
  if (img[0]) {
    img[0].setAttribute('src', _path + '/images/redminus.gif');
  }
  oElm.className = "menusubitem-over";
  oElm.focus();
  ex = oElm.id;
}

function menusubitem_mouseout(oElm) {
  var img = oElm.getElementsByTagName('img');
  if (img[0]) {
    img[0].setAttribute('src', _path +  '/images/blueminus.gif');
  }
  oElm.className = "menusubitem";
  ex = "";
}

function menusub2item_mouseover(oElm) {
  var img = oElm.getElementsByTagName('img');
  if (img[0]) {
    img[0].setAttribute('src', _path + '/images/redminus.gif');
  }
  oElm.className = "menusub2item-over";
  oElm.focus();
  ex = oElm.id;
}

function menusub2item_mouseout(oElm) {
  var img = oElm.getElementsByTagName('img');
  if (img[0]) {
    img[0].setAttribute('src', _path +  '/images/blueminus.gif');
  }
  oElm.className = "menusub2item";
  ex = "";
}