var timer;
var cm=null;
//document.onclick = new Function("show(null)");

function getPos(el,sProp) {
	var iPos = 0;
	while (el!=null) {
		iPos+=el["offset" + sProp];
		el = el.offsetParent;
	}
	return iPos;
}

function show(el,m) {
	if(timer) clearTimeout(timer);
	if (m) {
		m.style.position='absolute';
		m.style.pixelLeft = getPos(el,"Left")-1;
		m.style.pixelTop = getPos(el,"Top") -145; //  + el.offsetHeight
		m.style.display='block';
	}
	if ((m!=cm) && (cm)) {
		cm.style.display='none'
	}
	cm=m;
}


function contains(a, b) {
  // Return true if node a contains node b.
  while (b.parentNode) {
    if ((b = b.parentNode) == a)	{
      return true;
		}
	}
  return false;
}

function disappear() {
	// if user didn't move onto the subnav layer, hide the subnav
	if (cm) {
		cm.style.display='none';
	}
	cm = null;
}

function hide(event,id) {
	timer = setTimeout("show(null)", 800);
}
