var xmlHttp;
var ajax_object = null;
var ajax_run_function;
function ajax_load_url_to_object(object, url, fcia) {
	ajax_object = document.getElementById(object); 
	if (ajax_object) {
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)  {
			alert ("Your browser does not support AJAX!");
			return;
		} 
		ajax_run_function = fcia;
		xmlHttp.onreadystatechange = stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
} 
function ajax_eval_url(url) {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)  {
		alert ("Your browser does not support AJAX!");
		return;
	} 
	ajax_run_function = eval;
	xmlHttp.onreadystatechange = stateChanged;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);	
}
function stateChanged() { 
	if (xmlHttp.readyState==4) { 
		if (ajax_run_function == eval) eval(xmlHttp.responseText);
		else	if (ajax_object) {
			ajax_object.innerHTML = xmlHttp.responseText;
			if (ajax_run_function) ajax_run_function();
		}
	}
}

function GetXmlHttpObject() {
	var xmlHttp=null;
	try  {
  // Firefox, Opera 8.0+, Safari
  		xmlHttp=new XMLHttpRequest();
	}
	catch (e)  {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
