cm = null;
hide_delay = 500;
tstat = 0;

function getPos(el, sProp) {
	var iPos = 0;
	while (el != null) {
		iPos += el["offset" + sProp];
		el = el.offsetParent;
	}
	return iPos;
}

function show(el, m) {
	if (cm != null) {
		cm.style.visibility = "hidden";
	}
	if (m != null) {
		m = document.getElementById(m);
		m.style.left = getPos(el, "Left") + "px";
		m.style.top = getPos(el, "Top") + el.offsetHeight + "px";
		m.style.visibility = "visible";
		cm = m;
	}
}

function adjustwidth(el, m) {
	var newWidth = el.offsetWidth;
	if (navigator.userAgent.indexOf("MSIE") < 0 || window.opera) newWidth = newWidth - 2;
	m = document.getElementById(m);
	m.style.width = newWidth + "px";
}

function hidemenu() {
	timer1 = setTimeout("show(null, null)", hide_delay);
	tstat = 1;
	return 1;
}

function cancelhide() {
	if (tstat == 1) {
		clearTimeout(timer1);
		tstat = 0;
	}
	return 1;
}