var xmlHttp

//first ajax form call
function showAJAXformValOne(stringVal,pageAction){
	//showAJAXformVal(value passed from field,asp page to process)
	//usage example:
	//	onchange="showAJAXformValOne(this.value,'ajax_execute_eventTypeList.asp?pair=1')"
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="/ajax/"+pageAction
	url=url+"&pID="+stringVal
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged(){
	//alert (xmlHttp.readyState);
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		document.getElementById("ajaxDivActionOne").innerHTML=xmlHttp.responseText 
	}
	return
}

//second ajax call for connected pairs of dropdowns
function showAJAXformValTwo(stringVal,pageAction){
	//showAJAXformVal(value passed from field,asp page to process)
	//usage example:
	//	onchange="showAJAXformValTwo(this.value,'ajax_execute_eventTypeList.asp?val=x')"
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="ajax/"+pageAction
	url=url+"&pID="+stringVal
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChangedTwo 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChangedTwo(){
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		document.getElementById("ajaxDivActionTwo").innerHTML=xmlHttp.responseText 
	} 
}


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;
}
