// Javascript functions for Elaxy

// Fenster mit Parametern öffnen
function openWindow(ref, name, width, height) {
	window.open(ref, name, "width=" + width + ",height=" + height + ",left=0,top=0,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes");
}

//Ebene zeigen
function show(button) {
	stop();
	hidenow();
	dropdown = "menu"+button;
	document.getElementById(dropdown).style.display="block";
	document.getElementsByName(button)[0].style.backgroundPosition="0 0";
}

//Alle Ebenen verstecken
function hidenow() {
	i = 1;
	while (document.getElementById("menu"+i)) {
		document.getElementById("menu"+i).style.display="none";
		document.getElementsByName(i)[0].style.backgroundPosition="0 18px";		
		i++;
	}
}

//Warteschleife
function wait() {
	stop();
	tOut = setTimeout("hidenow('');",200);
}

//Timeout löschen
function stop() {
	if (tOut) clearTimeout(tOut);
}

//Globaler Timeout
tOut = false;