/**
 * Some small functions to handle the submenu
 * (c) 2010, Achim Wiedemann
 */
function findNodeByAttribute(node, attrName, attrValue){
  if (node.nodeType != 1) // Not an element
    return null;

// No time to mess around with cross-browser bullsh*t (won't work in IE)...
// if (node.getAttribute(attrName) != null && node.getAttribute(attrName) == attrValue)
  if (node.className == attrValue)
    return node;
    
  var ret;
  var children = node.childNodes;
  for (var i=0; i < children.length; i++)
    if (null != (ret = findNodeByAttribute(children[i], attrName, attrValue)))
      return ret;
      
  return null;
}

function show(node){
  subMenuNode = findNodeByAttribute(node, "class", "submenu");
  if (subMenuNode != null)
	subMenuNode.style.display = "block";
}

function hide(node){
  subMenuNode = findNodeByAttribute(node, "class", "submenu");
  if (subMenuNode != null)
	subMenuNode.style.display = "none";
}
