// Displays or hides a ZetaneonUIWindow
function ZetaneonUIWindow(sID, bShow) {
	// Check if the window exists
	if (document.getElementById("ZetaneonUIWindow_" + sID)) {
		// Hide window
		if (!bShow) {
			fadeElement("ZetaneonUIWindow_" + sID, 0, 1, 0.125, 50, "document.getElementById('ZetaneonUIWindow_" + sID + "').style.display = 'none';");
		}
		// Show window
		else {
			document.getElementById("ZetaneonUIWindow_" + sID).style.display = "table";
			fadeElement("ZetaneonUIWindow_" + sID, 1, 0, 0.125, 50, '');
		}
	}
}

// Replaces the content of the UIWindow
function ZetaneonUIWindowContent(sID, str_content, str_close) {
	// Check if the window exists
	if (document.getElementById(sID) && str_content != "") {
		// Check if the window should habe a close button
		if (str_close) {
			document.getElementById(sID).innerHTML  = '<div class="ZetaneonUIWindow_close"><span onclick="ZetaneonUIWindow(\'' + sID + '\', 0)">Schließen</span></div>';
			document.getElementById(sID).innerHTML += str_content;
		}
		else {
			document.getElementById(sID).innerHTML = str_content;
		}
	}
}

// Switch umschalten und Funktionen ausführen
function ZetaneonUISwitch(sID, sON, sOFF) {
	// Zugriff auf Switch Button
	SwitchButton = document.getElementById(sID).getElementsByTagName("div");
	
	// Switch auf EIN schalten
	if (SwitchButton[0].style.opacity == 0.5) {
		SwitchButton[0].style.opacity = 1.0;
		SwitchButton[2].style.opacity = 0.5;
		eval(sON);
	}
	// Switch auf AUS schalten
	else {
		SwitchButton[0].style.opacity = 0.5;
		SwitchButton[2].style.opacity = 1.0;
		eval(sOFF);
	}
}
