// --------------------------------------------------
// simple dhtml menue
// 
// needs lib_neu.js or some of the functions
// available there
//
// author:    wendenburgj@sixt.de
// created:   08.10.2003
//
// modified:  
//
// --------------------------------------------------

aktiv    =	true;  // flag, helps mac-nc4 to deal with clearTimeout
delay    =	null;  // setTimeout until menue will be hidden
delayDur =	400;   // time in ms until menue will be hidden
elM      =  false; // remember mouseover

function startNavi() {
	// only one menue - submenue
	// register events 
	if (nc) {
		dRef("lisoSubNavi").captureEvents(Event.MOUSEOUT | Event.MOUSEMOVE);
		dRef("lisoNavi").captureEvents(Event.MOUSEOUT);
	}
	dRef("lisoSubNavi").onmouseout  =  initHiding;
	dRef("lisoSubNavi").onmousemove =  checkHiding;
	dRef("lisoNavi").onmouseout     =  initHiding;
}

// initializing hiding submenue
function initHiding (e) {
	// in case of very slow mousemoves nc4 does not notice mousemove within the delay
	var isInner =  !!(nc && (typeof e.target.id == "undefined"));		
	elPast      =  elM
	if (aktiv) {
		if (!isInner) {
			delay	=  setTimeout('country_off()', delayDur);
			aktiv	=  false;
		}
	}
}

// clearing the hiding process in case of mousemove within the div-layer
function checkHiding (e) {
	elM =  this.id;
	if (!aktiv) {
		clearTimeout(delay);
		aktiv =  true;
	}
}

function country_off () {
	if (elPast) dRefS(elPast).visibility =  "hidden";       
}

function country_on (num) {
	if (!aktiv) {
		clearTimeout (delay);
		aktiv =  true;
	}
	
	if (elM && elM != num) dRefS(elM).visibility =  "hidden";
	dRefS(num).visibility                        =  "visible";
	elM                                          =  num;
}