// JavaScript Document

var xmlHttp=null;

//The code below makes a new request object taking into account different browsers
function droplist(id , url) {
	//alert(id + url);
	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
year = document.getElementById(id)
if (year.className == "closed"){
var years = document.getElementsByName('years');
var x;
for (x=0; x<years.length; x++) {
	years[x].className="closed";}
	
	var sublist = document.getElementsByName('sublist');
var y;
for (y=0; y<sublist.length; y++) {
	sublist[y].innerHTML="";}

document.getElementById(id+"sublist").innerHTML +=  xmlHttp.responseText ;

//document.getElementById('content').innerHTML = null;
year.className = "opened";}

else {
	year.className = "closed";
	document.getElementById(id+"sublist").innerHTML =  "";
}

}}}

//the code below initiates the Ajax request
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
