function showSubMenu(which,curobject,distance){
	if(which != currentSubMenu){
		findPos(curobject);
		clearTimeout(currentTimeOut);
		hideSubMenu();
		menuToShow = document.getElementById(which);
		currentSubMenu = which;
		menuToShow.style.top = curtop+distance;
		menuToShow.style.left = curleft;
		menuToShow.style.display = 'block';
		currentTimeOut = setTimeout('hideSubMenu()', 3000)
	}
}

function findPos(obj) {
	curleft = 0;
	curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
}


function sustainSubMenu(){
	clearTimeout(currentTimeOut);
	currentTimeOut = setTimeout('hideSubMenu()', 20000)
}

function hideSubMenu(){
	if(currentSubMenu != ""){
		menuToHide = document.getElementById(currentSubMenu);
		menuToShow.style.display = 'none';
		currentSubMenu = "";
	}
}

// Global variables
currentSubMenu = "";
currentTimeOut = "";
curleft = 0;
curtop = 0;
			