//javascript for ansatte
function getEmployees(folderid,div_id){
	if(document.getElementById(div_id).style.display == 'none'){
		document.getElementById(div_id).style.display = 'block';
		document.getElementById(div_id).innerHTML = "<div class='loading'><img src='gfx/loading3.gif' /></div>";
		document.getElementById('arrow_'+folderid).src = 'gfx/icon-office-imp.gif';
		var xmlhttp=false; //Clear our fetching variable
		try {
			xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object
		} catch (e) {
			try {
				xmlhttp = new
				ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
			} catch (E) {
				xmlhttp = false;
			}
		}
		if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
			xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
		}
		var file = 'proc/getemployees?folderid='+folderid; //This is the path to the file we just finished making *
		xmlhttp.open('GET', file, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
				var content = xmlhttp.responseText; //The content data which has been retrieved ***
				//alert(content);
				if( content ){ //Make sure there is something in the content variable
					document.getElementById(div_id).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
				}
			}
		}
		xmlhttp.send(null) //Nullify the XMLHttpRequest
		return;
	}else{
		document.getElementById(div_id).innerHTML = '';
		document.getElementById(div_id).style.display = 'none';
		document.getElementById('arrow_'+folderid).src = 'gfx/icon-office-exp.gif';
	}
}
