//##########################################################################################################################
//#																														   #
//#																														   #
//#	dbflexx 0.4, Dominique Bosselmann, (C) 2008-2009																       #
//#																														   #
//#																														   #
//##########################################################################################################################
function testajax () {
		var testobjekt = null;
		try {
			testobjekt = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(Error) {
			try {
				testobjekt = new ActiveXObject("MSXML2.XMLHTTP");
			}
			catch(Error) {
				try {
					testobjekt = new XMLHttpRequest();
				}
				catch(Error) {
					alert("Objekterzeugung fehlgeschlagen");
				}
			}
		}
		return testobjekt;
	}

var access = testajax();
var allrights = "";
var yourrights = "";
var prefnumber = "";
var texttonumber = new Array();
var numbertotext = new Array();
access.open('get', 'http://dievierte-gewalt.de/beta/scripts/useraccess.xml', true);
access.onreadystatechange = function () {
	if (access.readyState == 4) {
		allrights = access.responseXML;
		var useraccess = -1;
		var cookie = document.cookie;
		var i = 0;
		var logincookie = null;
		while (i < document.cookie.length) {
			if (document.cookie.substring(i, i + 6) == "Login=") {
				var ende = document.cookie.indexOf(";", i + 6);
				ende = (ende > -1) ? ende : document.cookie.length;
				logincookie = document.cookie.substring(i + 6, ende);
			}
			i++
		}
		if (logincookie != "") {
			var userid = logincookie.split("%3B")[0];
			var password = logincookie.split("%3B")[1];
			var authorisation = testajax();
			authorisation.open('get','http://dievierte-gewalt.de/beta/scripts/authorisation.php?u=' + userid + '&p=' + password, true);
			authorisation.onreadystatechange = function () {
				if (authorisation.readyState == 4) {
					document.getElementById("admintext").innerHTML = "Sie sind eigeloggt.";
					useraccess = authorisation.responseText;
					for (i = 0; i < allrights.getElementsByTagName("whichgroup").length; i++) {
						if (allrights.getElementsByTagName("whichgroup")[i].firstChild.data  == useraccess) {
							prefnumber = i;
							yourrights = allrights.getElementsByTagName("preferences")[i];
							break;
						}
					}
				}
			}
			authorisation.send(null);
		}
	}
}
access.send(null);


	
	
	
function benutzerrechte (link) {
	
	document.getElementById("dbflexxbenutzer").onclick = function () { artikelfensterzu(link); };
	document.getElementById("dbflexxbenutzerbackground").className = "taskbaractive";
	
	this.element = document.createElement("div");
    this.element.id = "artikelplus";
	this.element.className = "dbflexxcontainer";
	this.element.style.color = "#000000";
	this.element.style.fontFamily = "'Lucida Grande'";
	
	elementtabs = document.createElement("div");
	elementtabs.id = "dbflexxaccesstabcontainer";
	elementtabs.className = "dbflexxaccesstabcontainerinactive";
	
	firsttab = document.createElement("div");
	firsttab.id = "dbflexxaccessfirsttab";
	firsttab.className = "dbflexxtabinactive";
	firsttab.innerHTML = "Neue Benutzer";
	
	secondtab = document.createElement("div");
	secondtab.id = "dbflexxaccesssecondtab";
	secondtab.className = "dbflexxtabinactive";
	secondtab.innerHTML = "Benutzergruppen";
	
	thirdtab = document.createElement("div");
	thirdtab.id = "dbflexxaccessthirdtab";
	thirdtab.className = "dbflexxtabinactive";
	thirdtab.innerHTML = "Benutzer verwalten";
	
	breaktab = document.createElement("br");
	breaktab.style.clear = "both";
	
	content = document.createElement("div");
	content.id = "dbflexxaccesscontent";
	
	i = document.getElementById("content");
    i.parentNode.insertBefore(this.element, i);
	elementtabs.appendChild(firsttab);
	elementtabs.appendChild(secondtab);
	elementtabs.appendChild(thirdtab);
	elementtabs.appendChild(breaktab);
	this.element.appendChild(elementtabs);
	this.element.appendChild(content);
	globalstatusbar(this.element, "Benutzerrechte");
	
	
	//document.getElementById("dbflexxloader").style.visibility = "visible";
	//document.getElementById("dbflexxstatusleiste").innerHTML = "Identifiziere ...";
		
	
	
	
		newusers();
		firsttab.onclick = function () { newusers(); };
		secondtab.onclick = function () { usergroups(); };
		thirdtab.onclick = function () { useradministration(); };
		document.getElementById("dbflexxloader").style.visibility = "hidden";
		document.getElementById("dbflexxstatusleiste").innerHTML = "Fertig.";
		
	
	function newusers () {
		if (yourrights.getElementsByTagName("newusers")[0].getElementsByTagName("read")[0].firstChild.data == 1) {
					firsttab.className = "dbflexxtabactive";
					secondtab.className = "dbflexxtabinactive";
					thirdtab.className = "dbflexxtabinactive";
					elementtabs.className = "dbflexxaccesstabcontainerinactive";
					
					actionbar = document.createElement("div");
					actionbar.id = "dbflexxaccessactionbar";
					actionbar.className = "dbflexxactionbar";
					
					tablecontentcontainer = document.createElement("div");
					tablecontentcontainer.id = "dbflexxaccessnewcontentcontainer";
					
					content.innerHTML = "";
					content.appendChild(actionbar);
					content.appendChild(tablecontentcontainer);
					
					newusersrequest = testajax();
					newusersrequest.open('get', 'http://dievierte-gewalt.de/beta/scripts/useraccess.php?action=new', true);
					document.getElementById("dbflexxloader").style.visibility = "hidden";
					document.getElementById("dbflexxstatusleiste").innerHTML = "Lade neue Benutzer ...";
					newusersrequest.onreadystatechange = function () {
						if (newusersrequest.readyState == 4) {
							username = document.createElement("div");
							username.className = "dbflexxaccessnewkategories";
							username.style.width = "25%";
							realname = document.createElement("div");
							realname.className = "dbflexxaccessnewkategories";
							realname.style.width = "25%";
							mail = document.createElement("div");
							mail.className = "dbflexxaccessnewkategories";
							mail.style.width = "25%";
							dareg = document.createElement("div");
							dareg.className = "dbflexxaccessnewkategories";
							dareg.style.width = "25%";
							document.getElementById("dbflexxloader").style.visibility = "hidden";
							document.getElementById("dbflexxstatusleiste").innerHTML = "Fertig.";
							
							
							
							var newuser = newusersrequest.responseText.split(";");
							var newuserid = new Array();
							var tablecontent = new Array();
							var tablecontent2 = new Array();
							var tablecontent3 = new Array();
							var tablecontent4 = new Array();
							for (i = 0; i < newuser.length - 1; i++) {
								newusercontent = newuser[i].split("/");
								newuserid[i] = newusercontent[5];
								id1 = "dbflexxaccessnewcontent1u" + i;
								id2 = "dbflexxaccessnewcontent2u" + i;
								id3 = "dbflexxaccessnewcontent3u" + i;
								id4 = "dbflexxaccessnewcontent4u" + i;
								tablecontent[i] = document.createElement("div");
								tablecontent[i].id = "dbflexxaccessnewcontent1u" + i;
								tablecontent[i].innerHTML = newusercontent[3]; 
								tablecontent[i].onclick = function () { highlightline(this.id,newuser.length); };
								
								tablecontent2[i] = document.createElement("div");
								tablecontent2[i].id = "dbflexxaccessnewcontent2u" + i;
								tablecontent2[i].innerHTML = newusercontent[0] + " " + newusercontent[1];
								tablecontent2[i].onclick = function () { highlightline(this.id,newuser.length); };
								
								tablecontent3[i] = document.createElement("div");
								tablecontent3[i].id = "dbflexxaccessnewcontent3u" + i;
								tablecontent3[i].innerHTML = newusercontent[2];
								tablecontent3[i].onclick = function () { highlightline(this.id,newuser.length); };
								
								tablecontent4[i] = document.createElement("div");
								tablecontent4[i].id = "dbflexxaccessnewcontent4u" + i;
								tablecontent4[i].innerHTML = newusercontent[4];
								tablecontent4[i].onclick = function () { highlightline(this.id,newuser.length); };
								
								username.appendChild(tablecontent[i]);
								realname.appendChild(tablecontent2[i]);
								mail.appendChild(tablecontent3[i]);
								dareg.appendChild(tablecontent4[i]);
							}
							tablecontentcontainer.appendChild(username);
							tablecontentcontainer.appendChild(realname);
							tablecontentcontainer.appendChild(mail);
							tablecontentcontainer.appendChild(dareg);
							
							titlecontainer = document.createElement("div");
							titlecontainer.style.background = "#D2D2D2";
							titlecontainer.style.paddingLeft = "8px";
							
							tabletitle = document.createElement("div");
							tabletitle.id = "dbflexxaccessnewtitle";
							tabletitle.className = "dbflexxaccessnewtitle";								
							tabletitle.innerHTML = "Benutzername";
							tabletitle.style.width = username.offsetWidth + "px";
							
							tabletitle2 = document.createElement("div");
							tabletitle2.id = "dbflexxaccessnewtitle2";
							tabletitle2.className = "dbflexxaccessnewtitle";								
							tabletitle2.innerHTML = "Echter Name";
							tabletitle2.style.width = username.offsetWidth + "px";
							
							tabletitle3 = document.createElement("div");
							tabletitle3.id = "dbflexxaccessnewtitle3";
							tabletitle3.className = "dbflexxaccessnewtitle";								
							tabletitle3.innerHTML = "E-Mail";
							tabletitle3.style.width = username.offsetWidth + "px";
							
							tabletitle4 = document.createElement("div");
							tabletitle4.id = "dbflexxaccessnewtitle4";
							tabletitle4.className = "dbflexxaccessnewtitle";								
							tabletitle4.innerHTML = "Registrierungsdatum";
							tabletitle4.style.width = username.offsetWidth + "px";
							
							tablebreak = document.createElement("br");
							tablebreak.style.clear = "both";
							
							titlecontainer.appendChild(tabletitle);
							titlecontainer.appendChild(tabletitle2);
							titlecontainer.appendChild(tabletitle3);
							titlecontainer.appendChild(tabletitle4);
							titlecontainer.appendChild(tablebreak);
							content.insertBefore(titlecontainer,tablecontentcontainer);
							
							function setactionbar (whichElement,nodeid) {
								grouplabel = document.createElement("div");
								grouplabel.id = "dbflexxaccessnewgrouplabel";
								grouplabel.innerHTML = "Hinzufügen zu:";
								
								group = document.createElement("select");
								group.style.cssFloat = "left";
								group.id = "dbflexxaccessnewgroupselector";
								
								groupoption = new Array();
								groupoption[0] = document.createElement("option");
								groupoption[0].innerHTML = "Bitte wählen";
								groupoption[0].value = "-2";
								
								yesbutton = document.createElement("div");
								yesbutton.className = "dbflexxactionbarbutton";
								yesbutton.id = "dbflexxaccessnewyes";
								
								yesbuttonimage = document.createElement("img");
								yesbuttonimage.src = "http://graphic.co2-filter.com/seite/dbflexxyes.png";
								yesbuttonimage.onclick = function () {
									if (yourrights.getElementsByTagName("newusers")[0].getElementsByTagName("edit")[0].firstChild.data != 1)
										adderror("Benutzergruppe konnte nicht zugewiesen werden: Zugriff verweigert.");
									else {
										if (document.getElementById("dbflexxaccessnewgroupselector").options[document.getElementById("dbflexxaccessnewgroupselector").selectedIndex].value == -2) {
											adderror("Keine Benutzergruppe ausgewählt.");
										}
									
										else {
											var verfiynewuser = testajax();
											verfiynewuser.open('get', 'http://dievierte-gewalt.de/beta/scripts/useraccess.php?action=verify&id=' + whichElement + '&wa=' + document.getElementById("dbflexxaccessnewgroupselector").options[document.getElementById("dbflexxaccessnewgroupselector").selectedIndex].value, true);
											document.getElementById("dbflexxloader").style.visibility = "visible";
											document.getElementById("dbflexxstatusleiste").innerHTML = "Weise Benutzergruppe zu ...";
											verfiynewuser.onreadystatechange = function () {
												if (verfiynewuser.readyState == 4) {
													var verfiynewuserrespond = verfiynewuser.responseText;
													document.getElementById("dbflexxloader").style.visibility = "hidden";
													document.getElementById("dbflexxstatusleiste").innerHTML = "Fertig";
												}
											}
											verfiynewuser.send(null);
											delteid1 = "dbflexxaccessnewcontent1u" + nodeid;
											delteid2 = "dbflexxaccessnewcontent2u" + nodeid;
											delteid3 = "dbflexxaccessnewcontent3u" + nodeid;
											delteid4 = "dbflexxaccessnewcontent4u" + nodeid; 
											document.getElementById(delteid1).parentNode.removeChild(document.getElementById(delteid1));
											document.getElementById(delteid2).parentNode.removeChild(document.getElementById(delteid2));
											document.getElementById(delteid3).parentNode.removeChild(document.getElementById(delteid3));
											document.getElementById(delteid4).parentNode.removeChild(document.getElementById(delteid4));
										}
									}
								}
								
								nobutton = document.createElement("div");
								nobutton.className = "dbflexxactionbarbutton";
								nobutton.id = "dbflexxaccessnewno"; 
								
								nobuttonimage = document.createElement("img");
								nobuttonimage.src = "http://graphic.co2-filter.com/seite/dbflexxno.png";
								nobuttonimage.onclick = function () {
									if (yourrights.getElementsByTagName("newusers")[0].getElementsByTagName("edit")[0].firstChild.data != 1)
										adderror("Benutzergruppe konnte nicht zugewiesen werden: Zugriff verweigert.");
									else {
										var verfiynewuser = testajax();
										verfiynewuser.open('get', 'http://dievierte-gewalt.de/beta/scripts/useraccess.php?action=verify&id=' + whichElement + '&wa=-1', true);
										document.getElementById("dbflexxloader").style.visibility = "visible";
										document.getElementById("dbflexxstatusleiste").innerHTML = "Weise Benutzergruppe zu ...";
										verfiynewuser.onreadystatechange = function () {
											if (verfiynewuser.readyState == 4) {
												var verfiynewuserrespond = verfiynewuser.responseText;
												document.getElementById("dbflexxloader").style.visibility = "hidden";
												document.getElementById("dbflexxstatusleiste").innerHTML = "Fertig.";
											}
										}
										verfiynewuser.send(null);
									}
								}
																
								group.appendChild(groupoption[0]);
								yesbutton.appendChild(yesbuttonimage);
								nobutton.appendChild(nobuttonimage);
								document.getElementById("dbflexxaccessactionbar").innerHTML = "";
								document.getElementById("dbflexxaccessactionbar").appendChild(grouplabel);
								document.getElementById("dbflexxaccessactionbar").appendChild(group);
								document.getElementById("dbflexxaccessactionbar").appendChild(yesbutton);
								document.getElementById("dbflexxaccessactionbar").appendChild(nobutton);
								
								var usergroups = testajax();
								usergroups.open('get', 'http://dievierte-gewalt.de/beta/scripts/usergroups.txt', true);
								document.getElementById("dbflexxloader").style.visibility = "visible";
								document.getElementById("dbflexxstatusleiste").innerHTML = "Lade Benutzergruppen ...";
								usergroups.onreadystatechange = function () {
									if (usergroups.readyState == 4) {
										var usergroup = usergroups.responseText.split(";");
										for (i = 1; i < usergroup.length; i++) {
											var groupcontent = usergroup[i - 1].split(",");
											groupoption[i] = document.createElement("option");
											groupoption[i].innerHTML = groupcontent[0];
											groupoption[i].value = groupcontent[1];
											group.appendChild(groupoption[i]);
										}
										document.getElementById("dbflexxloader").style.visibility = "hidden";
										document.getElementById("dbflexxstatusleiste").innerHTML = "Fertig.";
									}
								}
								usergroups.send(null);
							}
							
							function highlightline (whichid,forlength) {
								
								number = whichid.substr(25);
								input1 = "dbflexxaccessnewcontent1u" + number;
								input2 = "dbflexxaccessnewcontent2u" + number;
								input3 = "dbflexxaccessnewcontent3u" + number;
								input4 = "dbflexxaccessnewcontent4u" + number;
								for (i = 0; i < forlength - 1; i++) {
									inputid1 = "dbflexxaccessnewcontent1u" + i;
									inputid2 = "dbflexxaccessnewcontent2u" + i;
									inputid3 = "dbflexxaccessnewcontent3u" + i;
									inputid4 = "dbflexxaccessnewcontent4u" + i;
									document.getElementById(inputid1).style.background = "none";
									document.getElementById(inputid2).style.background = "none";
									document.getElementById(inputid3).style.background = "none";
									document.getElementById(inputid4).style.background = "none";
								}
								document.getElementById(input1).style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)";
								document.getElementById(input2).style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)";
								document.getElementById(input3).style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)";
								document.getElementById(input4).style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)";
								setactionbar(newuserid[number],number);
							}
						}
					}
					newusersrequest.send(null);
				}
		else {
			content.innerHTML = "Zugriff verweigert.";
		}
	}
				
				function usergroups () {
					if (yourrights.getElementsByTagName("administrateusergroups")[0].getElementsByTagName("read")[0].firstChild.data != 1)
						content.innerHTML = "Zugriff verweigert";
					else {
					
					function regetxml (whereFrom) {
						access = testajax();
						allrights = "";
						yourrights = "";
						access.open('get', 'http://dievierte-gewalt.de/beta/scripts/useraccess.xml', true);
						addloader("Aktualisiere Benutzerrechte ...");
						access.onreadystatechange = function () {
							if (access.readyState == 4) {
								stoploader();
								addloader("Aktualisiere Benutzergruppen ...");
								allrights = access.responseXML;
								yourrights = allrights.getElementsByTagName("preferences")[prefnumber];
										
								groupsajax = testajax();
								groupsajax.open('get', 'http://dievierte-gewalt.de/beta/scripts/usergroups.txt', true);
								addloader("Lade Benutzergruppen ...");
								groupsajax.onreadystatechange = function () {
									if (groupsajax.readyState == 4) {
										stoploader();
										var usergroup = groupsajax.responseText.split(";");
										for (i = 0; i < usergroup.length; i++) {
											groups.removeChild(groupscontent[i]);
											var groupcontent = usergroup[i].split(",");
											groupscontent[i] = document.createElement("div");
											groupscontent[i].id = "dbflexxaccessgroupsidecontent" + i;
											groupscontent[i].className = "dbflexxsidebarcontent";
											groupscontent[i].innerHTML = groupcontent[0];
											groupscontent[i].onclick = function () { 
												for (j = 0; j < this.parentNode.childNodes.length; j++) { 
													this.parentNode.childNodes[j].style.background = "none"; 
												}
												this.style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)"; 
												deletegroup(texttonumber[this.innerHTML]);
											};
											texttonumber[groupcontent[0]] = groupcontent[1];
											numbertotext[groupcontent[1]] = groupcontent[0];
											groups.appendChild(groupscontent[i]);
										}
										stoploader();
										if(whereFrom == "addgroup") {
											addgroup();
											groupcontent.innerHTML = "Keine Benutzergruppe ausgewählt.";
										}
											
									}
								}
								groupsajax.send(null);
							}
						}
						access.send(null);
					}


					var initedit = false;
					var groupadd = false;
					var initdelete = false;
					firsttab.className = "dbflexxtabinactive";
					secondtab.className = "dbflexxtabactive";
					thirdtab.className = "dbflexxtabinactive";
					elementtabs.className = "dbflexxaccesstabcontainerinactive";
					content.innerHTML = "";
					
					actionbar = document.createElement("div");
					actionbar.id = "dbflexxaccessactionbar";
					actionbar.className = "dbflexxactionbar";
					actionbar.style.marginBottom = "0px";
					
					groups = document.createElement("div");
					groups.id = "dbflexxaccessgroupssidebar";
					groups.className = "dbflexxsidebar";
					groups.style.width = parseInt(content.offsetWidth)  / 5 + "px";
					groups.style.height = "400px";
					
					groupscontent = new Array();
					
					groupsajax = testajax();
					groupsajax.open('get', 'http://dievierte-gewalt.de/beta/scripts/usergroups.txt', true);
					addloader("Lade Benutzergruppen ...");
					groupsajax.onreadystatechange = function () {
						if (groupsajax.readyState == 4) {
							var usergroup = groupsajax.responseText.split(";");
							for (i = 0; i < usergroup.length; i++) {
								var groupcontent = usergroup[i].split(",");
								groupscontent[i] = document.createElement("div");
								groupscontent[i].id = "dbflexxaccessgroupsidecontent" + i;
								groupscontent[i].className = "dbflexxsidebarcontent";
								groupscontent[i].innerHTML = groupcontent[0];
								groupscontent[i].onclick = function () { 
									for (j = 0; j < this.parentNode.childNodes.length; j++) { 
										this.parentNode.childNodes[j].style.background = "none"; 
									}
									this.style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)"; 
									deletegroup(texttonumber[this.innerHTML]);
								};
								groups.appendChild(groupscontent[i]);
								texttonumber[groupcontent[0]] = groupcontent[1];
								numbertotext[groupcontent[1]] = groupcontent[0];
							}
							stoploader();
								
						}
					}
					groupsajax.send(null);
					
					groupcontent = document.createElement("div");
					groupcontent.id = "dbflexxaccessgroupcontent";
					groupcontent.innerHTML = "Keine Benutzergruppe ausgewählt.";
					groupcontent.style.height = "400px";
					groupcontent.style.overflow = "auto";
					
					content.appendChild(actionbar);
					content.appendChild(groups);
					content.appendChild(groupcontent);
					
					adddiv = document.createElement("div");
					adddiv.id = "dbflexxaccessgroupactiondivadd";
					adddiv.className = "dbflexxactionbarbutton";
					
					addimg = document.createElement("img");
					addimg.src = "http://graphic.co2-filter.com/seite/dbflexxadd20.png";
					addimg.onclick = addgroup;
					
					editdiv = document.createElement("div");
					editdiv.id = "dbflexxaccessgroupactiondivedit";
					editdiv.className = "dbflexxactionbarbutton";
					
					editimg = document.createElement("img");
					editimg.src = "http://graphic.co2-filter.com/seite/dbflexxedit20.png";
					editimg.onclick = enableedit;
					
					deletediv = document.createElement("div");
					deletediv.id = "dbflexxaccessgroupactiondivdelete";
					deletediv.className = "dbflexxactionbarbutton";
					
					deleteimg = document.createElement("img");
					deleteimg.src = "http://graphic.co2-filter.com/seite/dbflexxminus20.png";
					deleteimg.onclick = enabledelete;
					
					articlespan = document.createElement("div");
					articlespan.className = "dbflexxtitle";
					articlespan.innerHTML = "Artikel";
					
					actionbar.appendChild(adddiv);
					adddiv.appendChild(addimg);
					actionbar.appendChild(editdiv);
					editdiv.appendChild(editimg);
					actionbar.appendChild(deletediv);
					deletediv.appendChild(deleteimg);
					
					function enabledelete () {
						
						initdelete = true;
						if (document.getElementById("dbflexxaccessgroupactioncontainer") != null) {
							actionbar.removeChild(document.getElementById("dbflexxaccessgroupactioncontainer"));
						}
						if (groupadd == true) {
							addgroup();
						}
						groupcontent.innerHTML = "Bitte wählen Sie die zu löschende Benutzergruppe aus.";
						for (i = 0; i < groups.childNodes.length; i++) {
							groups.childNodes[i].style.background = "none";
						}
						unableedit();
						deletediv.className = "dbflexxactionbarbuttonactive";
						deleteimg.onclick = unabledelete;
					}
					
					function unabledelete () {
						initdelete = false;
						deletediv.className = "dbflexxactionbarbutton";
						deleteimg.onclick = enabledelete;
						groupcontent.innerHTML = "Keine Benutzergruppe ausgewählt.";
					}
					
					function enableedit () {
						initedit = true;
						if (document.getElementById("dbflexxaccessgroupactioncontainer") != null) {
							actionbar.removeChild(document.getElementById("dbflexxaccessgroupactioncontainer"));
						}
						if (groupadd == true) {
							addgroup();
						}
						unabledelete();
						editdiv.className = "dbflexxactionbarbuttonactive";
						editimg.onclick = unableedit;
					}
					
					function unableedit () {
						initedit = false;
						editdiv.className = "dbflexxactionbarbutton";
						editimg.onclick = enableedit;
					}
					
					function getNumberFromText (text) {
						switch (text) {
							case "nein": return "0"; break;
							case "ja": return "1"; break;
							case "direkte Bestätigung": return "2"; break;
							case "hierarchische Bestätigung": return "3"; break;
							case "abhängig von Einstellung": return "4"; break;
							case "-": return "-1"; break;
						}
					}
					
					function deletegroup (step) {
						if (initdelete == true) {
							var usergroupamount = testajax();
							usergroupamount.open("get", "http://dievierte-gewalt.de/beta/scripts/useraccess.php?action=groupamount&s=" + step);
							addloader("Lade Benutzeranzahl ...");
							usergroupamount.onreadystatechange = function () {
								if (usergroupamount.readyState == 4) {
									stoploader();
									if (usergroupamount.responseText != 0) {
										actioncontainer = document.createElement("div");
										actioncontainer.id = "dbflexxaccessgroupactioncontainer";
										
										actionseperator = document.createElement("div");
										actionseperator.className = "befehlsleistetrenner";
										
										amountnumber = document.createElement("span");
										amountnumber.innerHTML = usergroupamount.responseText == 1 ? usergroupamount.responseText + " Betroffenen Benutzer verschieben zu: " : usergroupamount.responseText + " Betroffene Benutzer verschieben zu: ";
										amountnumber.style.cssFloat = "left";
										
										if (document.getElementById("dbflexxaccessgroupactioncontainer") != null) {
											actionbar.removeChild(document.getElementById("dbflexxaccessgroupactioncontainer"));
										}
										
										groupselect = document.createElement("select");
										groupselect.style.cssFloat = "left";
										
										var usergroups = testajax();
										var usergroup = "";
										var groupoption = new Array();
										groupoption[0] = document.createElement("option");
										groupoption[0].innerHTML = "Bitte wählen.";
										groupoption[0].value = "-2";
										groupselect.appendChild(groupoption[0]);
										usergroups.open('get', 'http://dievierte-gewalt.de/beta/scripts/usergroups.txt', true);
										addloader("Lade Benutzergruppen ...");
										usergroups.onreadystatechange = function () {
											if (usergroups.readyState == 4) {
												stoploader();
												usergroup = usergroups.responseText.split(";");
												for (i = 1; i <= usergroup.length; i++) {
													var groupcontent = usergroup[i - 1].split(",");
													if (groupcontent[1] != step) {
														groupoption[i] = document.createElement("option");
														groupoption[i].innerHTML = groupcontent[0];
														groupoption[i].value = groupcontent[1];
														groupselect.appendChild(groupoption[i]);
													}
												}
												groupoption[i] = document.createElement("option");
												groupoption[i].innerHTML = "Löschen";
												groupoption[i].value = "-3";
												groupselect.appendChild(groupoption[i]);
												stoploader();
											}
										}
										usergroups.send(null);
										
										actioncontainer.appendChild(actionseperator);
										actioncontainer.appendChild(actionseperator);
										actioncontainer.appendChild(amountnumber);
										
										
										
										yesbutton = document.createElement("div");
										yesbutton.className = "dbflexxactionbarbutton";
										yesbutton.id = "dbflexxaccessnewyes";
										
										yesbuttonimage = document.createElement("img");
										yesbuttonimage.src = "http://graphic.co2-filter.com/seite/dbflexxyes.png";
										yesbuttonimage.onclick = function () { 
											if (groupselect.options[groupselect.selectedIndex].value == "-2") {
												adderror("Keine Benutzergruppe ausgewählt.");
											}
											
											else if (groupselect.options[groupselect.selectedIndex].value == "-3") {
												deleteuserajax = testajax();
												addloader("Lösche Benutzer ...");
												deleteuserajax.open("get", "http://dievierte-gewalt.de/beta/scripts/useraccess.php?action=deleteonly&o=" + step);
												deleteuserajax.onreadystatechange = function () {
													if (deleteuserajax.readyState == 4) {
														stoploader();
														if (deleteuserajax.responseText != "") {
															if (usergroupamount.responseText == 1) {
																adderror("Benutzer konnte nicht gelöscht werden: " + deleteuserajax.responseText);
															}
															else {
																adderror("Benutzer konnten nicht gelöscht werden: " + deleteuserajax.responseText);
															}
														}
														else {
															deletefinally(step);
														}
													}
												}
												deleteuserajax.send(null);
											}
												
											else {
												moveuserajax = testajax();
												addloader("Weise neue Benutzergruppe zu ...");
												moveuserajax.open("get", "http://dievierte-gewalt.de/beta/scripts/useraccess.php?action=moveanddelete&i=" + groupselect.options[groupselect.selectedIndex].value + "&o=" + step);
												moveuserajax.onreadystatechange = function () {
													if (moveuserajax.readyState == 4) {
														stoploader();
														if (moveuserajax.responseText != "") {
															adderror("Benutzergruppe konnte nicht gelöscht werden: " + moveuserajax.responseText);
														}
														else {
															deletefinally(step);
														}
													}
												}
												moveuserajax.send(null);
											}
										}
										
										yesbutton.appendChild(yesbuttonimage);
										actioncontainer.appendChild(groupselect);
										actioncontainer.appendChild(yesbutton);
										
										actionbar.appendChild(actioncontainer);
									}
									else {
										deletefinally(step);
									}
								}
							}
							usergroupamount.send(null);
						}
						else {
							readrights(step);
						}
							
					}
					
					function deletefinally (step) {
						var deleteajax = testajax();
						addloader("Lösche Benutzergruppe ...");
						deleteajax.open("get", "http://dievierte-gewalt.de/beta/scripts/useraccess.php?action=delete&s=" + step);
						deleteajax.onreadystatechange = function () {
							if (deleteajax.readyState == 4) {
								stoploader();
								for (i = 0; i < groups.childNodes.length; i++) {
									if (numbertotext[step] == groups.childNodes[i].innerHTML) {
										groups.removeChild(groups.childNodes[i]);
										break;
									}
								}
							}
						}
						deleteajax.send(null);
						if (document.getElementById("dbflexxaccessgroupactioncontainer") != null) {
							actionbar.removeChild(document.getElementById("dbflexxaccessgroupactioncontainer"));
						}
						
					}
								
					
					function sendnewgrouptoserver (name) {
						var poststring = "";
						for (j = 0; j < 12; j++) {
							var localpoststring;
							switch (j) {
								case 0 : localpoststring = "article="; break;
								case 1 : localpoststring = "nonpublished="; break;
								case 2 : localpoststring = "comments="; break;
								case 3 : localpoststring = "polls="; break;
								case 4 : localpoststring = "gallery="; break;
								case 5 : localpoststring = "bulletin="; break;
								case 6 : localpoststring = "guestbook="; break;
								case 7 : localpoststring = "special="; break;
								case 8 : localpoststring = "globalpreferences="; break;
								case 9 : localpoststring = "todos="; break;
								case 10 : localpoststring = "newpages="; break;
								case 11 : localpoststring = "archive="; break;
								default: localpoststring = "none";
							}
							var node = "dbflexxaccessgroupcontentdiv" + j;
							for (i = 0; i < document.getElementById(node).childNodes.length; i++) {
								if (document.getElementById(node).childNodes[i].id.search("dbflexxaccessgroupcontentspan") != -1) {
									if (i != 1) {
										localpoststring += ",";
									}
									if (document.getElementById(node).childNodes[i].tagName.toLowerCase() == "select") {
										localpoststring += getNumberFromText(document.getElementById(node).childNodes[i].options[document.getElementById(node).childNodes[i].selectedIndex].text);
									}
									else {
										localpoststring += getNumberFromText(document.getElementById(node).childNodes[i].innerHTML);
									}
									
									
								}
							}
							if (j != 11)
								poststring += localpoststring + "&";
								
							else
								poststring += localpoststring;
						}
						poststring += "&name=" + name;
						sendnewgroupajax = testajax();
						sendnewgroupajax.open("POST", "http://dievierte-gewalt.de/beta/scripts/useraccess.php?action=newgroup");
						addloader("Speichere neue Gruppe ...");
						sendnewgroupajax.onreadystatechange = function () {
							if (sendnewgroupajax.readyState == 4) {
								stoploader();
								if (sendnewgroupajax.responseText == "") {
									regetxml("addgroup");
								}
								else {
									adderror(sendnewgroupajax.responseText);
								}
							}
						}
						
						sendnewgroupajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
						sendnewgroupajax.send(poststring);
						
					}
					
					function addgroupfinally (ereignis) {
								ereignis = ereignis ? ereignis : window.event;
								if (ereignis.which == 13 || ereignis.keyCode == 13) {
									
									var groupname = this.value;
									
									this.blur();
									
									groupcontent.innerHTML = ""; 
									
									contentdiv = new Array();
									
									
									unpublishedspan = document.createElement("div");
									unpublishedspan.className = "dbflexxtitle";
									unpublishedspan.innerHTML = "Unveröffentlichtes";
									
									commentsspan = document.createElement("div");
									commentsspan.className = "dbflexxtitle";
									commentsspan.innerHTML = "Kommentare";
									
									pollsspan = document.createElement("div");
									pollsspan.className = "dbflexxtitle";
									pollsspan.innerHTML = "Umfragen";
									
									galleryspan = document.createElement("div");
									galleryspan.className = "dbflexxtitle";
									galleryspan.innerHTML = "Gallerie";
									
									bulletinspan = document.createElement("div");
									bulletinspan.className = "dbflexxtitle";
									bulletinspan.innerHTML = "Forum";
									
									guestbookspan = document.createElement("div");
									guestbookspan.className = "dbflexxtitle";
									guestbookspan.innerHTML = "Gästebuch";
									
									accessspan = document.createElement("div");
									accessspan.className = "dbflexxtitle";
									accessspan.innerHTML = "Benutzerrechte";
									
									preferencesspan = document.createElement("div");
									preferencesspan.className = "dbflexxtitle";
									preferencesspan.innerHTML = "systemweite Einstellungen";
									
									todosspan = document.createElement("div");
									todosspan.className = "dbflexxtitle";
									todosspan.innerHTML = "ToDos";
									
									newpagesspan = document.createElement("div");
									newpagesspan.className = "dbflexxtitle";
									newpagesspan.innerHTML = "Seitenstruktur";
									
									archievespan = document.createElement("div");
									archievespan.className = "dbflexxtitle";
									archievespan.innerHTML = "Archiv";
									
									for (i = 0; i < 12; i++) {
										contentdiv[i] = document.createElement("div");
										contentdiv[i].id = "dbflexxaccessgroupcontentdiv" + i;
										contentdiv[i].style.paddingLeft = "16px";
									}
									
									var contentspan = new Array();
									var contentoption = new Array(); 
									j = 0;
									z = 0;
									
									for (i = 0; i < 157; i++) {
										if (i == 18 || i == 25 || i == 30 || i == 35 || i == 40 || i == 63 || i == 68 || i == 73 || i == 78 || i == 80 || i == 119 || i == 120 || i == 124 || i == 125 || i == 129 || i == 130 || i == 135 || i == 136 || i == 139 || i == 144 || i == 147 || i == 154 || i == 155) {
											contentspan[i] = document.createElement("span");
											contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
											contentspan[i].innerHTML = "-";
										}
										
										
										else {
											contentoption[i] = new Array();
											contentspan[i] = document.createElement("select");
											contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
											
											for (x = 0; x < 5; x++) {
												contentoption[i][x] = document.createElement("option");
											}
											contentoption[i][0].value = 0;
											contentoption[i][0].innerHTML = "nein";
											contentoption[i][1].value = 1;
											contentoption[i][1].innerHTML = "ja";
											contentoption[i][2].value = 2;
											contentoption[i][2].innerHTML = "direkte Bestätigung";
											contentoption[i][3].value = 3;
											contentoption[i][3].innerHTML = "hierarchische Bestätigung";
											contentoption[i][4].value = 4;
											contentoption[i][4].innerHTML = "abhängig von Einstellung";
											
											for (x = 0; x < 5; x++) {
												contentspan[i].appendChild(contentoption[i][x]);
											}
										}
											
										if (j >= 4) {
											j = 0;
											z++;
										}
										else {
											j++;
										}
									}
																	
									
									titlespan = new Array();
						
									for (i = 0; i < 157 ; i++) {
										titlespan[i] = document.createElement("span");
									}
									titlespan[0].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
									titlespan[1].innerHTML = "<br />Bearbeiten: ";
									titlespan[2].innerHTML = "<br />Veröffentlichen: ";
									titlespan[3].innerHTML = "<br />Schreiben: ";
									titlespan[4].innerHTML = "<br />Löschen: ";
									titlespan[5].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
									titlespan[6].innerHTML = "<br />Bearbeiten: ";
									titlespan[7].innerHTML = "<br />Veröffentlichen: ";
									titlespan[8].innerHTML = "<br />Schreiben: ";
									titlespan[9].innerHTML = "<br />Löschen: ";
									titlespan[10].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Artikel</strong></p>Lesen: ";
									titlespan[11].innerHTML = "<br />Bearbeiten: ";
									titlespan[12].innerHTML = "<br />Veröffentlichen: ";
									titlespan[13].innerHTML = "<br />Schreiben: ";
									titlespan[14].innerHTML = "<br />Löschen: ";
									titlespan[15].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Artikel</strong></p>Lesen: ";
									titlespan[16].innerHTML = "<br />Bearbeiten: ";
									titlespan[17].innerHTML = "<br />Veröffentlichen: ";
									titlespan[18].innerHTML = "<br />Schreiben: ";
									titlespan[19].innerHTML = "<br />Löschen: ";
									titlespan[20].innerHTML = "<p class='dbflexxptitle'><strong>Sonstiges</strong></p>Artikel verschieben: ";
									titlespan[21].innerHTML = "<br />Artikel kopieren: ";
									titlespan[22].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
									titlespan[23].innerHTML = "<br />Bearbeiten: ";
									titlespan[24].innerHTML = "<br />Veröffentlichen: ";
									titlespan[25].innerHTML = "<br />Schreiben: ";
									titlespan[26].innerHTML = "<br />Löschen: ";
									titlespan[27].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
									titlespan[28].innerHTML = "<br />Bearbeiten: ";
									titlespan[29].innerHTML = "<br />Veröffentlichen: ";
									titlespan[30].innerHTML = "<br />Schreiben: ";
									titlespan[31].innerHTML = "<br />Löschen: ";
									titlespan[32].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Artikel</strong></p>Lesen: ";
									titlespan[33].innerHTML = "<br />Bearbeiten: ";
									titlespan[34].innerHTML = "<br />Veröffentlichen: ";
									titlespan[35].innerHTML = "<br />Schreiben: ";
									titlespan[36].innerHTML = "<br />Löschen: ";
									titlespan[37].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Artikel</strong></p>Lesen: ";
									titlespan[38].innerHTML = "<br />Bearbeiten: ";
									titlespan[39].innerHTML = "<br />Veröffentlichen: ";
									titlespan[40].innerHTML = "<br />Schreiben: ";
									titlespan[41].innerHTML = "<br />Löschen: ";
									titlespan[42].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
									titlespan[43].innerHTML = "<br />Bearbeiten: ";
									titlespan[44].innerHTML = "<br />Veröffentlichen: ";
									titlespan[45].innerHTML = "<br />Schreiben: ";
									titlespan[46].innerHTML = "<br />Löschen: ";
									titlespan[47].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
									titlespan[48].innerHTML = "<br />Bearbeiten: ";
									titlespan[49].innerHTML = "<br />Veröffentlichen: ";
									titlespan[50].innerHTML = "<br />Schreiben: ";
									titlespan[51].innerHTML = "<br />Löschen: ";
									titlespan[52].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Artikel</strong></p>Lesen: ";
									titlespan[53].innerHTML = "<br />Bearbeiten: ";
									titlespan[54].innerHTML = "<br />Veröffentlichen: ";
									titlespan[55].innerHTML = "<br />Schreiben: ";
									titlespan[56].innerHTML = "<br />Löschen: ";
									titlespan[57].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Artikel</strong></p>Lesen: ";
									titlespan[58].innerHTML = "<br />Bearbeiten: ";
									titlespan[59].innerHTML = "<br />Veröffentlichen: ";
									titlespan[60].innerHTML = "<br />Schreiben: ";
									titlespan[61].innerHTML = "<br />Löschen: ";
									titlespan[62].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
									titlespan[63].innerHTML = "<br />Bearbeiten: ";
									titlespan[64].innerHTML = "<br />Veröffentlichen: ";
									titlespan[65].innerHTML = "<br />Schreiben: ";
									titlespan[66].innerHTML = "<br />Löschen: ";
									titlespan[67].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
									titlespan[68].innerHTML = "<br />Bearbeiten: ";
									titlespan[69].innerHTML = "<br />Veröffentlichen: ";
									titlespan[70].innerHTML = "<br />Schreiben: ";
									titlespan[71].innerHTML = "<br />Löschen: ";
									titlespan[72].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Umfragen</strong></p>Lesen: ";
									titlespan[73].innerHTML = "<br />Bearbeiten: ";
									titlespan[74].innerHTML = "<br />Veröffentlichen: ";
									titlespan[75].innerHTML = "<br />Schreiben: ";
									titlespan[76].innerHTML = "<br />Löschen: ";
									titlespan[77].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Umfragen</strong></p>Lesen: ";
									titlespan[78].innerHTML = "<br />Bearbeiten: ";
									titlespan[79].innerHTML = "<br />Veröffentlichen: ";
									titlespan[80].innerHTML = "<br />Schreiben: ";
									titlespan[81].innerHTML = "<br />Löschen: ";
									titlespan[82].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
									titlespan[83].innerHTML = "<br />Bearbeiten: ";
									titlespan[84].innerHTML = "<br />Veröffentlichen: ";
									titlespan[85].innerHTML = "<br />Schreiben: ";
									titlespan[86].innerHTML = "<br />Löschen: ";
									titlespan[87].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
									titlespan[88].innerHTML = "<br />Bearbeiten: ";
									titlespan[89].innerHTML = "<br />Veröffentlichen: ";
									titlespan[90].innerHTML = "<br />Schreiben: ";
									titlespan[91].innerHTML = "<br />Löschen: ";
									titlespan[92].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Beiträge</strong></p>Lesen: ";
									titlespan[93].innerHTML = "<br />Bearbeiten: ";
									titlespan[94].innerHTML = "<br />Veröffentlichen: ";
									titlespan[95].innerHTML = "<br />Schreiben: ";
									titlespan[96].innerHTML = "<br />Löschen: ";
									titlespan[97].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Beiträge</strong></p>Lesen: ";
									titlespan[98].innerHTML = "<br />Bearbeiten: ";
									titlespan[99].innerHTML = "<br />Veröffentlichen: ";
									titlespan[100].innerHTML = "<br />Schreiben: ";
									titlespan[101].innerHTML = "<br />Löschen: ";
									titlespan[102].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
									titlespan[103].innerHTML = "<br />Bearbeiten: ";
									titlespan[104].innerHTML = "<br />Veröffentlichen: ";
									titlespan[105].innerHTML = "<br />Schreiben: ";
									titlespan[106].innerHTML = "<br />Löschen: ";
									titlespan[107].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
									titlespan[108].innerHTML = "<br />Bearbeiten: ";
									titlespan[109].innerHTML = "<br />Veröffentlichen: ";
									titlespan[110].innerHTML = "<br />Schreiben: ";
									titlespan[111].innerHTML = "<br />Löschen: ";
									titlespan[112].innerHTML = "<br />Lesen: ";
									titlespan[113].innerHTML = "<br />Bearbeiten: ";
									titlespan[114].innerHTML = "<br />Veröffentlichen: ";
									titlespan[115].innerHTML = "<br />Schreiben: ";
									titlespan[116].innerHTML = "<br />Löschen: ";
									titlespan[117].innerHTML = "<p class='dbflexxptitle'><strong>Neue Benutzer</strong></p>Lesen: ";
									titlespan[118].innerHTML = "<br />Bearbeiten: ";
									titlespan[119].innerHTML = "<br />Veröffentlichen: ";
									titlespan[120].innerHTML = "<br />Schreiben: ";
									titlespan[121].innerHTML = "<br />Löschen: ";
									titlespan[122].innerHTML = "<p class='dbflexxptitle'><strong>Benutzergruppen</strong></p>Lesen: ";
									titlespan[123].innerHTML = "<br />Bearbeiten: ";
									titlespan[124].innerHTML = "<br />Veröffentlichen: ";
									titlespan[125].innerHTML = "<br />Schreiben: ";
									titlespan[126].innerHTML = "<br />Löschen: ";
									titlespan[127].innerHTML = "<p class='dbflexxptitle'><strong>Benutzer verwalten</strong></p>Lesen: ";
									titlespan[128].innerHTML = "<br />Bearbeiten: ";
									titlespan[129].innerHTML = "<br />Veröffentlichen: ";
									titlespan[130].innerHTML = "<br />Schreiben: ";
									titlespan[131].innerHTML = "<br />Löschen: ";
									titlespan[132].innerHTML = "<br />Lesen: ";
									titlespan[133].innerHTML = "<br />Bearbeiten: ";
									titlespan[134].innerHTML = "<br />Veröffentlichen: ";
									titlespan[135].innerHTML = "<br />Schreiben: ";
									titlespan[136].innerHTML = "<br />Löschen: ";
									titlespan[137].innerHTML = "<p class='dbflexxptitle'><strong>Eigene ToDos</strong></p>Lesen: ";
									titlespan[138].innerHTML = "<br />Bearbeiten: ";
									titlespan[139].innerHTML = "<br />Veröffentlichen: ";
									titlespan[140].innerHTML = "<br />Schreiben: ";
									titlespan[141].innerHTML = "<br />Löschen: ";
									titlespan[142].innerHTML = "<p class='dbflexxptitle'><strong>Freme ToDos</strong></p>Lesen: ";
									titlespan[143].innerHTML = "<br />Bearbeiten: ";
									titlespan[144].innerHTML = "<br />Veröffentlichen: ";
									titlespan[145].innerHTML = "<br />Schreiben: ";
									titlespan[146].innerHTML = "<br />Löschen: ";
									titlespan[147].innerHTML = "<br />Lesen: ";
									titlespan[148].innerHTML = "<br />Bearbeiten: ";
									titlespan[149].innerHTML = "<br />Veröffentlichen: ";
									titlespan[150].innerHTML = "<br />Schreiben: ";
									titlespan[151].innerHTML = "<br />Löschen: ";
									titlespan[152].innerHTML = "<br />Lesen: ";
									titlespan[153].innerHTML = "<br />Bearbeiten: ";
									titlespan[154].innerHTML = "<br />Veröffentlichen: ";
									titlespan[155].innerHTML = "<br />Schreiben: ";
									titlespan[156].innerHTML = "<br />Löschen: ";
									
									
									var spanbreak = new Array();
									
									for (i = 0; i < 24; i++) {
										spanbreak[i] = document.createElement("br");
									} 
									
									for (i = 0; i < 22; i++) {
										contentdiv[0].appendChild(titlespan[i]);
										contentdiv[0].appendChild(contentspan[i]);
									}
									contentdiv[0].appendChild(spanbreak[0]);
									contentdiv[0].appendChild(spanbreak[1]);
									
									for (i = 22; i < 42; i++) {
										contentdiv[1].appendChild(titlespan[i]);
										contentdiv[1].appendChild(contentspan[i]);
									}
									contentdiv[1].appendChild(spanbreak[2]);
									contentdiv[1].appendChild(spanbreak[3]);
									
									for (i = 42; i < 62; i++) {
										contentdiv[2].appendChild(titlespan[i]);
										contentdiv[2].appendChild(contentspan[i]);
									}
									contentdiv[2].appendChild(spanbreak[4]);
									contentdiv[2].appendChild(spanbreak[5]);
									
									for (i = 62; i < 82; i++) {
										contentdiv[3].appendChild(titlespan[i]);
										contentdiv[3].appendChild(contentspan[i]);
									}
									contentdiv[3].appendChild(spanbreak[6]);
									contentdiv[3].appendChild(spanbreak[7]);
									
									for (i = 82; i < 102; i++) {
										contentdiv[4].appendChild(titlespan[i]);
										contentdiv[4].appendChild(contentspan[i]);
									}
									contentdiv[4].appendChild(spanbreak[8]);
									contentdiv[4].appendChild(spanbreak[9]);
									
									for (i = 102; i < 112; i++) {
										contentdiv[5].appendChild(titlespan[i]);
										contentdiv[5].appendChild(contentspan[i]);
									}
									contentdiv[5].appendChild(spanbreak[10]);
									contentdiv[5].appendChild(spanbreak[11]);
									
									for (i = 112; i < 117; i++) {
										contentdiv[6].appendChild(titlespan[i]);
										contentdiv[6].appendChild(contentspan[i]);
									}
									contentdiv[6].appendChild(spanbreak[12]);
									contentdiv[6].appendChild(spanbreak[13]);
									
									for (i = 117; i < 132; i++) {
										contentdiv[7].appendChild(titlespan[i]);
										contentdiv[7].appendChild(contentspan[i]);
									}
									contentdiv[7].appendChild(spanbreak[14]);
									contentdiv[7].appendChild(spanbreak[15]);
									
									for (i = 132; i < 137; i++) {
										contentdiv[8].appendChild(titlespan[i]);
										contentdiv[8].appendChild(contentspan[i]);
									}
									contentdiv[8].appendChild(spanbreak[16]);
									contentdiv[8].appendChild(spanbreak[17]);
									
									for (i = 137; i < 147; i++) {
										contentdiv[9].appendChild(titlespan[i]);
										contentdiv[9].appendChild(contentspan[i]);
									}
									contentdiv[9].appendChild(spanbreak[18]);
									contentdiv[9].appendChild(spanbreak[19]);
									
									for (i = 147; i < 152; i++) {
										contentdiv[10].appendChild(titlespan[i]);
										contentdiv[10].appendChild(contentspan[i]);
									}
									contentdiv[10].appendChild(spanbreak[20]);
									contentdiv[10].appendChild(spanbreak[21]);
									
									for (i = 152; i < 157; i++) {
										contentdiv[11].appendChild(titlespan[i]);
										contentdiv[11].appendChild(contentspan[i]);
									}
									contentdiv[11].appendChild(spanbreak[22]);
									contentdiv[11].appendChild(spanbreak[23]);
									
									groupcontent.appendChild(articlespan);
									groupcontent.appendChild(contentdiv[0]);
									groupcontent.appendChild(unpublishedspan);
									groupcontent.appendChild(contentdiv[1]);
									groupcontent.appendChild(commentsspan);
									groupcontent.appendChild(contentdiv[2]);
									groupcontent.appendChild(pollsspan);
									groupcontent.appendChild(contentdiv[3]);
									groupcontent.appendChild(galleryspan);
									groupcontent.appendChild(contentdiv[4]);
									groupcontent.appendChild(bulletinspan);
									groupcontent.appendChild(contentdiv[5]);
									groupcontent.appendChild(guestbookspan);
									groupcontent.appendChild(contentdiv[6]);
									groupcontent.appendChild(accessspan);
									groupcontent.appendChild(contentdiv[7]);
									groupcontent.appendChild(preferencesspan);
									groupcontent.appendChild(contentdiv[8]);
									groupcontent.appendChild(todosspan);
									groupcontent.appendChild(contentdiv[9]);
									groupcontent.appendChild(newpagesspan);
									groupcontent.appendChild(contentdiv[10]);
									groupcontent.appendChild(archievespan);
									groupcontent.appendChild(contentdiv[11]);
									
									postbutton = document.createElement("button");
									postbutton.innerHTML = "Benutzergruppe anlegen";
									postbutton.onclick = function () { sendnewgrouptoserver(groupname); };
									
									groupcontent.appendChild(postbutton);
									
									function getTextFromPrefNumber (number) {
										switch (number) {
											case "0": return "nein"; break;
											case "1": return "ja"; break;
											case "2": return "direkte Bestätigung"; break;
											case "3": return "hierarchische Bestätigung"; break;
											case "4": return "abhängig von Einstellung"; break;
											case "-1": return "-"; break;
										}
									}
								}
						}
					
					function addgroup () {
						unableedit();
						unabledelete();
						if (document.getElementById("dbflexxaccessgroupactioncontainer") != null) {
							actionbar.removeChild(document.getElementById("dbflexxaccessgroupactioncontainer"));
						}
						var amount = groupscontent.length;;
						if (groupadd == false) {
							for (i = 0; i < amount; i++) {
								groupscontent[i].style.background = "none";
							}
							groupcontent.innerHTML = "Bitte geben Sie den Namen der neuen Benutzergruppe ein.";
							adddiv.className = "dbflexxactionbarbuttonactive";
							groupadd = true;
							groupscontent[amount] = document.createElement("div");
							groupscontent[amount].id = "dbflexxaccessgroupsidecontent" + amount;
							groupscontent[amount].className = "dbflexxsidebarcontent";
							var groupsinput = document.createElement("input"); 
							groupsinput.style.width = "100%";
							groupsinput.onkeyup = addgroupfinally;
							
							groupscontent[amount].appendChild(groupsinput);
							groups.appendChild(groupscontent[amount]);
							groupsinput.focus();
						}
						
						else {
							groupadd = false;
							groupcontent.innerHTML = "Keine Benutzergruppe ausgewählt.";
							adddiv.className = "dbflexxactionbarbutton";
							if (groupscontent[amount - 1].tagName.toLowerCase() == "input") {
								groups.removeChild(groupscontent[amount - 1]);
							}
						}
							
							
					}
					
					function readrights (which) {
						var watchrights = "";
						for (i = 0; i < allrights.getElementsByTagName("whichgroup").length; i++) {
							if (allrights.getElementsByTagName("whichgroup")[i].firstChild.data  == which) {
								watchrights = allrights.getElementsByTagName("preferences")[i];
								break;
							}
						}
												
						amountchildnodes = (watchrights.childNodes.length - 1) / 2;
						groupcontent.innerHTML = "";
						
						
						
						unpublishedspan = document.createElement("div");
						unpublishedspan.className = "dbflexxtitle";
						unpublishedspan.innerHTML = "Unveröffentlichtes";
						
						commentsspan = document.createElement("div");
						commentsspan.className = "dbflexxtitle";
						commentsspan.innerHTML = "Kommentare";
						
						pollsspan = document.createElement("div");
						pollsspan.className = "dbflexxtitle";
						pollsspan.innerHTML = "Umfragen";
						
						galleryspan = document.createElement("div");
						galleryspan.className = "dbflexxtitle";
						galleryspan.innerHTML = "Gallerie";
						
						bulletinspan = document.createElement("div");
						bulletinspan.className = "dbflexxtitle";
						bulletinspan.innerHTML = "Forum";
						
						guestbookspan = document.createElement("div");
						guestbookspan.className = "dbflexxtitle";
						guestbookspan.innerHTML = "Gästebuch";
						
						accessspan = document.createElement("div");
						accessspan.className = "dbflexxtitle";
						accessspan.innerHTML = "Benutzerrechte";
						
						preferencesspan = document.createElement("div");
						preferencesspan.className = "dbflexxtitle";
						preferencesspan.innerHTML = "systemweite Einstellungen";
						
						todosspan = document.createElement("div");
						todosspan.className = "dbflexxtitle";
						todosspan.innerHTML = "ToDos";
						
						newpagesspan = document.createElement("div");
						newpagesspan.className = "dbflexxtitle";
						newpagesspan.innerHTML = "Seitenstruktur";
						
						archievespan = document.createElement("div");
						archievespan.className = "dbflexxtitle";
						archievespan.innerHTML = "Archiv";
						
						showmore = new Array();
						contentdiv = new Array();
						
						for (i = 0; i < 12; i++) {
							showmore[i] = document.createElement("img");
							showmore[i].src = "http://graphic.co2-filter.com/seite/dbflexxshowmore.png";
							showmore[i].id = "dbflexxaccessgroupshowmore" + i;
							showmore[i].className = "dbflexxshowmore";
							showmore[i].onclick = showMore;
							
							contentdiv[i] = document.createElement("div");
							contentdiv[i].id = "dbflexxaccessgroupcontentdiv" + i;
							contentdiv[i].style.display = "none";
							contentdiv[i].style.paddingLeft = "16px";
						}
						
						function showMore () {
							id = "dbflexxaccessgroupcontentdiv" + this.id.substr(26);
							document.getElementById(id).style.display = "block";
							this.src = "http://graphic.co2-filter.com/seite/dbflexxshowless.png";
							this.onclick = showLess;
						}
						
						function showLess () {
							id = "dbflexxaccessgroupcontentdiv" + this.id.substr(26);
							document.getElementById(id).style.display = "none";
							this.src = "http://graphic.co2-filter.com/seite/dbflexxshowmore.png";
							this.onclick = showMore;
						}
						
						var contentspan = new Array();
						j = 0;
						z = 0;
						
						for (i = 0; i < 22; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							
							if (i < 5) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("article")[0].childNodes[0].childNodes[j].firstChild.data);
							}
							else if (i >= 5 && i < 10) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("article")[0].childNodes[1].childNodes[j].firstChild.data);
							}
							else if (i >= 10 && i < 15) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("article")[0].childNodes[2].childNodes[j].firstChild.data);
							}
							else if (i >= 15 && i < 20) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("article")[0].childNodes[3].childNodes[j].firstChild.data);
							} 
							
							else if (i == 20) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("movearticles")[0].firstChild.data);
							}
							
							else if (i == 21) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("copyarticles")[0].firstChild.data);
							}
							
							if (j >= 4) {
								j = 0;
								z++;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						z = 0;
						
						for (i = 22; i < 42; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							if (i < 27) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("nonpublished")[0].childNodes[0].childNodes[j].firstChild.data);
							}
							else if (i >= 27 && i < 32) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("nonpublished")[0].childNodes[1].childNodes[j].firstChild.data);
							}
							else if (i >= 32 && i < 37) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("nonpublished")[0].childNodes[2].childNodes[j].firstChild.data);
							}
							else if (i >= 37 && i < 42) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("nonpublished")[0].childNodes[3].childNodes[j].firstChild.data);
							} 
							if (j >= 4) {
								j = 0;
								z++;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						z = 0;
						
						for (i = 42; i < 62; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							if (i < 47) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("comments")[0].childNodes[0].childNodes[j].firstChild.data);
							}
							else if (i >= 47 && i < 52) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("comments")[0].childNodes[1].childNodes[j].firstChild.data);
							}
							else if (i >= 52 && i < 57) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("comments")[0].childNodes[2].childNodes[j].firstChild.data);
							}
							else if (i >= 57 && i < 62) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("comments")[0].childNodes[3].childNodes[j].firstChild.data);
							} 
							if (j >= 4) {
								j = 0;
								z++;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						z = 0;
						
						for (i = 62; i < 82; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							if (i < 67) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("polls")[0].childNodes[0].childNodes[j].firstChild.data);
							}
							else if (i >= 67 && i < 72) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("polls")[0].childNodes[1].childNodes[j].firstChild.data);
							}
							else if (i >= 72 && i < 77) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("polls")[0].childNodes[2].childNodes[j].firstChild.data);
							}
							else if (i >= 77 && i < 82) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("polls")[0].childNodes[3].childNodes[j].firstChild.data);
							} 
							if (j >= 4) {
								j = 0;
								z++;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						z = 0;
						
						for (i = 82; i < 102; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							if (i < 87) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("gallery")[0].childNodes[0].childNodes[j].firstChild.data);
							}
							else if (i >= 87 && i < 92) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("gallery")[0].childNodes[1].childNodes[j].firstChild.data);
							}
							else if (i >= 92 && i < 97) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("gallery")[0].childNodes[2].childNodes[j].firstChild.data);
							}
							else if (i >= 97 && i < 102) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("gallery")[0].childNodes[3].childNodes[j].firstChild.data);
							} 
							if (j >= 4) {
								j = 0;
								z++;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						z = 0;
						
						for (i = 102; i < 112; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							if (i < 107) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("bulletin")[0].childNodes[0].childNodes[j].firstChild.data);
							}
							else if (i >= 107 && i < 112) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("bulletin")[0].childNodes[1].childNodes[j].firstChild.data);
							} 
							if (j >= 4) {
								j = 0;
								z++;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						z = 0;
						
						for (i = 112; i < 117; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("guestbook")[0].childNodes[j].firstChild.data);
							if (j >= 4) {
								j = 0;
								z++;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						
						for (i = 117; i < 122; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "sp" + 1;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("newusers")[0].childNodes[j].firstChild.data);
							if (j >= 4) {
								j = 0;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						
						for (i = 122; i < 127; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "sp" + 2;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("administrateusergroups")[0].childNodes[j].firstChild.data);
							if (j >= 4) {
								j = 0;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						
						for (i = 127; i < 132; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "sp" + 3;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("administrateusers")[0].childNodes[j].firstChild.data);
							if (j >= 4) {
								j = 0;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						z = 0;
						
						for (i = 132; i < 137; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("globalpreferences")[0].childNodes[j].firstChild.data);
							if (j >= 4) {
								j = 0;
								z++;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						z = 0;
						
						for (i = 137; i < 147; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							if (i < 142) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("todos")[0].childNodes[0].childNodes[j].firstChild.data);
							}
							else if (i >= 142 && i < 147) {
								contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("todos")[0].childNodes[1].childNodes[j].firstChild.data);
							} 
							if (j >= 4) {
								j = 0;
								z++;
							}
							else {
								j++;
							} 
						}
						
						j = 0;
						z = 0;
						
						for (i = 147; i < 152; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("newpages")[0].childNodes[j].firstChild.data);
							if (j >= 4) {
								j = 0;
								z++;
							}
							else {
								j++;
							}
						}
						
						j = 0;
						z = 0;
						
						for (i = 152; i < 157; i++) {
							contentspan[i] = document.createElement("span");
							contentspan[i].id = "dbflexxaccessgroupcontentspan" + i + "u" + z;
							contentspan[i].onclick = editrights;
							contentspan[i].style.color = "#000000";
							contentspan[i].innerHTML = getTextFromPrefNumber(watchrights.getElementsByTagName("archive")[0].childNodes[j].firstChild.data);
							if (j >= 4) { 
								j = 0;
								z++;
							}
							else {
								j++;
							}
						}
						
						
						titlespan = new Array();
						
						for (i = 0; i < 157 ; i++) {
							titlespan[i] = document.createElement("span");
						}
						titlespan[0].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
						titlespan[1].innerHTML = "<br />Bearbeiten: ";
						titlespan[2].innerHTML = "<br />Veröffentlichen: ";
						titlespan[3].innerHTML = "<br />Schreiben: ";
						titlespan[4].innerHTML = "<br />Löschen: ";
						titlespan[5].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
						titlespan[6].innerHTML = "<br />Bearbeiten: ";
						titlespan[7].innerHTML = "<br />Veröffentlichen: ";
						titlespan[8].innerHTML = "<br />Schreiben: ";
						titlespan[9].innerHTML = "<br />Löschen: ";
						titlespan[10].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Artikel</strong></p>Lesen: ";
						titlespan[11].innerHTML = "<br />Bearbeiten: ";
						titlespan[12].innerHTML = "<br />Veröffentlichen: ";
						titlespan[13].innerHTML = "<br />Schreiben: ";
						titlespan[14].innerHTML = "<br />Löschen: ";
						titlespan[15].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Artikel</strong></p>Lesen: ";
						titlespan[16].innerHTML = "<br />Bearbeiten: ";
						titlespan[17].innerHTML = "<br />Veröffentlichen: ";
						titlespan[18].innerHTML = "<br />Schreiben: ";
						titlespan[19].innerHTML = "<br />Löschen: ";
						titlespan[20].innerHTML = "<p class='dbflexxptitle'><strong>Sonstiges</strong></p>Artikel verschieben: ";
						titlespan[21].innerHTML = "<br />Artikel kopieren: ";
						titlespan[22].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
						titlespan[23].innerHTML = "<br />Bearbeiten: ";
						titlespan[24].innerHTML = "<br />Veröffentlichen: ";
						titlespan[25].innerHTML = "<br />Schreiben: ";
						titlespan[26].innerHTML = "<br />Löschen: ";
						titlespan[27].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
						titlespan[28].innerHTML = "<br />Bearbeiten: ";
						titlespan[29].innerHTML = "<br />Veröffentlichen: ";
						titlespan[30].innerHTML = "<br />Schreiben: ";
						titlespan[31].innerHTML = "<br />Löschen: ";
						titlespan[32].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Artikel</strong></p>Lesen: ";
						titlespan[33].innerHTML = "<br />Bearbeiten: ";
						titlespan[34].innerHTML = "<br />Veröffentlichen: ";
						titlespan[35].innerHTML = "<br />Schreiben: ";
						titlespan[36].innerHTML = "<br />Löschen: ";
						titlespan[37].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Artikel</strong></p>Lesen: ";
						titlespan[38].innerHTML = "<br />Bearbeiten: ";
						titlespan[39].innerHTML = "<br />Veröffentlichen: ";
						titlespan[40].innerHTML = "<br />Schreiben: ";
						titlespan[41].innerHTML = "<br />Löschen: ";
						titlespan[42].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
						titlespan[43].innerHTML = "<br />Bearbeiten: ";
						titlespan[44].innerHTML = "<br />Veröffentlichen: ";
						titlespan[45].innerHTML = "<br />Schreiben: ";
						titlespan[46].innerHTML = "<br />Löschen: ";
						titlespan[47].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
						titlespan[48].innerHTML = "<br />Bearbeiten: ";
						titlespan[49].innerHTML = "<br />Veröffentlichen: ";
						titlespan[50].innerHTML = "<br />Schreiben: ";
						titlespan[51].innerHTML = "<br />Löschen: ";
						titlespan[52].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Artikel</strong></p>Lesen: ";
						titlespan[53].innerHTML = "<br />Bearbeiten: ";
						titlespan[54].innerHTML = "<br />Veröffentlichen: ";
						titlespan[55].innerHTML = "<br />Schreiben: ";
						titlespan[56].innerHTML = "<br />Löschen: ";
						titlespan[57].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Artikel</strong></p>Lesen: ";
						titlespan[58].innerHTML = "<br />Bearbeiten: ";
						titlespan[59].innerHTML = "<br />Veröffentlichen: ";
						titlespan[60].innerHTML = "<br />Schreiben: ";
						titlespan[61].innerHTML = "<br />Löschen: ";
						titlespan[62].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
						titlespan[63].innerHTML = "<br />Bearbeiten: ";
						titlespan[64].innerHTML = "<br />Veröffentlichen: ";
						titlespan[65].innerHTML = "<br />Schreiben: ";
						titlespan[66].innerHTML = "<br />Löschen: ";
						titlespan[67].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
						titlespan[68].innerHTML = "<br />Bearbeiten: ";
						titlespan[69].innerHTML = "<br />Veröffentlichen: ";
						titlespan[70].innerHTML = "<br />Schreiben: ";
						titlespan[71].innerHTML = "<br />Löschen: ";
						titlespan[72].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Umfragen</strong></p>Lesen: ";
						titlespan[73].innerHTML = "<br />Bearbeiten: ";
						titlespan[74].innerHTML = "<br />Veröffentlichen: ";
						titlespan[75].innerHTML = "<br />Schreiben: ";
						titlespan[76].innerHTML = "<br />Löschen: ";
						titlespan[77].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Umfragen</strong></p>Lesen: ";
						titlespan[78].innerHTML = "<br />Bearbeiten: ";
						titlespan[79].innerHTML = "<br />Veröffentlichen: ";
						titlespan[80].innerHTML = "<br />Schreiben: ";
						titlespan[81].innerHTML = "<br />Löschen: ";
						titlespan[82].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
						titlespan[83].innerHTML = "<br />Bearbeiten: ";
						titlespan[84].innerHTML = "<br />Veröffentlichen: ";
						titlespan[85].innerHTML = "<br />Schreiben: ";
						titlespan[86].innerHTML = "<br />Löschen: ";
						titlespan[87].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
						titlespan[88].innerHTML = "<br />Bearbeiten: ";
						titlespan[89].innerHTML = "<br />Veröffentlichen: ";
						titlespan[90].innerHTML = "<br />Schreiben: ";
						titlespan[91].innerHTML = "<br />Löschen: ";
						titlespan[92].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Beiträge</strong></p>Lesen: ";
						titlespan[93].innerHTML = "<br />Bearbeiten: ";
						titlespan[94].innerHTML = "<br />Veröffentlichen: ";
						titlespan[95].innerHTML = "<br />Schreiben: ";
						titlespan[96].innerHTML = "<br />Löschen: ";
						titlespan[97].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Beiträge</strong></p>Lesen: ";
						titlespan[98].innerHTML = "<br />Bearbeiten: ";
						titlespan[99].innerHTML = "<br />Veröffentlichen: ";
						titlespan[100].innerHTML = "<br />Schreiben: ";
						titlespan[101].innerHTML = "<br />Löschen: ";
						titlespan[102].innerHTML = "<p class='dbflexxptitle'><strong>Eigene Rubrik</strong></p>Lesen: ";
						titlespan[103].innerHTML = "<br />Bearbeiten: ";
						titlespan[104].innerHTML = "<br />Veröffentlichen: ";
						titlespan[105].innerHTML = "<br />Schreiben: ";
						titlespan[106].innerHTML = "<br />Löschen: ";
						titlespan[107].innerHTML = "<p class='dbflexxptitle'><strong>Fremde Rubrik</strong></p>Lesen: ";
						titlespan[108].innerHTML = "<br />Bearbeiten: ";
						titlespan[109].innerHTML = "<br />Veröffentlichen: ";
						titlespan[110].innerHTML = "<br />Schreiben: ";
						titlespan[111].innerHTML = "<br />Löschen: ";
						titlespan[112].innerHTML = "<br />Lesen: ";
						titlespan[113].innerHTML = "<br />Bearbeiten: ";
						titlespan[114].innerHTML = "<br />Veröffentlichen: ";
						titlespan[115].innerHTML = "<br />Schreiben: ";
						titlespan[116].innerHTML = "<br />Löschen: ";
						titlespan[117].innerHTML = "<p class='dbflexxptitle'><strong>Neue Benutzer</strong></p>Lesen: ";
						titlespan[118].innerHTML = "<br />Bearbeiten: ";
						titlespan[119].innerHTML = "<br />Veröffentlichen: ";
						titlespan[120].innerHTML = "<br />Schreiben: ";
						titlespan[121].innerHTML = "<br />Löschen: ";
						titlespan[122].innerHTML = "<p class='dbflexxptitle'><strong>Benutzergruppen</strong></p>Lesen: ";
						titlespan[123].innerHTML = "<br />Bearbeiten: ";
						titlespan[124].innerHTML = "<br />Veröffentlichen: ";
						titlespan[125].innerHTML = "<br />Schreiben: ";
						titlespan[126].innerHTML = "<br />Löschen: ";
						titlespan[127].innerHTML = "<p class='dbflexxptitle'><strong>Benutzer verwalten</strong></p>Lesen: ";
						titlespan[128].innerHTML = "<br />Bearbeiten: ";
						titlespan[129].innerHTML = "<br />Veröffentlichen: ";
						titlespan[130].innerHTML = "<br />Schreiben: ";
						titlespan[131].innerHTML = "<br />Löschen: ";
						titlespan[132].innerHTML = "<br />Lesen: ";
						titlespan[133].innerHTML = "<br />Bearbeiten: ";
						titlespan[134].innerHTML = "<br />Veröffentlichen: ";
						titlespan[135].innerHTML = "<br />Schreiben: ";
						titlespan[136].innerHTML = "<br />Löschen: ";
						titlespan[137].innerHTML = "<p class='dbflexxptitle'><strong>Eigene ToDos</strong></p>Lesen: ";
						titlespan[138].innerHTML = "<br />Bearbeiten: ";
						titlespan[139].innerHTML = "<br />Veröffentlichen: ";
						titlespan[140].innerHTML = "<br />Schreiben: ";
						titlespan[141].innerHTML = "<br />Löschen: ";
						titlespan[142].innerHTML = "<p class='dbflexxptitle'><strong>Freme ToDos</strong></p>Lesen: ";
						titlespan[143].innerHTML = "<br />Bearbeiten: ";
						titlespan[144].innerHTML = "<br />Veröffentlichen: ";
						titlespan[145].innerHTML = "<br />Schreiben: ";
						titlespan[146].innerHTML = "<br />Löschen: ";
						titlespan[147].innerHTML = "<br />Lesen: ";
						titlespan[148].innerHTML = "<br />Bearbeiten: ";
						titlespan[149].innerHTML = "<br />Veröffentlichen: ";
						titlespan[150].innerHTML = "<br />Schreiben: ";
						titlespan[151].innerHTML = "<br />Löschen: ";
						titlespan[152].innerHTML = "<br />Lesen: ";
						titlespan[153].innerHTML = "<br />Bearbeiten: ";
						titlespan[154].innerHTML = "<br />Veröffentlichen: ";
						titlespan[155].innerHTML = "<br />Schreiben: ";
						titlespan[156].innerHTML = "<br />Löschen: ";
						
						
						var spanbreak = new Array();
						
						for (i = 0; i < 24; i++) {
							spanbreak[i] = document.createElement("br");
						} 
						
						for (i = 0; i < 22; i++) {
							contentdiv[0].appendChild(titlespan[i]);
							contentdiv[0].appendChild(contentspan[i]);
						}
						contentdiv[0].appendChild(spanbreak[0]);
						contentdiv[0].appendChild(spanbreak[1]);
						
						for (i = 22; i < 42; i++) {
							contentdiv[1].appendChild(titlespan[i]);
							contentdiv[1].appendChild(contentspan[i]);
						}
						contentdiv[1].appendChild(spanbreak[2]);
						contentdiv[1].appendChild(spanbreak[3]);
						
						for (i = 42; i < 62; i++) {
							contentdiv[2].appendChild(titlespan[i]);
							contentdiv[2].appendChild(contentspan[i]);
						}
						contentdiv[2].appendChild(spanbreak[4]);
						contentdiv[2].appendChild(spanbreak[5]);
						
						for (i = 62; i < 82; i++) {
							contentdiv[3].appendChild(titlespan[i]);
							contentdiv[3].appendChild(contentspan[i]);
						}
						contentdiv[3].appendChild(spanbreak[6]);
						contentdiv[3].appendChild(spanbreak[7]);
						
						for (i = 82; i < 102; i++) {
							contentdiv[4].appendChild(titlespan[i]);
							contentdiv[4].appendChild(contentspan[i]);
						}
						contentdiv[4].appendChild(spanbreak[8]);
						contentdiv[4].appendChild(spanbreak[9]);
						
						for (i = 102; i < 112; i++) {
							contentdiv[5].appendChild(titlespan[i]);
							contentdiv[5].appendChild(contentspan[i]);
						}
						contentdiv[5].appendChild(spanbreak[10]);
						contentdiv[5].appendChild(spanbreak[11]);
						
						for (i = 112; i < 117; i++) {
							contentdiv[6].appendChild(titlespan[i]);
							contentdiv[6].appendChild(contentspan[i]);
						}
						contentdiv[6].appendChild(spanbreak[12]);
						contentdiv[6].appendChild(spanbreak[13]);
						
						for (i = 117; i < 132; i++) {
							contentdiv[7].appendChild(titlespan[i]);
							contentdiv[7].appendChild(contentspan[i]);
						}
						contentdiv[7].appendChild(spanbreak[14]);
						contentdiv[7].appendChild(spanbreak[15]);
						
						for (i = 132; i < 137; i++) {
							contentdiv[8].appendChild(titlespan[i]);
							contentdiv[8].appendChild(contentspan[i]);
						}
						contentdiv[8].appendChild(spanbreak[16]);
						contentdiv[8].appendChild(spanbreak[17]);
						
						for (i = 137; i < 147; i++) {
							contentdiv[9].appendChild(titlespan[i]);
							contentdiv[9].appendChild(contentspan[i]);
						}
						contentdiv[9].appendChild(spanbreak[18]);
						contentdiv[9].appendChild(spanbreak[19]);
						
						for (i = 147; i < 152; i++) {
							contentdiv[10].appendChild(titlespan[i]);
							contentdiv[10].appendChild(contentspan[i]);
						}
						contentdiv[10].appendChild(spanbreak[20]);
						contentdiv[10].appendChild(spanbreak[21]);
						
						for (i = 152; i < 157; i++) {
							contentdiv[11].appendChild(titlespan[i]);
							contentdiv[11].appendChild(contentspan[i]);
						}
						contentdiv[11].appendChild(spanbreak[22]);
						contentdiv[11].appendChild(spanbreak[23]);
						
						
						
						function editrights () {
							if (initedit == true && this.innerHTML != "-") {
								whichspantoedit = this;
								if (document.getElementById("dbflexxaccessgroupactioncontainer") != null) {
									document.getElementById("dbflexxaccessgroupactioncontainer").parentNode.removeChild(document.getElementById("dbflexxaccessgroupactioncontainer"));
								}
								var category = "";
								switch (this.parentNode.id.substr(28)) {
									case "0" : category = "article"; break;
									case "1" : category = "nonpublished"; break;
									case "2" : category = "comments"; break;
									case "3" : category = "polls"; break;
									case "4" : category = "gallery"; break;
									case "5" : category = "bulletin"; break;
									case "6" : category = "guestbook"; break;
									case "7" : category = "special"; break;
									case "8" : category = "globalpreferences"; break;
									case "9" : category = "todos"; break;
									case "10" : category = "newpages"; break;
									case "11" : category = "archive"; break;
									default: category = "none";
								}
								var whichnumber = this.id.substr(31);
								if (category == "special") {
									if (whichnumber.substr(0,2) == "sp") {
										whichnumber = whichnumber.substr(2);
									}
									else if (whichnumber.substr(1,2) == "sp") {
										whichnumber = whichnumber.substr(3);
									}
									switch (whichnumber) {
										case "1": category = "newusers"; break;
										case "2": category = "administrateusergroups"; break;
										case "3": category = "administrateusers"; break;
										default: category = "none";
									}
									whichnumber = 0;
								}
								else {
									if (whichnumber.substr(0,1) == "u") {
									whichnumber = whichnumber.substr(1);
									}
									else if (whichnumber.substr(1,1) == "u") {
										whichnumber = whichnumber.substr(2);
									}
								}
								
								
								titlespanid = "";
								if (this.id.substr(29,3).search("u") != -1) {
									if (this.id.substr(29,2).search("u") != -1) {
										titlespanid = this.id.substr(29,1);
									}
									else {
										titlespanid = this.id.substr(29,2);
									}
								}
								else {
									titlespanid = this.id.substr(29,3);
								}
								switch (titlespan[titlespanid].childNodes[1].data) {
									case "Lesen: " : whichnode = "read"; break;
									case "Bearbeiten: " : whichnode = "edit"; break;
									case "Veröffentlichen: " : whichnode = "publish"; break;
									case "Schreiben: " : whichnode = "write"; break;
									case "Löschen: " : whichnode = "delete"; break;
									default : whichnode = "none";
								}
								if (whichnode == "none" && category == "article") {
									switch (titlespan[titlespanid].childNodes[1].data) {
										case "Artikel kopieren: " : category = "copyarticles"; break;
										case "Artikel verschieben: " : category = "movearticles"; break;
										default : category = "error";
									} 
									whichnode = "special";
									whichnumber = 0;
								}
								for (i = 0; i < titlespan.length; i++) {
									titlespan[i].style.color = "#000000";
									contentspan[i].style.color = "#000000";
								}
								titlespan[titlespanid].style.color = "#F3D153";
								this.style.color = "#F3D153";
								
								actioncontainer = document.createElement("div");
								actioncontainer.id = "dbflexxaccessgroupactioncontainer";
								
								actionseperator = document.createElement("div");
								actionseperator.className = "befehlsleistetrenner";
								
								whichaction = document.createElement("span");
								whichaction.style.cssFloat = "left";
								whichaction.innerHTML = titlespan[titlespanid].childNodes[1].data;
								
								selector = document.createElement("select");
								selector.id = "dbflexxaccessgroupselector";
								
								option1 = document.createElement("option");
								option1.value = "0";
								option1.innerHTML = "nein";
								
								option2 = document.createElement("option");
								option2.value = "1";
								option2.innerHTML = "ja";
								
								option3 = document.createElement("option");
								option3.value = "2";
								option3.innerHTML = "direkte Bestätigung";
								
								option4 = document.createElement("option");
								option4.value = "3";
								option4.innerHTML = "hierarchische Bestätigung";
								
								option5 = document.createElement("option");
								option5.value = "4";
								option5.innerHTML = "abhängig von Einstellung";
								
								selector.appendChild(option1);
								selector.appendChild(option2);
								selector.appendChild(option3);
								selector.appendChild(option4);
								selector.appendChild(option5);
								
								for (i = 0; i < selector.options.length; i++) {
									if (this.innerHTML == selector.options[i].text) {
										selector.options[i].selected = true;
										break;
									}
								}
								
								yesbutton = document.createElement("div");
								yesbutton.className = "dbflexxactionbarbutton";
								yesbutton.id = "dbflexxaccessnewyes";
								
								yesbuttonimage = document.createElement("img");
								yesbuttonimage.src = "http://graphic.co2-filter.com/seite/dbflexxyes.png";
								yesbuttonimage.onclick = function () { 
									changerightsajax = testajax();
									addloader("Ändere Gruppenrechte ...");
									changerightsajax.open("get","http://dievierte-gewalt.de/beta/scripts/useraccess.php?action=groups&w="+whichnode+"&n="+whichnumber+"&c="+category+"&v="+selector.options[selector.selectedIndex].value+"&g="+which);
									changerightsajax.onreadystatechange = function () {
										if(changerightsajax.readyState == 4) {
											stoploader();
											if (selector.options[selector.selectedIndex].value == changerightsajax.responseText) {
												whichspantoedit.innerHTML = selector.options[selector.selectedIndex].text;
											}
											else {
												adderror("Gruppenrechte konnten nicht geändert werden." + changerightsajax.responseText);
											}
										}
									};
									changerightsajax.send(null);
								
								}
								
								yesbutton.appendChild(yesbuttonimage);
								actioncontainer.appendChild(actionseperator);
								actioncontainer.appendChild(whichaction);
								actioncontainer.appendChild(selector);
								actioncontainer.appendChild(yesbutton);
								actionbar.appendChild(actioncontainer);
								}
							}
						
											
						
						
						groupcontent.appendChild(showmore[0]);
						groupcontent.appendChild(articlespan);
						groupcontent.appendChild(contentdiv[0]);
						groupcontent.appendChild(showmore[1]);
						groupcontent.appendChild(unpublishedspan);
						groupcontent.appendChild(contentdiv[1]);
						groupcontent.appendChild(showmore[2]);
						groupcontent.appendChild(commentsspan);
						groupcontent.appendChild(contentdiv[2]);
						groupcontent.appendChild(showmore[3]);
						groupcontent.appendChild(pollsspan);
						groupcontent.appendChild(contentdiv[3]);
						groupcontent.appendChild(showmore[4]);
						groupcontent.appendChild(galleryspan);
						groupcontent.appendChild(contentdiv[4]);
						groupcontent.appendChild(showmore[5]);
						groupcontent.appendChild(bulletinspan);
						groupcontent.appendChild(contentdiv[5]);
						groupcontent.appendChild(showmore[6]);
						groupcontent.appendChild(guestbookspan);
						groupcontent.appendChild(contentdiv[6]);
						groupcontent.appendChild(showmore[7]);
						groupcontent.appendChild(accessspan);
						groupcontent.appendChild(contentdiv[7]);
						groupcontent.appendChild(showmore[8]);
						groupcontent.appendChild(preferencesspan);
						groupcontent.appendChild(contentdiv[8]);
						groupcontent.appendChild(showmore[9]);
						groupcontent.appendChild(todosspan);
						groupcontent.appendChild(contentdiv[9]);
						groupcontent.appendChild(showmore[10]);
						groupcontent.appendChild(newpagesspan);
						groupcontent.appendChild(contentdiv[10]);
						groupcontent.appendChild(showmore[11]);
						groupcontent.appendChild(archievespan);
						groupcontent.appendChild(contentdiv[11]);						
						
						function getTextFromPrefNumber (number) {
							switch (number) {
								case "0": return "nein"; break;
								case "1": return "ja"; break;
								case "2": return "direkte Bestätigung"; break;
								case "3": return "hierarchische Bestätigung"; break;
								case "4": return "abhängig von Einstellung"; break;
								case "-1": return "-"; break;
							}
						}
					}
					
					
				}
				}

function spotlight (ereignis) {
alert(ereignis);
						ereignis = ereignis ? ereignis : window.event;
						for (i = 0; i < availibleuser.length - 1; i++) {
							searchid1 = "dbflexxaccessnewcontent1u" + i;
							searchid2 = "dbflexxaccessnewcontent2u" + i;
							searchid3 = "dbflexxaccessnewcontent3u" + i;
							searchid4 = "dbflexxaccessnewcontent4u" + i;
							searchid5 = "dbflexxaccessnewcontent5u" + i;
							searchid6 = "dbflexxaccessnewcontent6u" + i; 
							availibleusersearch = availibleuser[i].split("/");
							if (availibleusersearch[0].toLowerCase().search(this.value.toLowerCase()) != -1 && this.value != "") {
								document.getElementById(searchid1).style.display = "block";
								document.getElementById(searchid2).style.display = "block";
								document.getElementById(searchid3).style.display = "block";
								document.getElementById(searchid4).style.display = "block";
								document.getElementById(searchid5).style.display = "block";
								document.getElementById(searchid6).style.display = "block";
							}
							
							else if (availibleusersearch[2].toLowerCase().search(this.value.toLowerCase()) != -1 && this.value != "") {
								document.getElementById(searchid1).style.display = "block";
								document.getElementById(searchid2).style.display = "block";
								document.getElementById(searchid3).style.display = "block";
								document.getElementById(searchid4).style.display = "block";
								document.getElementById(searchid5).style.display = "block";
								document.getElementById(searchid6).style.display = "block";
							}
							
							else if (availibleusersearch[3].toLowerCase().search(this.value.toLowerCase()) != -1 && this.value != "") {
								document.getElementById(searchid1).style.display = "block";
								document.getElementById(searchid2).style.display = "block";
								document.getElementById(searchid3).style.display = "block";
								document.getElementById(searchid4).style.display = "block";
								document.getElementById(searchid5).style.display = "block";
								document.getElementById(searchid6).style.display = "block";
							}
							
							else if (availibleusersearch[4].toLowerCase().search(this.value.toLowerCase()) != -1 && this.value != "") {
								document.getElementById(searchid1).style.display = "block";
								document.getElementById(searchid2).style.display = "block";
								document.getElementById(searchid3).style.display = "block";
								document.getElementById(searchid4).style.display = "block";
								document.getElementById(searchid5).style.display = "block";
								document.getElementById(searchid6).style.display = "block";
							}
							
							else if (this.value == "") {
								document.getElementById(searchid1).style.display = "block";
								document.getElementById(searchid2).style.display = "block";
								document.getElementById(searchid3).style.display = "block";
								document.getElementById(searchid4).style.display = "block";
								document.getElementById(searchid5).style.display = "block";
								document.getElementById(searchid6).style.display = "block";
							}
							
							else {
								document.getElementById(searchid1).style.display = "none";
								document.getElementById(searchid2).style.display = "none";
								document.getElementById(searchid3).style.display = "none";
								document.getElementById(searchid4).style.display = "none";
								document.getElementById(searchid5).style.display = "none";
								document.getElementById(searchid6).style.display = "none";
							}
						}
						if (ereignis.which == 13 || ereignis.keyCode == 13) {
							this.blur();
						}
					}
				
				function useradministration () {
					if (yourrights.getElementsByTagName("administrateusers")[0].getElementsByTagName("read")[0].firstChild.data == 1) {
					var availibleuser = new Array();
					firsttab.className = "dbflexxtabinactive";
					secondtab.className = "dbflexxtabinactive";
					thirdtab.className = "dbflexxtabactive";
					elementtabs.className = "dbflexxaccesstabcontaineractive";
					
					actionbar = document.createElement("div");
					actionbar.id = "dbflexxaccessactionbar";
					actionbar.className = "dbflexxactionbar";
					
					actionbarcontent = document.createElement("div");
					actionbarcontent.id = "dbflexxaccessactionbarcontent";
					actionbarcontent.className = "dbflexxactionbarcontent";
					
					searchbar = document.createElement("div");
					searchbar.id = "dbflexxaccesssearch";
					searchbar.className = "dbflexxsearchbar";
					
					searchbarright = document.createElement("div");
					searchbarright.className = "dbflexxsearchinputright";
					
					searchbarleft = document.createElement("div");
					searchbarleft.className = "dbflexxsearchinputleft";
					
					searchinput = document.createElement("input");
					searchinput.className = "dbflexxsearchinput";
					searchinput.onkeyup = spotlight;
					
					
					
					searchbar.appendChild(searchbarleft);
					searchbar.appendChild(searchinput);
					searchbar.appendChild(searchbarright);
					
					tablecontentcontainer = document.createElement("div");
					tablecontentcontainer.id = "dbflexxaccessnewcontentcontainer";
					
					tablecontentcontainercontainer = document.createElement("div");
					tablecontentcontainercontainer.id = "dbflexxaccessnewcontentchefcontainer";
					tablecontentcontainercontainer.style.overflow = "hidden";
					
					actionbar.appendChild(searchbar);
					actionbar.appendChild(actionbarcontent);
					
					content.innerHTML = "";
					content.appendChild(actionbar);
					content.appendChild(tablecontentcontainercontainer);
					
					newusersrequest = testajax();
					newusersrequest.open('get', 'http://dievierte-gewalt.de/beta/scripts/useraccess.php?action=administrate', true);
					document.getElementById("dbflexxloader").style.visibility = "visible";
					document.getElementById("dbflexxstatusleiste").innerHTML = "Lade Benutzer ...";
					newusersrequest.onreadystatechange = function () {
						if (newusersrequest.readyState == 4) {
							var usergroups = testajax();
							var usergroup = "";
							groupoption = new Array();
							usergroups.open('get', 'http://dievierte-gewalt.de/beta/scripts/usergroups.txt', true);
							document.getElementById("dbflexxloader").style.visibility = "visible";
							document.getElementById("dbflexxstatusleiste").innerHTML = "Lade Benutzergruppen ...";
							usergroups.onreadystatechange = function () {
								if (usergroups.readyState == 4) {
									usergroup = usergroups.responseText.split(";");
									for (i = 1; i <= usergroup.length; i++) {
										var groupcontent = usergroup[i - 1].split(",");
										groupoption[i] = document.createElement("option");
										groupoption[i].innerHTML = groupcontent[0];
										groupoption[i].value = groupcontent[1];
										for (j = 0; j < document.getElementById("dbflexxaccessnewcontentcontainer").firstChild.childNodes.length; j++) {
											insertid = "dbflexxaccessnewcontent5u" + j;
											switch (document.getElementById(insertid).innerHTML) {
												case groupcontent[1]: document.getElementById(insertid).innerHTML= groupcontent[0]; break;
											}
										}
									}
									document.getElementById("dbflexxloader").style.visibility = "hidden";
									document.getElementById("dbflexxstatusleiste").innerHTML = "Fertig.";
								}
							}
							usergroups.send(null);
							
							function getTextFromUserGroup (number) {
								for (i = 1; i <= usergroup.length; i++) {
									var groupcontent = usergroup[i - 1].split(",");
									switch (number) {
										case groupcontent[1]: return groupcontent[0]; break;
									}
								}
							}
							
							username = document.createElement("div");
							username.className = "dbflexxaccessnewkategories";
							username.style.width = "15%";
							realname = document.createElement("div");
							realname.className = "dbflexxaccessnewkategories";
							realname.style.width = "22%";
							mail = document.createElement("div");
							mail.className = "dbflexxaccessnewkategories";
							mail.style.width = "22%";
							dareg = document.createElement("div");
							dareg.className = "dbflexxaccessnewkategories";
							dareg.style.width = "20%";
							stufe = document.createElement("div");
							stufe.className = "dbflexxaccessnewkategories";
							stufe.style.width = "15%";
							loginamount = document.createElement("div");
							loginamount.className = "dbflexxaccessnewkategories";
							loginamount.style.width = "6%";
							
							document.getElementById("dbflexxloader").style.visibility = "hidden";
							document.getElementById("dbflexxstatusleiste").innerHTML = "Fertig.";
							
							
							
							availibleuser = newusersrequest.responseText.split(";");
							var newuserid = new Array();
							var tablecontent = new Array();
							var tablecontent2 = new Array();
							var tablecontent3 = new Array();
							var tablecontent4 = new Array();
							var tablecontent5 = new Array();
							var tablecontent6 = new Array();
							for (i = 0; i < availibleuser.length - 1; i++) {
								newusercontent = availibleuser[i].split("/");
								newuserid[i] = newusercontent[5];
								id1 = "dbflexxaccessnewcontent1u" + i;
								id2 = "dbflexxaccessnewcontent2u" + i;
								id3 = "dbflexxaccessnewcontent3u" + i;
								id4 = "dbflexxaccessnewcontent4u" + i;
								tablecontent[i] = document.createElement("div");
								tablecontent[i].id = "dbflexxaccessnewcontent1u" + i;
								tablecontent[i].className = "dbflexxaccesnewkatinside";
								tablecontent[i].innerHTML = newusercontent[3]; 
								tablecontent[i].onclick = function () { highlightline(this.id,availibleuser.length); };
								
								tablecontent2[i] = document.createElement("div");
								tablecontent2[i].id = "dbflexxaccessnewcontent2u" + i;
								tablecontent2[i].className = "dbflexxaccesnewkatinside";
								tablecontent2[i].innerHTML = newusercontent[0] + " " + newusercontent[1];
								tablecontent2[i].onclick = function () { highlightline(this.id,availibleuser.length); };
								
								tablecontent3[i] = document.createElement("div");
								tablecontent3[i].id = "dbflexxaccessnewcontent3u" + i;
								tablecontent3[i].className = "dbflexxaccesnewkatinside";
								tablecontent3[i].innerHTML = newusercontent[2];
								tablecontent3[i].onclick = function () { highlightline(this.id,availibleuser.length); };
								
								tablecontent4[i] = document.createElement("div");
								tablecontent4[i].id = "dbflexxaccessnewcontent4u" + i;
								tablecontent4[i].className = "dbflexxaccesnewkatinside";
								tablecontent4[i].innerHTML = newusercontent[4];
								tablecontent4[i].onclick = function () { highlightline(this.id,availibleuser.length); };
								
								tablecontent5[i] = document.createElement("div");
								tablecontent5[i].id = "dbflexxaccessnewcontent5u" + i;
								tablecontent5[i].className = "dbflexxaccesnewkatinside";
								tablecontent5[i].innerHTML = newusercontent[6];
								tablecontent5[i].onclick = function () { highlightline(this.id,availibleuser.length); };
								
								tablecontent6[i] = document.createElement("div");
								tablecontent6[i].id = "dbflexxaccessnewcontent6u" + i;
								tablecontent6[i].className = "dbflexxaccesnewkatinside";
								tablecontent6[i].innerHTML = newusercontent[7];
								tablecontent6[i].onclick = function () { highlightline(this.id,availibleuser.length); };
								
								username.appendChild(tablecontent[i]);
								realname.appendChild(tablecontent2[i]);
								mail.appendChild(tablecontent3[i]);
								dareg.appendChild(tablecontent4[i]);
								stufe.appendChild(tablecontent5[i]);
								loginamount.appendChild(tablecontent6[i]);
							}
							tablecontentcontainer.appendChild(username);
							tablecontentcontainer.appendChild(realname);
							tablecontentcontainer.appendChild(mail);
							tablecontentcontainer.appendChild(dareg);
							tablecontentcontainer.appendChild(stufe);
							tablecontentcontainer.appendChild(loginamount);
							tablecontentcontainercontainer.appendChild(tablecontentcontainer);
							
							titlecontainer = document.createElement("div");
							titlecontainer.style.background = "#D2D2D2";
							titlecontainer.style.paddingLeft = "8px";
							
							titlecontainercontainer = document.createElement("div");
							titlecontainercontainer.style.overflow = "hidden";
							
							tabletitle = document.createElement("div");
							tabletitle.id = "dbflexxaccessnewtitle1";
							tabletitle.className = "dbflexxaccessnewtitle";								
							tabletitle.innerHTML = "Benutzername";
							tabletitle.style.width = username.offsetWidth + "px";
							
							tabletitle2 = document.createElement("div");
							tabletitle2.id = "dbflexxaccessnewtitle2";
							tabletitle2.className = "dbflexxaccessnewtitle";								
							tabletitle2.innerHTML = "Echter Name";
							tabletitle2.style.width = realname.offsetWidth + "px";
							
							tabletitle3 = document.createElement("div");
							tabletitle3.id = "dbflexxaccessnewtitle3";
							tabletitle3.className = "dbflexxaccessnewtitle";								
							tabletitle3.innerHTML = "E-Mail";
							tabletitle3.style.width = mail.offsetWidth + "px";
							
							tabletitle4 = document.createElement("div");
							tabletitle4.id = "dbflexxaccessnewtitle4";
							tabletitle4.className = "dbflexxaccessnewtitle";								
							tabletitle4.innerHTML = "Registrierungsdatum";
							tabletitle4.style.width = dareg.offsetWidth + "px";
							
							tabletitle5 = document.createElement("div");
							tabletitle5.id = "dbflexxaccessnewtitle5";
							tabletitle5.className = "dbflexxaccessnewtitle";								
							tabletitle5.innerHTML = "Benutzergruppe";
							tabletitle5.style.width = stufe.offsetWidth + "px";
							
							tabletitle6 = document.createElement("div");
							tabletitle6.id = "dbflexxaccessnewtitle6";
							tabletitle6.className = "dbflexxaccessnewtitle";								
							tabletitle6.innerHTML = "Logins";
							tabletitle6.style.width = loginamount.offsetWidth + "px";
							
							tablebreak = document.createElement("br");
							tablebreak.style.clear = "both";
							
							titlecontainer.appendChild(tabletitle);
							titlecontainer.appendChild(tabletitle2);
							titlecontainer.appendChild(tabletitle3);
							titlecontainer.appendChild(tabletitle4);
							titlecontainer.appendChild(tabletitle5);
							titlecontainer.appendChild(tabletitle6);
							titlecontainer.appendChild(tablebreak);
							titlecontainercontainer.appendChild(titlecontainer);
							content.insertBefore(titlecontainercontainer,tablecontentcontainercontainer);
							titlecontainer.style.minWidth = parseInt(titlecontainer.offsetWidth) + "px";
							username.style.width = tabletitle.offsetWidth + "px";
							realname.style.width = tabletitle2.offsetWidth + "px";
							mail.style.width = tabletitle3.offsetWidth + "px";
							dareg.style.width = tabletitle4.offsetWidth + "px";
							stufe.style.width = tabletitle5.offsetWidth + "px";
							loginamount.style.width = tabletitle6.offsetWidth + "px";
							
							var tabresizer = {
								dragobject: null,
								dragx: 0,
								width: 0,
								posx: 0,
								id: null,
								draginit: function (ereignis) {
									dragid = "dbflexxaccessnewtitle" + this.id.substr(23);
									tabresizer.id = this.id.substr(23)
									ereignis = ereignis ? ereignis : window.event;
									tabresizer.dragobject = document.getElementById(dragid);
									tabresizer.dragx = ereignis.clientX;
									tabresizer.width = parseInt(tabresizer.dragobject.offsetWidth);
									document.onmousemove = tabresizer.drag;
									document.onmouseup = tabresizer.dragstop;
									return false;
								},
								drag: function (ereignis) {
									ereignis = ereignis ? ereignis : window.event; 
									tabresizer.posx = ereignis.clientX;
									tabresizer.width = parseInt(tabresizer.dragobject.offsetWidth);
									if (tabresizer.width < 10) {
										tabresizer.dragobject.style.width = "10px";
										tabresizer.dragobject.parentNode.parentNode.parentNode.childNodes[2].firstChild.childNodes[tabresizer.id - 1].style.width = "10px";
									}
									
									else {
										tabresizer.dragobject.style.width = tabresizer.width + (tabresizer.posx - tabresizer.dragx) + "px";
										tabresizer.dragobject.parentNode.parentNode.parentNode.childNodes[2].firstChild.childNodes[tabresizer.id - 1].style.width = tabresizer.width + (tabresizer.posx - tabresizer.dragx) + "px"; 
									}
									totalwidth = 0;
									for (i = 0; i < titlecontainer.childNodes.length; i++) {
										totalwidth = totalwidth + parseInt(titlecontainer.childNodes[i].offsetWidth);
									}
									titlecontainer.style.width = totalwidth + "px";
									tabresizer.dragobject.parentNode.parentNode.parentNode.childNodes[2].firstChild.style.width = totalwidth + "px";
									resizetab[tabresizer.id - 1].style.left = parseInt(titlecontainer.childNodes[tabresizer.id - 1].offsetWidth) - 5 + "px";
									tabresizer.dragx = ereignis.clientX;
									return false;
								},
								dragstop: function () {
									tabresizer.width = parseInt(tabresizer.dragobject.offsetWidth);
									document.onmousemove = null;
									document.onmouseup = null;
									tabresizer.dragobject = null;
								}
							}
							
							resizetab = new Array();
							resizetab2 = new Array();
							for (i = 0; i < 6; i++) {
								resizetab[i] = document.createElement("div");
								resizetab[i].id = "dbflexxaccessresizetab1" + (i + 1);
								resizetab[i].style.position = "relative";
								resizetab[i].style.width = "5px";
								resizetab[i].style.height = parseInt(titlecontainer.childNodes[i].offsetHeight) + "px";
								resizetab[i].style.left = parseInt(titlecontainer.childNodes[i].offsetWidth) - 5 + "px";
								resizetab[i].style.top = - parseInt(titlecontainer.childNodes[i].offsetHeight) + "px";
								resizetab[i].onmousedown = tabresizer.draginit;
								resizetab[i].style.cursor = "e-resize";
								titlecontainer.childNodes[i].appendChild(resizetab[i]);
								titlecontainer.childNodes[i].style.height = parseInt(resizetab[i].offsetHeight) + "px";
								resizetab2[i] = document.createElement("div");
								resizetab2[i].id = "dbflexxaccessresizetab2" + (i + 1);
								resizetab2[i].style.position = "relative";
								resizetab2[i].style.width = "5px";
								resizetab2[i].style.height = parseInt(titlecontainer.childNodes[i].offsetHeight) + "px";
								resizetab2[i].style.left = "0px";
								resizetab2[i].style.top = - parseInt(titlecontainer.childNodes[i].offsetHeight) + "px";
								resizetab2[i].style.cursor = "w-resize";
								resizetab2[i].onmousedown = tabresizer.draginit; 
								if (titlecontainer.childNodes[i + 1] != "undefined") {
									titlecontainer.childNodes[i + 1].appendChild(resizetab2[i]);
									titlecontainer.childNodes[i + 1].style.height = parseInt(resizetab2[i].offsetHeight) + "px";
								}
							}
							
							
							
							
							
							function setactionbar (whichElement,nodeid) { 
								if (document.getElementById("dbflexxstatusleiste").innerHTML != "Fertig.") {
									addwarning("Die Benutzergruppen wurden noch nicht geladen.");
								}
								else {
									grouplabel = document.createElement("div");
									grouplabel.id = "dbflexxaccessnewgrouplabel";
									grouplabel.innerHTML = "Verschieben zu:";
									
									group = document.createElement("select");
									group.style.cssFloat = "left";
									group.id = "dbflexxaccessnewgroupselector";
									
									groupoption[0] = document.createElement("option");
									groupoption[0].innerHTML = "Bitte wählen";
									groupoption[0].value = "-2";
									
									yesbutton = document.createElement("div");
									yesbutton.className = "dbflexxactionbarbutton";
									yesbutton.id = "dbflexxaccessnewyes";
									
									yesbuttonimage = document.createElement("img");
									yesbuttonimage.src = "http://graphic.co2-filter.com/seite/dbflexxyes.png";
									yesbuttonimage.onclick = function () {
										if (yourrights.getElementsByTagName("newusers")[0].getElementsByTagName("edit")[0].firstChild.data == 1) {
										if (document.getElementById("dbflexxaccessnewgroupselector").options[document.getElementById("dbflexxaccessnewgroupselector").selectedIndex].value == -2) {
											adderror("Keine Benutzergruppe ausgewählt.");
										}
										
										else {
											var verfiynewuser = testajax();
											verfiynewuser.open('get', 'http://dievierte-gewalt.de/beta/scripts/useraccess.php?action=verify&id=' + whichElement + '&wa=' + document.getElementById("dbflexxaccessnewgroupselector").options[document.getElementById("dbflexxaccessnewgroupselector").selectedIndex].value, true);
											addloader("Weise Benutzergruppe zu ...");
											verfiynewuser.onreadystatechange = function () {
												if (verfiynewuser.readyState == 4) {
													if(verfiynewuser.responseText == "") {
														var localid = "dbflexxaccessnewcontent5u" + nodeid;
														var getText = getTextFromUserGroup(document.getElementById("dbflexxaccessnewgroupselector").options[document.getElementById("dbflexxaccessnewgroupselector").selectedIndex].value);
														document.getElementById(localid).innerHTML = getText;
													}
													else {
														adderror("Benutzergruppe konnte nicht zugewiesen werden: " + verfiynewuser.responseText);
													}
													stoploader();
												}
											}
											verfiynewuser.send(null);
										}
										}
										else {
											adderror("Benutzergruppe konnte nicht zugewiesen werden: Zugriff verweigert");
										}
									}
															
									group.appendChild(groupoption[0]);
									yesbutton.appendChild(yesbuttonimage);
									document.getElementById("dbflexxaccessactionbarcontent").innerHTML = "";
									document.getElementById("dbflexxaccessactionbarcontent").appendChild(grouplabel);
									document.getElementById("dbflexxaccessactionbarcontent").appendChild(group);
									document.getElementById("dbflexxaccessactionbarcontent").appendChild(yesbutton);
									
									for (i = 1; i <= usergroup.length; i++) {
										group.appendChild(groupoption[i]);
									}
								}
							}
							
							function highlightline (whichid,forlength) {
								number = whichid.substr(25);
								input1 = "dbflexxaccessnewcontent1u" + number;
								input2 = "dbflexxaccessnewcontent2u" + number;
								input3 = "dbflexxaccessnewcontent3u" + number;
								input4 = "dbflexxaccessnewcontent4u" + number;
								input5 = "dbflexxaccessnewcontent5u" + number;
								input6 = "dbflexxaccessnewcontent6u" + number;
								for (i = 0; i < forlength - 1; i++) {
									inputid1 = "dbflexxaccessnewcontent1u" + i;
									inputid2 = "dbflexxaccessnewcontent2u" + i;
									inputid3 = "dbflexxaccessnewcontent3u" + i;
									inputid4 = "dbflexxaccessnewcontent4u" + i;
									inputid5 = "dbflexxaccessnewcontent5u" + i;
									inputid6 = "dbflexxaccessnewcontent6u" + i;
									document.getElementById(inputid1).style.background = "none";
									document.getElementById(inputid2).style.background = "none";
									document.getElementById(inputid3).style.background = "none";
									document.getElementById(inputid4).style.background = "none";
									document.getElementById(inputid5).style.background = "none";
									document.getElementById(inputid6).style.background = "none";
								}
								document.getElementById(input1).style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)";
								document.getElementById(input2).style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)";
								document.getElementById(input3).style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)";
								document.getElementById(input4).style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)";
								document.getElementById(input5).style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)";
								document.getElementById(input6).style.background = "url(http://graphic.co2-filter.com/seite/listhighlight.png)";
								setactionbar(newuserid[number],number);
							}
						}
					}
					newusersrequest.send(null);
				}
					else
						content.innerHTML = "Zugriff verweigert.";
				}
}


