// JavaScript Document

//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.

// AJAX javascript used to load cfm pages in to the left menues and center content well (look for DIV tag with message) in the IR page.
function fetchData(url,dataToSend,objectID){
	var pageRequest = false
	if (window.XMLHttpRequest) {
		pageRequest = new XMLHttpRequest()
	}
	else if (window.ActiveXObject){ 
		try {
			pageRequest = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e) {
			try{
				pageRequest = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else return false
	pageRequest.onreadystatechange=function() {	
		var object = document.getElementById(objectID);
		object.innerHTML = pageRequest.responseText;
	}
	if (dataToSend) {		
		var sendData = 'sendData=' + dataToSend;
		pageRequest.open('POST',url,true);
    pageRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
   	pageRequest.send(sendData);
	}
	else {
		pageRequest.open('GET',url,true)
		pageRequest.send(null)	
	}
}

