function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
		if (xmlHttp.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //xmlHttp.overrideMimeType('text/xml');
            xmlHttp.overrideMimeType('text/html');
         }
	}
	catch (e){
    	// Internet Explorer
	    try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
    }
	return xmlHttp;
}

function close_all_dirs(upto)
{
	for (i = 0; i<=upto; i++)
	{
		document.getElementById('dir'+i).style.display = "none";
	}
}
function open_dir(dirID, load_info_id, load_info_from)
{
	if ( document.getElementById('dir'+dirID).style.display == "block"){
		document.getElementById('dir'+dirID).style.display = "none";
	} else {
		document.getElementById('dir'+dirID).style.display = "block";
	}
	if(load_info_from  > 0 ){
		load_info(load_info_id, load_info_from);
	}
}
function load_info(id,load_info_from)
{
	var xhr = GetXmlHttpObject();
	xhr.open("POST", "assist.php", true);		
	xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	xhr.onreadystatechange=function(){
		if(xhr.readyState == 4){
			document.getElementById('loaded_info').innerHTML = xhr.responseText;
		}
	}
	xhr.send("load_from=" + load_info_from+ "&id="+id); 
	xhr.setRequestHeader('Connection', 'close');
}