function showDetails(i) {	document.getElementById("details" + i).style.display="";	document.getElementById("nodetails" + i).style.display="none";}function hideDetails(i) {	document.getElementById("details" + i).style.display="none";	document.getElementById("nodetails" + i).style.display="";}function openPopup(strURL, iWidth, iHeight) { 	if (winPop) {		winPop.close();	}	var iLeft = (screen.width - iWidth) / 2;	var iTop = (screen.height - iHeight) / 2;	var winPop = window.open(strURL, "WIN", "directories=no,location=no,menubar=no,resizable=yes,status=no,scrollbars=yes,toolbar=no,width=" + iWidth + ",height=" + iHeight + ",left=" + iLeft + ",top="+(iTop -15 ));		winPop.focus();}function openPopupNewWindow(strURL, iWidth, iHeight) { 	var dNow = new Date();		 	var millisec = dNow.getTime();	 	var iLeft = (screen.width - iWidth) / 2;	var iTop = (screen.height - iHeight) / 2;	var winPop = window.open(strURL, millisec, "directories=no,location=no,menubar=no,resizable=yes,status=no,scrollbars=yes,toolbar=no,width=" + iWidth + ",height=" + iHeight + ",left=" + iLeft + ",top="+(iTop -15 ));		winPop.focus();}function openPopupNewWindowNoScroll(strURL, iWidth, iHeight) { 	var dNow = new Date();		 	var millisec = dNow.getTime();	 	var iLeft = (screen.width - iWidth) / 2;	var iTop = (screen.height - iHeight) / 2;	var winPop = window.open(strURL, millisec, "directories=no,location=no,menubar=no,resizable=yes,status=no,scrollbars=no,toolbar=no,width=" + iWidth + ",height=" + iHeight + ",left=" + iLeft + ",top="+(iTop -15 ));		winPop.focus();}function openPopupScrollbar(strURL, iWidth,  iHeight) { 	if (popWin) {		popWin.close();	}	var iLeft = (screen.availWidth - iWidth) / 2;	var iTop = (screen.availHeight - iHeight) / 2;	var popWin = window.open(strURL, 'title', "directories=no,location=no,menubar=no,resizable=yes,status=no,scrollbars=yes,toolbar=no,width=" + iWidth + ",height=" + iHeight + ",left=" + iLeft+",top="+(iTop -15 ));	popWin.focus();}function openPopupFeedback(strURL, iWidth,  iHeight, bIsScrolling) { 	if (popWin) {		popWin.close();	}	var iLeft = (screen.availWidth - iWidth) / 2;	var iTop = (screen.availHeight - iHeight) / 2;	if (bIsScrolling=="") strScrolling="yes";	var popWin = window.open(strURL, 'title', "directories=no,location=no,menubar=no,resizable=yes,status=no,scrollbars=yes,toolbar=no,width=" + iWidth + ",height=" + iHeight + ",left=" + iLeft+",top="+(iTop -15 ));	popWin.focus();}function openWindow(strURL) { 	var dNow = new Date();		 	var millisec = dNow.getTime();		var winPop = window.open(strURL, millisec);		winPop.focus();}function closeCurrentPopupWindow() {	if (history.length > 0) {		history.back();	} else {		 window.close();	}}function UrlToOpener(strUrl) {		opener.location.href = strUrl;		opener.focus();}function buttonMouseover(id) {	if (id) {		if(document.getElementById(id)) {			document.getElementById(id).style.backgroundColor = '#DDDDDD';		}	}}function buttonMouseout(id) {	if (id) {		if (document.getElementById(id)) {			document.getElementById(id).style.backgroundColor= 'White';		}	}}function switchOnOffTable(id) {	if (id) {		if (document.getElementById(id)) {				if (document.getElementById(id).style.display == "none") {					document.getElementById(id).style.display = "block";				} else {					document.getElementById(id).style.display = "none";				}		}	}}function openKurs(url) {	kurs = window.open(url,'','directories=no,location=no,menubar=no,resizable=no,status=yes,scrollbars=no,toolbar=no,width=1015,height=694,top=0,left=0')}var strHLBGColorOld = "";function showHL(element) {		strHLBGColorOld = element.style.backgroundColor;		element.style.backgroundColor = '#F2F2F2';}function hideHL(element) {		element.style.backgroundColor = strHLBGColorOld;}function selectAllInput(elm){    if (elm)    {        elm.focus();        elm.select();    }}// WIN Umfragenfunction showUmfrage(strKeyUmfrage, strSprache) {	document.write("<div id=\"DivLoadUmfrage\">Loading...</div>")	initHTTPRequest();	var sURL = strDBPathUmfragenWeb + "/WebAjaxShowUmfrage?OpenAgent&keyumfrage=" + strKeyUmfrage + "&sprache=" + strSprache;	http_request.onreadystatechange = showUmfrageReturn;	http_request.open('GET', sURL, true);	http_request.send(null);}function showUmfrageReturn() {	var strResponse = "";	if (http_request.readyState == 4) {	     	if (http_request.status == 200) {			// Antwort der Ajax Abfrage         			strResponse = http_request.responseText;		}		else {//			alert('Fehler Status ungleich 200');		}	}	else {		// Antwort ist noch nicht vollst\u00E4ndig (Kein Fehler)//		alert('ReadyState ungleich 4');		return;	}	if (strResponse == "") {			document.getElementById("DivLoadUmfrage").innerHTML = "Die Umfrage konnte nicht geladen werden!";	} else {			document.getElementById("DivLoadUmfrage").innerHTML = strResponse;	}}function saveUmfrage(strKeys, strSprache) {	if (http_submit == true) return;		// Antworten validieren und in einem String sammeln	var strKeysAntworten = "";	var strTextAntworten = "";	var arrKeys = strKeys.split(":");	var blnAllChecked = true;	for (var i=0; i < arrKeys.length; i++) {		var el = document.getElementsByName("Antwort" + arrKeys[i]);		var strTyp = document.getElementById("Typ" + arrKeys[i]).innerHTML;		var blnPflicht = (document.getElementById("Pflicht" + arrKeys[i]).innerHTML == "1");		var intMin = (document.getElementById("Min" + arrKeys[i])) ? document.getElementById("Min" + arrKeys[i]).innerHTML : 0;		var intMax = (document.getElementById("Max" + arrKeys[i])) ? document.getElementById("Max" + arrKeys[i]).innerHTML : 1000;		if (strTyp == "text" || strTyp == "textmulti" || strTyp == "zahl") {			// Textantworten zusammenstellen			if (strTextAntworten == "") {				strTextAntworten = arrKeys[i] + "$#$#$" + document.getElementById("Antwort" + arrKeys[i]).value;			} else {				strTextAntworten = strTextAntworten + "\u00A7#\u00A7#\u00A7" + arrKeys[i] + "$#$#$" + document.getElementById("Antwort" + arrKeys[i]).value;			}			// Pflichtfeldpr\u00FCfung Textfelder			if (blnPflicht) {					if (document.getElementById("Antwort" + arrKeys[i]).value == "") {					document.getElementById("Antwort" + arrKeys[i]).style.backgroundColor = strBGColorInvalid;					blnAllChecked = false;				} else {					document.getElementById("Antwort" + arrKeys[i]).style.backgroundColor = strBGColorValid;				}			}			if (strTyp == "zahl") {					if (!checkNumber("Antwort" + arrKeys[i], blnPflicht)) {						blnAllChecked = false;				}			}		} else {			blnChecked = false;			var intAntworten = 0;			// Alle Antworten der Frage abklappern			for (var x=0; x < el.length; x++) {				if (el[x].checked) {					if (strKeysAntworten == "") {						strKeysAntworten = el[x].value;					} else {						strKeysAntworten = strKeysAntworten + ":" + el[x].value;					}					intAntworten++;				}			}			// Pflichtfeldpr\u00FCfung Radiobuttons und Checkboxen			if (blnPflicht) {				if (intAntworten < intMin || (intMax > 0 && intAntworten > intMax)) {					document.getElementById("Umfrage" + arrKeys[i]).style.backgroundColor = strBGColorInvalid;					blnAllChecked = false;				} else {					document.getElementById("Umfrage" + arrKeys[i]).style.backgroundColor = strBGColorValid;				}			}		}	}	if (blnAllChecked == false) {		showConfirm("Weinig Information Net", strPflichtfelderText, strOk, "", "", "", "Exclamation");		return;	}		http_submit = true;	showConfirm(strDBTitle, 'Please wait...', '', '', '', '', 'Wait');	initHTTPRequest();	var sURL = strDBPathUmfragenWeb + "/WebAjaxSaveUmfrage?OpenAgent&keysantworten=" + strKeysAntworten + "&sprache=" + strSprache;	var strPostdata = "textantworten=" + encodeURIComponent(strTextAntworten);	http_request.onreadystatechange = saveUmfrageReturn;	http_request.open('POST', sURL, true);	http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 	http_request.send(strPostdata);}function saveUmfrageReturn() {	var strResponse = "";	if (http_request.readyState == 4) {	     	if (http_request.status == 200) {				// Antwort der Ajax Abfrage         			strResponse = http_request.responseText;		}		else {//			alert('Fehler Status ungleich 200');		}	}	else {		// Antwort ist noch nicht vollst\u00E4ndig (Kein Fehler)//		alert('ReadyState ungleich 4');		return;	}	http_submit = false;	document.getElementById("confirm").style.display="none";	document.getElementById("confirmFrame").style.display="none";	if (strResponse == "") {		alert("Beim Speichern der Umfrage ist ein Fehler aufgetreten!");	} else {			var arrResponse = strResponse.split("###");		if (arrResponse.length == 2) {			document.getElementById("DivLoadUmfrage").innerHTML = arrResponse[1];		} else {			alert("Es ist ein Fehler aufgetreten:\n\n" + strResponse)		}	}}
