var page="home";
function loadurl(dest, element) {
	try {
		// Moz supports XMLHttpRequest. IE uses ActiveX.
		// browser detction is bad. object detection works for any browser
		xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
			// browser doesn't support ajax. handle however you want
		}
		var currentButton = document.getElementById(page);
		currentButton.src="images/"+page+"_inactive.png";
		element.src="images/"+element.id+"_active.png";
		page=element.id;
		
		xmlhttp.onreadystatechange = triggered;	
		xmlhttp.open("GET", dest);
		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("content").innerHTML = xmlhttp.responseText;
	}
}

function loaddir(dest) {
	try {
		// Moz supports XMLHttpRequest. IE uses ActiveX.
		// browser detction is bad. object detection works for any browser
		xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
			// browser doesn't support ajax. handle however you want
		}
		
		xmlhttp.onreadystatechange = triggered;	
		xmlhttp.open("GET", dest);
		xmlhttp.send(null);
}

