// JavaScript Document
function _getAjaxHTTP() {
		try {
			return new ActiveXObject('Msxml2.XMLHTTP')
		} catch (e) {
			try {
				return new ActiveXObject('Microsoft.XMLHTTP')
			} catch (e) {
				return new XMLHttpRequest();
			}
		}
	}

/**
 * Perform AJAX call.
 *
 * @param {string} u URL of AJAX service.
 * @param {function} f Function to call when response arrives.
 * @param {string} m Request method post or get.
 * @param {Array} a Array with arguments to send.
*/
//#modif @adv : pbflienform001
function _sendAjax (u, f, m, a, xml, async) {
	var x = _getAjaxHTTP();
	
	if (async!=true) async = false;
	
  	x.open(m, u, !async);
	
	if (!async)
	{
		x.onreadystatechange = function() {
			if (x.readyState == 4){
			  if(xml){
				 f(x.responseXML);
			  }
			  else
			  {
				 f(x.responseText);
			  }
			}
		};
	}

	if (m.toUpperCase() == 'POST')
		x.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');

	x.send(a);
	if (async)
	{
		if(xml){
			f(x.responseXML);
		}
		else
		{
			f(x.responseText);
		}
	}
}

