/* AJAX */

var ajax_obj;
var ajax_post_params = null;
var ajax_isRunning = false;

if (typeof XMLHttpRequest != 'undefined') {
	ajax_obj = new XMLHttpRequest();
} else {
	try	{
		ajax_obj = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (error) {
		try {
			ajax_obj = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			ajax_obj = false;
		}
	}
}

// you can send parameters either with the GET string (attach them to the url variable)
// or with POST (set the ajax_post_params variable) or both.
function ajax_doRequest(url, handle) {
	if (!ajax_isRunning && ajax_obj) {
		while (url.search(/amp;/) != -1) {
			url = url.replace(/amp;/, '');
		}
		ajax_obj.open("GET", url, true);
		// ajax_obj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajax_obj.onreadystatechange = handle;
		ajax_isRunning = true;
		ajax_obj.send(null); // ajax_post_params
		ajax_post_params = null;
	}
}

/* Example Request Handler
function handleExampleRequest() {
	if (ajax.readyState == 4) {
		if (ajax.responseText.length > 0) {
			// Do something with the responseText or responseXML
		}
		isRunning = false;
	}
}
*/
