/*
 * File name:	xmlRequest.js
 * Date:	10/12/2006
 * Author:	Brian Schemp
*/


//variable to hold the request object
var req;

/*
 * Purpose:	Encapsulate a ajax request to a component
 * 
 * url				the url of the component
 * parameters		the parameters for the comonent
 * callbackMethod	the method/fuction to call once the request to the component is in progress
*/
function xmlRequest(url, parameters, callbackMethod)
{
	if (window.XMLHttpRequest)
	{
		req = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
	   req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	req.open("POST", url, true);
	req.onreadystatechange = callbackMethod;
	req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	req.send(parameters);
}
