/** 
* Copyright 2004 massimocorner.com
* JavaScript library for the "hiermenu" ColdFusion custom tag
* @author      Massimo Foti (massimo@massimocorner.com)
* @version     1.0, 2004-10-12
 */
 
var tmt_allowHideHiermenu=true;
function tmt_showHiermenu(menuobj){
	tmt_allowHideHiermenu=false;
	if(document.all){
		var childMenus = menuobj.parentNode.childNodes;
		for(var i=0; i<childMenus.length; i++){
			var obj = childMenus[i];
			if(obj.nodeName.toLowerCase() == "ul"){
				obj.style.display = "block";
				obj.attachEvent("onmouseover", function(){obj.style.display = "block";});
			}
		}
	}
}

function  tmt_hideHiermenu(menuobj) {
	if(document.all/* && tmt_allowHideHiermenu*/){
		var childMenus = menuobj.parentNode.childNodes;
		for(var i=0; i<childMenus.length; i++){	
			var obj = childMenus[i];
			if(obj.nodeName.toLowerCase() == "ul"){
				obj.style.display = "none";
				obj.attachEvent("onmouseout", function(){obj.style.display = "none";});
			}
		}
	}
}
/*
var tmt_hideHiermenu_menuobj, tmt_hideHiermenu_timeout=null;
function tmt_hideHiermenu(menuobj){
	tmt_allowHideHiermenu=true;
	tmt_hideHiermenu_menuobj=menuobj;
	clearTimeout(tmt_hideHiermenu_timeout);
	tmt_hideHiermenu_timeout=setTimeout("tmt_hideHiermenu_do(tmt_hideHiermenu_menuobj)",100);
}
*/



/**
* Ez a kattintgatós, maga alá nyílós menühöz kell, ha minden menünél becsukunk mindent.
*/
function tmt_showParentsHiermenu(menuobj,hideall) {
	if (!menuobj || !menuobj.parentNode){return false;}
	if (menuobj.parentNode.id==hideall){return true;}
	if (menuobj.parentNode.nodeName.toLowerCase() == "ul"){
		menuobj.parentNode.style.display = "block";
		if (getBrowserType('ie'))IExploreIDclassHack(menuobj.parentNode.id, menuobj.parentNode.className);
	}
	tmt_showParentsHiermenu(menuobj.parentNode,hideall);
}
var tmt_hideChildrenHiermenu_id=0;
function tmt_hideChildrenHiermenu(menuobj,dontallowhide,ahref) {
	if (!menuobj || !menuobj.childNodes || typeof menuobj.id=='undefined')return false;
	//kinyitni ahol vagyunk, ha minden szinten php oldalletöltésre megyünk
	if (typeof ahref!='undefined' && menuobj.nodeName.toLowerCase() == "a" && menuobj.href==ahref){
		tmt_showParentsHiermenu(menuobj,'tmtHierbar');
		tmt_showHiermenu3(menuobj);
	}
 	if (!menuobj.id) {
        menuobj.id='tmt_hideChildrenHiermenu_id_'+tmt_hideChildrenHiermenu_id;
        tmt_hideChildrenHiermenu_id++;
    }
	if(menuobj.nodeName.toLowerCase() == "ul"){
		if (dontallowhide!=1)menuobj.style.display = "none";
	}
	for (var i=0;i<menuobj.childNodes.length;i++) {
		tmt_hideChildrenHiermenu(menuobj.childNodes[i],dontallowhide,ahref);
	}
}
function tmt_showHiermenuHideOther(menuobj,hideall) {//starts from outer obj!! forEx: div, not the UL itself
	if (hideall && document.getElementById(hideall)) var divobj=document.getElementById(hideall);
	tmt_hideChildrenHiermenu(divobj);
	//get parents and show
	tmt_showParentsHiermenu(menuobj,hideall);
	//get childs and
	tmt_showHiermenu3(menuobj);
}
function tmt_showHiermenu3(menuobj){
	if (menuobj && menuobj.parentNode) {
		var childMenus = menuobj.parentNode.childNodes;
		for(var i=0; i<childMenus.length; i++){
			var obj = childMenus[i];
			if(obj.nodeName.toLowerCase() == "ul"){
				obj.style.display = "block";
			}
		}
	}
}

/**/



