function listGroup()
{
var ServerRequest = false;
var mozillaFlag = false;
if (window.XMLHttpRequest)
	{
	ServerRequest = new XMLHttpRequest();	
	mozillaFlag = true;
	}
else if (window.ActiveXObject)
	{
	var avers = ["Microsoft.XMLHTTP", "MSXML2.XMLHTTP", "MSXML2.XMLHTTP.3.0",  "MSXML2.XMLHTTP.4.0", "MSXML2.XMLHTTP.5.0"];
                    for (var i = avers.length -1; i >= 0; i--) {
                          try {ServerRequest = new ActiveXObject(avers[i]);
                                return ServerRequest;
                          } catch(e) {}
	}	
	}
else
	{
	alert("Fehler. Request-Objekt konnte nicht erstellt werden.");
	}	
	ServerRequest.open("GET", "xml/groups.xml", true);   
    ServerRequest.setRequestHeader("Pragma", "no-cache");
    ServerRequest.setRequestHeader("Cache-Control", "must-revalidate");
    ServerRequest.setRequestHeader("If-Modified-Since", document.lastModified);
	ServerRequest.onreadystatechange = function() {	
	if (ServerRequest.readyState == 4 && ServerRequest.status == 200)
	{	
	var rohdaten = ServerRequest.responseXML;	
	if (mozillaFlag)
	{
	removeWhitespaces(rohdaten);
	}	
	writeGroup(rohdaten);
	}
	}	
	ServerRequest.send(null);
}

function writeGroup(xml)
{
hauptgruppen = xml.getElementsByTagName('gruppe');
hauptgruppentitel = xml.getElementsByTagName('titel');
var y = 0; 
var z = 0;
var hauptgruppenstring = "";
var writestring = "<div id=\"x8\" class=\"hauptgruppe\" onclick=\"checkMenu(this.id)\"><a href=\"index.php?content=product&id=8\">&Uuml;ber uns</a></div>";
writestring += '<div id="x8.1" class="subgruppe"><a href="index.php?content=agentur&id=8_1">Agentur</a></div>';
writestring += '<div id="x8.2" class="subgruppe"><a href="index.php?content=team&id=8_2">Team</a></div>';
writestring += '<div id="x8.3" class="subgruppe"><a href="index.php?content=jobs&id=8_3">Jobs</a></div>';
writestring += '<div id="x8.4" class="subgruppe"><a href="index.php?content=kontakt&id=8_4">Kontakt</a></div>';
for (y = 0; y < hauptgruppentitel.length; y++)
{
	writestring += '<div id="'+hauptgruppentitel[y].attributes.getNamedItem('id').nodeValue+'" class="hauptgruppe" onclick="checkMenu(this.id)"><a href="index.php?content=product&id='+hauptgruppentitel[y].attributes.getNamedItem('id').nodeValue.substr(1)+'">'+hauptgruppentitel[y].firstChild.nodeValue+'</a></div>\n';
	for (z = 1; z <= hauptgruppen[y].childNodes.length-1; z++)
	{		
		writestring += '<div id="'+hauptgruppen[y].childNodes[z].attributes.getNamedItem('id').nodeValue+'" class="subgruppe"><a href="index.php?content=product&id='+hauptgruppen[y].childNodes[z].attributes.getNamedItem('id').nodeValue.replace(/\./, "_").substr(1)+'">'+hauptgruppen[y].childNodes[z].firstChild.nodeValue+'</a></div>\n';
	}	
}
document.getElementById('gruppenliste_klein').innerHTML = writestring;
delete ServerRequest;
ServerRequest = null;
checkMenu(menuid);
if (document.getElementById(menuid2))
{
document.getElementById(menuid2).style.backgroundColor = "#D20003";
document.getElementById(menuid2).firstChild.style.color = "white";
}
if (document.getElementById(menuid))
{
document.getElementById(menuid).firstChild.style.color = "#D20003";
}
}


function checkMenu(id)
{	
	var i, j;
	var elements = getElementsByClassName('subgruppe');
	for (j = 0; j < elements.length; j++)
	{
	elements[j].style.display = "none";
	}
	for (i = 1; i <= 15; i++)		
	{
	if (document.getElementById(id+'_'+i) != null)
	{
	document.getElementById(id+'_'+i).style.display = "block";
	}	
	}
}
