// Simon Willison's addLoadEvent() function
// from http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function remove_empty_ul() {
  var u = document.getElementById('sub_navig');
  var up = u.parentNode;
  if (u.childNodes.length < 2) {
    up.removeChild(u);
  }
}

function remove_duplicate_item() {
  var p = document.getElementById('navmenu');
  var pc = p.childNodes;
  var i;
  /*if (pc[7].textContent) {
    alert("textContent = "+pc[7].textContent);
  } else {
    alert("innerText = "+pc[2].innerText);
  }*/
  if (window.attachEvent) {
    alert("innerText = "+pc[2].innerText);
  } else {
    alert("textContent = "+pc[7].textContent);
  }
}

addLoadEvent(function() {
  remove_empty_ul();
  /*remove_duplicate_item();*/
});
