function zeit(){
	var datum = new Date();
	var Wochentag = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch","Donnerstag", "Freitag", "Samstag");
	var tag     = datum.getDate();
	var monat   = datum.getMonth() + 1;
	var jahr    = datum.getYear();
	if (jahr<1900) jahr = jahr + 1900;
	var stunde  = datum.getHours();
	var minute  = datum.getMinutes();
	var sekunde = datum.getSeconds();

	if (tag<10)     tag="0"+tag;
	if (monat<10)   monat="0"+monat;
	if (stunde<10)  stunde="0"+stunde;
	if (minute<10)  minute="0"+minute;
	if (sekunde<10) sekunde="0"+sekunde;

	if (document.getElementById("datum")) document.getElementById("datum").innerText   = Wochentag[datum.getDay()] + ", der " + (tag + "." + monat + "." + jahr);
	if (document.getElementById("uhrzeit")) document.getElementById("uhrzeit").innerText = (stunde + ":" + minute + ":" + sekunde) + " Uhr";

	window.status = Wochentag[datum.getDay()] + ", der " + (tag + "." + monat + "." + jahr) + " - " + (stunde + ":" + minute + ":" + sekunde);
}

/*Anzeige Statusleiste im Browser (Uhrzeit + Datum)*/
//var aufruf = window.setInterval("zeit()", 1000);




////////////////////////////////////////////////////////////
// getWinSize(window)
function getWinSize(win)
{
    if(!win) win = window;
    var s = new Object();
    if(typeof win.innerWidth != 'undefined')
    {
        s.width = win.innerWidth;
        s.height = win.innerHeight;
    }
    else
    {
         var obj = getBody(win);
         s.width = parseInt(obj.clientWidth);
         s.height = parseInt(obj.clientHeight);
    }

    return s;
}
////////////////////////////////////////////////////////////
// Der IE hat 2 verschiedene Objekte für den strict und quirks Mode.
function getBody(w)
{
    return (w.document.compatMode && w.document.compatMode == "CSS1Compat") ? w.document.documentElement : w.document.body || null;
}





function newWindowSuche (popupURL, width, height) {
	var new_window_objekt = getWinSize();
	pos_x = (new_window_objekt.width / 2) - (width / 2);
	pos_y = (new_window_objekt.height / 2) - (height / 2);
	Info = window.open(popupURL,"Info",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,width='+width+',height='+height+',top='+pos_y+',left='+pos_x+'');
	Info.focus();
}

function newWindow (popupURL, width, height) {
	Info = window.open(popupURL,"Info",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,width='+width+',height='+height+',top=80,left=80');
	Info.focus();
}

function newWindow2 (popupURL, width, height, name) {
	Info = window.open(popupURL,name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=no,width='+width+',height='+height+',top=80,left=80');
	Info.focus();
}

function SetFocus (elm) {
	if (document.forms[0].elements[elm]) {
		document.forms[0].elements[elm].focus();
	}
}


function LmOver(id1, clr, doCount, highlightColor) {
	if (doCount) {
		for (i=1; i<= doCount; i++) {
			color = rgbToHex(document.getElementById(id1+"_"+i).style.backgroundColor);
			if (color != highlightColor) {
				document.getElementById(id1+"_"+i).style.backgroundColor = clr;
			}
		}
	} else {
		document.getElementById(id1).style.backgroundColor = clr;
	}
}

function LmOut(id1, clr, doCount, highlightColor) {
	if (doCount) {
		for (i = 1; i<= doCount; i++) {
			color = rgbToHex(document.getElementById(id1+"_"+i).style.backgroundColor);
			if (color != highlightColor) {
				document.getElementById(id1+"_"+i).style.backgroundColor = clr;
			}
		}
	} else {
		document.getElementById(id1).style.backgroundColor = clr;
	}

}

function LmDown(id1, clr, doCount, highlightColor) {
	if (doCount) {
		for (i = 1; i<= doCount; i++) {
			color = rgbToHex(document.getElementById(id1+"_"+i).style.backgroundColor);
			if (color == highlightColor) {
				document.getElementById(id1+"_"+i).style.backgroundColor = clr;
			} else {
				document.getElementById(id1+"_"+i).style.backgroundColor = highlightColor;
			}
		}
	} else {
		document.getElementById(id1).style.backgroundColor = clr;
	}
}

var alleCookies;
var cookieArr;
var cookieLenght;
alleCookies=document.cookie;
cookieArr=alleCookies.split(";");
cookieLenght=cookieArr.length;

function SetzCookie (name, value) {
	expires="Sun, 04-Jan-2025 00:00:00 GMT";
	document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires : "");
}

function LeseCookie(Keksname) {

	for(var i=0;i<cookieLenght;i++) {
		key = cookieArr[i].split("=")[0];
		key  = key.replace (" ", "");
		if(key==Keksname) {
			cookieWert=cookieArr[i].split("=");
			cookieWert=unescape(cookieWert[1]);
			return cookieWert;
		}
	}
	return false;
}

function LeseCookie2(Keksname, myImage) {

	for(var i=0;i<cookieLenght;i++) {
		key = cookieArr[i].split("=")[0];
		key  = key.replace (" ", "");
		if(key==Keksname) {
			cookieWert=cookieArr[i].split("=");
			cookieWert=unescape(cookieWert[1]);

			if (cookieWert == "none") {
				document.getElementById(myImage).src = "modules/templates/workflow/bilder/plus.gif";
			} else {
				document.getElementById(myImage).src = "modules/templates/workflow/bilder/minus.gif";
			}

			return cookieWert;
		}
	}
	return false;
}

function showhideLayer (myElement) {
	if (document.getElementById(myElement).style.display=="block") {
		document.getElementById(myElement).style.visibility="hidden";
		document.getElementById(myElement).style.display="none";
		SetzCookie (document.getElementById(myElement).id, "none");
	} else {
		document.getElementById(myElement).style.visibility="visible";
		document.getElementById(myElement).style.display="block";
		SetzCookie (document.getElementById(myElement).id, "block");
	}
	LeseCookie(document.getElementById(myElement).id);
}

function showhideLayer2 (myElement, myImage) {
	if (document.getElementById(myElement).style.display=="block") {
		document.getElementById(myElement).style.visibility="hidden";
		document.getElementById(myElement).style.display="none";
		SetzCookie (document.getElementById(myElement).id, "none");
		document.getElementById(myImage).src = "modules/templates/workflow/bilder/plus.gif";
	} else {
		document.getElementById(myElement).style.visibility="visible";
		document.getElementById(myElement).style.display="block";
		SetzCookie (document.getElementById(myElement).id, "block");
		document.getElementById(myImage).src = "modules/templates/workflow/bilder/minus.gif";
	}
	LeseCookie(document.getElementById(myElement).id);
}