// -------------------------------------------------------------------------------
// AJAX-functions start here;
var xmlHttp;
var area;

// The updatePage-function is called at every link;
function updatePage(PAGE,AREA,QUERY) {
	xmlHttp = GetXmlHttpObject();

	if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; }

	if (AREA != 0) {
		for (var i=4; i >= AREA; i--) {
			document.getElementById("flap_num" + i).style.display = "none";
			document.getElementById("flap_num" + i).innerHTML = "";
		}
	}

	area = "flap_num" + AREA;

	var url = "cms/" + PAGE + ".php?&sid=" + Math.random() + QUERY;

	xmlHttp.onreadystatechange = stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

	document.getElementById(area).style.display = "block";
}

// updates the requested field with new content;
function stateChanged() {
	if (xmlHttp.readyState==4) {
		document.getElementById(area).innerHTML=xmlHttp.responseText;
	}
}

// Function that checks if your browser is AJAX compatible.
function GetXmlHttpObject() {
	var xmlHttp = null;

	try {
		xmlHttp=new XMLHttpRequest();
	} catch (e) {
 		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

// AJAX-functions ends here;









