function loadurl(dest) {
	try {
	xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
	} catch (e) {
		// browser doesn't support ajax. handle however you want
		alert("Browser ondersteunt geen AJAX");
	}

	// the xmlhttp object triggers an event everytime the status changes
	// triggered() function handles the events
	xmlhttp.onreadystatechange = triggered;
	// open takes in the HTTP method and url.
	xmlhttp.open("GET", dest);
	// send the request. if this is a POST request we would have
	// sent post variables: send("name=aleem&gender=male)
	// Moz is fine with just send(); but
	// IE expects a value here, hence we do send(null);
	xmlhttp.send(null);
}

function triggered() {
	// if the readyState code is 4 (Completed)
	// and http status is 200 (OK) we go ahead and get the responseText
	// other readyState codes:
	// 0=Uninitialised 1=Loading 2=Loaded 3=Interactive
	if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
		// xmlhttp.responseText object contains the response.
		document.getElementById("output").innerHTML = xmlhttp.responseText;
	}
}

function loadurlto(dest,target){
        try {
        http = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {
                // browser doesn't support ajax. handle however you want
                alert("Browser ondersteunt geen AJAX");
        }

        http.onreadystatechange = function() {
                if ((http.readyState == 4) && (http.status == 200)) {
                        document.getElementById(target).innerHTML = http.responseText;
                }
        }
        http.open("GET", dest);
        http.send(null);
}



function loadstatus(){
	try {
	statusobj = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {
                // browser doesn't support ajax. handle however you want
                alert("Browser ondersteunt geen AJAX");
        }

	statusobj.onreadystatechange = statustriggerd;
        statusobj.open("GET", "/renderstatus.php");
	statusobj.send(null);
}

function statustriggerd() {
	if ((statusobj.readyState == 4) && (statusobj.status == 200)) {
		document.getElementById("statusbox").innerHTML = statusobj.responseText;
		setTimeout("loadstatus();",30000);
	}
}

function showsmallloader(div){
	document.getElementById(div).innerHTML = "<img src='/gfx/ajax-smallloader.gif' ALT='loading'>";
}

function showloader(div){
	document.getElementById(div).innerHTML = "<img src='/gfx/ajax-loader.gif' ALT='loading'>";
}

