function positionChild(parent, child) {
  child.style.left = parent.offsetLeft + "px";
  child.style.width = parent.offsetWidth + "px";
  child.style.top = parent.offsetHeight + "px";
}

function positionGChild(parent, child) {
  parent.parentNode.parentNode.style.display = "block";
  child.style.top = String(parent.parentNode.parentNode.offsetTop + parent.parentNode.offsetTop + parent.offsetTop) + "px";
  child.style.left = String(parent.parentNode.parentNode.offsetLeft + parent.parentNode.parentNode.offsetWidth) + "px";
}

function ddMenu(elem,show) {
  var ids = elem.id.split('_');
  var parent = document.getElementById("pl_" + ids[1]);
  var child = document.getElementById("cd_" + ids[1]);
  var gchild = (ids.length > 2 ? document.getElementById("gd_" + ids[1] + "_" + ids[2]) : null);
  if (gchild) {
    var childli = document.getElementById("cl_" + ids[1] + "_" + ids[2]);
    positionGChild(childli, gchild);
  }
  else
    positionChild(parent, child);
    parent.className = (show ? "mouseover" : "");
    child.style.display = (show ? "block" : "none");
  if (gchild) gchild.style.display = (show ? "block" : "none");
}