// JavaScript Document
var xmlHttp=null;

//The code below makes a new request object taking into account different browsers
function ajax(url , groupName , list , otherList , otherButton) {
	//alert("function called!");
	try {xmlHttp=new XMLHttpRequest();}
	catch(e)
			{ try {xmlHttp= new ActiveXObject("msxml2.XMLHTTP");}
	catch (e)
			{ try {xmlHttp= new ActiveXObject ("Microsoft.XMLHTTP")}
	catch (e)
			{ alert ("your browser does not support AJAX!");
				return false;}
		}}


//the code below defines the function to perform when ready
xmlHttp.onreadystatechange= function() {
	if(xmlHttp.readyState==4){
		if(xmlHttp.status==200) {
//the code below is the function statements and actions
button = document.getElementById(groupName)
other_List = document.getElementById(otherList);
other_Button = document.getElementById(otherButton);
if ( button.className == "closed"  ){
document.getElementById(list).innerHTML = xmlHttp.responseText;
//document.getElementById('content').innerHTML = null;
button.className = "opened";
other_List.innerHTML = "";
other_Button.className = "closed";}
else {
	document.getElementById(list).innerHTML = "";
	//document.getElementById('content').innerHTML = null;
	button.className = "closed";}
}}}

//the code below initiates the Ajax request
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}