var xmlHttp;

function runTwoAjax(div1, page1, div2, page2) {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
 	}
	var url=page1;
	if (div1.length > 0) {
		xmlHttp.onreadystatechange= function() {
			stateTwoChanged(div1, div2, page2)
		}; 
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function runAjax(div, page) {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
 	}
	var url=page;
	if (div.length > 0) {
		xmlHttp.onreadystatechange=function(){stateChanged(div)}; 
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateTwoChanged(str, div, page) {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
			result = xmlHttp.responseText;
			document.getElementById(str).innerHTML=result;
			runAjax(div, page);
		}
}

function stateChanged(str) {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
			result = xmlHttp.responseText;
			document.getElementById(str).innerHTML=result;
			//evalScript(result);
		}
}

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;
}